Skip to content

Commit f08e484

Browse files
author
David Legland
committed
add deprecation warnings
1 parent a3c1642 commit f08e484

52 files changed

Lines changed: 348 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎src/main/java/inra/ijpb/binary/ChamferWeights.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,29 +53,36 @@
5353
public enum ChamferWeights
5454
{
5555
/** Use weight equal to 1 for all neighbors */
56+
@Deprecated
5657
CHESSBOARD("Chessboard (1,1)", new short[] { 1, 1 }),
5758
/** Use weights 1 for orthogonal neighbors and 2 for diagonal neighbors */
59+
@Deprecated
5860
CITY_BLOCK("City-Block (1,2)", new short[] { 1, 2 }),
5961
/**
6062
* Use weights 1 for orthogonal neighbors and sqrt(2) for diagonal
6163
* neighbors. Use 10 and 14 for short version.
6264
*/
65+
@Deprecated
6366
QUASI_EUCLIDEAN("Quasi-Euclidean (1,1.41)",
6467
new short[] { 10, 14 },
6568
new float[] {1, (float) Math.sqrt(2) }),
6669
/**
6770
* Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors (best
6871
* approximation of Euclidean distance for 3-by-3 masks)
6972
*/
73+
@Deprecated
7074
BORGEFORS("Borgefors (3,4)", new short[] { 3, 4 }),
7175
/** Use weights 2 for orthogonal neighbors and 3 for diagonal neighbors */
76+
@Deprecated
7277
WEIGHTS_23("Weights (2,3)", new short[] { 2, 3 }),
7378
/** Use weights 5 for orthogonal neighbors and 7 for diagonal neighbors */
79+
@Deprecated
7480
WEIGHTS_57("Weights (5,7)", new short[] { 5, 7 }),
7581
/**
7682
* Use weights 5 for orthogonal neighbors and 7 for diagonal neighbors, and
7783
* 11 for chess-knight moves (best approximation for 5-by-5 masks).
7884
*/
85+
@Deprecated
7986
CHESSKNIGHT("Chessknight (5,7,11)", new short[] { 5, 7, 11 });
8087

8188
private final String label;
@@ -102,6 +109,7 @@ private ChamferWeights(String label, short[] shortWeights,
102109
/**
103110
* @return the weights as shorts
104111
*/
112+
@Deprecated
105113
public short[] getShortWeights()
106114
{
107115
return this.shortWeights;
@@ -110,6 +118,7 @@ public short[] getShortWeights()
110118
/**
111119
* @return the weights as floats
112120
*/
121+
@Deprecated
113122
public float[] getFloatWeights()
114123
{
115124
return this.floatWeights;
@@ -118,6 +127,7 @@ public float[] getFloatWeights()
118127
/**
119128
* @return the label associated to this chamfer weight
120129
*/
130+
@Deprecated
121131
public String toString()
122132
{
123133
return this.label;
@@ -126,6 +136,7 @@ public String toString()
126136
/**
127137
* @return all the chamfer weights labels
128138
*/
139+
@Deprecated
129140
public static String[] getAllLabels()
130141
{
131142
int n = ChamferWeights.values().length;
@@ -147,6 +158,7 @@ public static String[] getAllLabels()
147158
* @throws IllegalArgumentException
148159
* if label name is not recognized.
149160
*/
161+
@Deprecated
150162
public static ChamferWeights fromLabel(String label)
151163
{
152164
if (label != null)

‎src/main/java/inra/ijpb/binary/ChamferWeights3D.java‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,36 @@
5454
public enum ChamferWeights3D
5555
{
5656
/** Use weight equal to 1 for all neighbors */
57+
@Deprecated
5758
CHESSBOARD("Chessboard (1,1,1)", new short[] { 1, 1, 1 }),
5859
/**
5960
* Use weights 1 for orthogonal neighbors and 2 for diagonal neighbors,
6061
* and 3 for cube-diagonals.
6162
*/
63+
@Deprecated
6264
CITY_BLOCK("City-Block (1,2,3)", new short[] { 1, 2, 3 }),
6365
/**
6466
* Use weights 1 for orthogonal neighbors and sqrt(2) for diagonal
6567
* neighbors, and sqrt(3) for cube-diagonals.
6668
* Use 10, 14 and 17 for short version.
6769
*/
70+
@Deprecated
6871
QUASI_EUCLIDEAN("Quasi-Euclidean (1,1.41,1.73)",
6972
new short[] { 10, 14, 17 },
7073
new float[] { 1, (float) Math.sqrt(2), (float) Math.sqrt(3) }),
7174
/**
7275
* Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors,
7376
* and 5 for cube-diagonals (best approximation for 3-by-3-by-3 masks).
7477
*/
78+
@Deprecated
7579
BORGEFORS("Borgefors (3,4,5)", new short[] { 3, 4, 5 }),
7680

7781
/**
7882
* Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors, and
7983
* 5 for cube-diagonals, and 7 for (2,1,1) shifts. Good approximation using
8084
* only four weights, and keeping low value of orthogonal weight.
8185
*/
86+
@Deprecated
8287
WEIGHTS_3_4_5_7("Svensson <3,4,5,7>", new short[] { 3, 4, 5, 7 });
8388

8489
private final String label;
@@ -105,6 +110,7 @@ private ChamferWeights3D(String label, short[] shortWeights,
105110
/**
106111
* @return the weights as shorts
107112
*/
113+
@Deprecated
108114
public short[] getShortWeights()
109115
{
110116
return this.shortWeights;
@@ -113,6 +119,7 @@ public short[] getShortWeights()
113119
/**
114120
* @return the weights as floats
115121
*/
122+
@Deprecated
116123
public float[] getFloatWeights()
117124
{
118125
return this.floatWeights;
@@ -121,6 +128,7 @@ public float[] getFloatWeights()
121128
/**
122129
* @return the label associated to this chamfer weight
123130
*/
131+
@Deprecated
124132
public String toString()
125133
{
126134
return this.label;
@@ -129,6 +137,7 @@ public String toString()
129137
/**
130138
* @return all the chamfer weights labels
131139
*/
140+
@Deprecated
132141
public static String[] getAllLabels()
133142
{
134143
int n = ChamferWeights3D.values().length;
@@ -150,6 +159,7 @@ public static String[] getAllLabels()
150159
* @throws IllegalArgumentException
151160
* if label name is not recognized.
152161
*/
162+
@Deprecated
153163
public static ChamferWeights3D fromLabel(String label)
154164
{
155165
if (label != null)
@@ -191,6 +201,7 @@ public static ChamferWeights3D fromLabel(String label)
191201
* @return a collection of offset encapsulating the shift in x, y and z
192202
* directions, and the associated weight.
193203
*/
204+
@Deprecated
194205
public static Collection<ShortOffset> getForwardOffsets(short[] weights)
195206
{
196207
int nWeights = weights.length;
@@ -268,6 +279,7 @@ public static Collection<ShortOffset> getForwardOffsets(short[] weights)
268279
* @return a collection of offset encapsulating the shift in x, y and z
269280
* directions, and the associated weight.
270281
*/
282+
@Deprecated
271283
public static Collection<FloatOffset> getForwardOffsets(float[] weights)
272284
{
273285
int nWeights = weights.length;
@@ -345,6 +357,7 @@ public static Collection<FloatOffset> getForwardOffsets(float[] weights)
345357
* @return a collection of offset encapsulating the shift in x, y and z
346358
* directions, and the associated weight.
347359
*/
360+
@Deprecated
348361
public static Collection<ShortOffset> getBackwardOffsets(short[] weights)
349362
{
350363
int nWeights = weights.length;
@@ -422,6 +435,7 @@ public static Collection<ShortOffset> getBackwardOffsets(short[] weights)
422435
* @return a collection of offset encapsulating the shift in x, y and z
423436
* directions, and the associated weight.
424437
*/
438+
@Deprecated
425439
public static Collection<FloatOffset> getBackwardOffsets(float[] weights)
426440
{
427441
int nWeights = weights.length;
@@ -481,12 +495,16 @@ public static Collection<FloatOffset> getBackwardOffsets(float[] weights)
481495
public static class ShortOffset
482496
{
483497
/** the offset along the X-axis */
498+
@Deprecated
484499
public final int dx;
485500
/** the offset along the Y-axis */
501+
@Deprecated
486502
public final int dy;
487503
/** the offset along the Z-axis */
504+
@Deprecated
488505
public final int dz;
489506
/** the weight associated to this offset */
507+
@Deprecated
490508
public final short weight;
491509

492510
/**
@@ -501,6 +519,7 @@ public static class ShortOffset
501519
* @param weight
502520
* the weight associated to this offset
503521
*/
522+
@Deprecated
504523
public ShortOffset(int dx, int dy, int dz, short weight)
505524
{
506525
this.dx = dx;
@@ -517,12 +536,16 @@ public ShortOffset(int dx, int dy, int dz, short weight)
517536
public static class FloatOffset
518537
{
519538
/** the offset along the X-axis */
539+
@Deprecated
520540
public final int dx;
521541
/** the offset along the Y-axis */
542+
@Deprecated
522543
public final int dy;
523544
/** the offset along the Z-axis */
545+
@Deprecated
524546
public final int dz;
525547
/** the weight associated to this offset */
548+
@Deprecated
526549
public final float weight;
527550

528551
/**
@@ -537,6 +560,7 @@ public static class FloatOffset
537560
* @param weight
538561
* the weight associated to this offset
539562
*/
563+
@Deprecated
540564
public FloatOffset(int dx, int dy, int dz, float weight)
541565
{
542566
this.dx = dx;

‎src/main/java/inra/ijpb/binary/distmap/DistanceTransform3D4WeightsFloat.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public class DistanceTransform3D4WeightsFloat extends AlgoStub implements Distan
7979
* Default constructor that specifies the chamfer weights.
8080
* @param weights an array of four weights direction orthogonal, diagonal, cube diagonal, and (+-2,+-1,+-1).
8181
*/
82+
@Deprecated
8283
public DistanceTransform3D4WeightsFloat(ChamferWeights3D weights)
8384
{
8485
this(weights.getFloatWeights(), true);
@@ -88,6 +89,7 @@ public DistanceTransform3D4WeightsFloat(ChamferWeights3D weights)
8889
* Default constructor that specifies the chamfer weights.
8990
* @param weights an array of four weights direction orthogonal, diagonal, cube diagonal, and (+-2,+-1,+-1).
9091
*/
92+
@Deprecated
9193
public DistanceTransform3D4WeightsFloat(float[] weights)
9294
{
9395
this.weights = weights;
@@ -105,6 +107,7 @@ public DistanceTransform3D4WeightsFloat(float[] weights)
105107
* flag indicating whether the final distance map should be
106108
* normalized by the first weight
107109
*/
110+
@Deprecated
108111
public DistanceTransform3D4WeightsFloat(ChamferWeights3D weights, boolean normalize)
109112
{
110113
this(weights.getFloatWeights(), normalize);
@@ -118,6 +121,7 @@ public DistanceTransform3D4WeightsFloat(ChamferWeights3D weights, boolean normal
118121
* flag indicating whether the final distance map should be
119122
* normalized by the first weight
120123
*/
124+
@Deprecated
121125
public DistanceTransform3D4WeightsFloat(float[] weights, boolean normalize)
122126
{
123127
this(weights);
@@ -141,6 +145,7 @@ public DistanceTransform3D4WeightsFloat(float[] weights, boolean normalize)
141145
* <li>the distance to the nearest background pixel otherwise</li>
142146
* </ul>
143147
*/
148+
@Deprecated
144149
public ImageStack distanceMap(ImageStack image)
145150
{
146151
// size of image

‎src/main/java/inra/ijpb/binary/distmap/DistanceTransform3D4WeightsShort.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public class DistanceTransform3D4WeightsShort extends AlgoStub implements Distan
8282
* Default constructor that specifies the chamfer weights.
8383
* @param weights an array of two weights for orthogonal and diagonal directions
8484
*/
85+
@Deprecated
8586
public DistanceTransform3D4WeightsShort(ChamferWeights3D weights)
8687
{
8788
this(weights.getShortWeights());
@@ -91,6 +92,7 @@ public DistanceTransform3D4WeightsShort(ChamferWeights3D weights)
9192
* Default constructor that specifies the chamfer weights.
9293
* @param weights an array of two weights for orthogonal and diagonal directions
9394
*/
95+
@Deprecated
9496
public DistanceTransform3D4WeightsShort(short[] weights)
9597
{
9698
this.weights = weights;
@@ -108,6 +110,7 @@ public DistanceTransform3D4WeightsShort(short[] weights)
108110
* flag indicating whether the final distance map should be
109111
* normalized by the first weight
110112
*/
113+
@Deprecated
111114
public DistanceTransform3D4WeightsShort(ChamferWeights3D weights, boolean normalize)
112115
{
113116
this(weights.getShortWeights(), normalize);
@@ -121,6 +124,7 @@ public DistanceTransform3D4WeightsShort(ChamferWeights3D weights, boolean normal
121124
* flag indicating whether the final distance map should be
122125
* normalized by the first weight
123126
*/
127+
@Deprecated
124128
public DistanceTransform3D4WeightsShort(short[] weights, boolean normalize)
125129
{
126130
this(weights);
@@ -142,6 +146,7 @@ public DistanceTransform3D4WeightsShort(short[] weights, boolean normalize)
142146
* <li> the distance to the nearest background pixel otherwise</li>
143147
* </ul>
144148
*/
149+
@Deprecated
145150
public ImageStack distanceMap(ImageStack image)
146151
{
147152
// size of image

‎src/main/java/inra/ijpb/binary/distmap/DistanceTransform3DFloat.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public class DistanceTransform3DFloat extends AlgoStub implements DistanceTransf
7878
* @param weights
7979
* an array of two weights for orthogonal and diagonal directions
8080
*/
81+
@Deprecated
8182
public DistanceTransform3DFloat(ChamferWeights3D weights)
8283
{
8384
this(weights.getFloatWeights());
@@ -89,6 +90,7 @@ public DistanceTransform3DFloat(ChamferWeights3D weights)
8990
* @param weights
9091
* an array of two weights for orthogonal and diagonal directions
9192
*/
93+
@Deprecated
9294
public DistanceTransform3DFloat(float[] weights)
9395
{
9496
this.weights = weights;
@@ -104,6 +106,7 @@ public DistanceTransform3DFloat(float[] weights)
104106
* flag indicating whether the final distance map should be
105107
* normalized by the first weight
106108
*/
109+
@Deprecated
107110
public DistanceTransform3DFloat(ChamferWeights3D weights, boolean normalize)
108111
{
109112
this(weights.getFloatWeights(), normalize);
@@ -119,6 +122,7 @@ public DistanceTransform3DFloat(ChamferWeights3D weights, boolean normalize)
119122
* flag indicating whether the final distance map should be
120123
* normalized by the first weight
121124
*/
125+
@Deprecated
122126
public DistanceTransform3DFloat(float[] weights, boolean normalize)
123127
{
124128
this.weights = weights;
@@ -142,6 +146,7 @@ public DistanceTransform3DFloat(float[] weights, boolean normalize)
142146
* <li>the distance to the nearest background pixel otherwise</li>
143147
* </ul>
144148
*/
149+
@Deprecated
145150
public ImageStack distanceMap(ImageStack image)
146151
{
147152
// size of image

‎src/main/java/inra/ijpb/binary/distmap/DistanceTransform3DShort.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class DistanceTransform3DShort extends AlgoStub implements DistanceTransf
7777
* Default constructor that specifies the chamfer weights.
7878
* @param weights an array of two weights for orthogonal and diagonal directions
7979
*/
80+
@Deprecated
8081
public DistanceTransform3DShort(ChamferWeights3D weights)
8182
{
8283
this(weights.getShortWeights());
@@ -86,6 +87,7 @@ public DistanceTransform3DShort(ChamferWeights3D weights)
8687
* Default constructor that specifies the chamfer weights.
8788
* @param weights an array of two weights for orthogonal and diagonal directions
8889
*/
90+
@Deprecated
8991
public DistanceTransform3DShort(short[] weights)
9092
{
9193
this.weights = weights;
@@ -99,6 +101,7 @@ public DistanceTransform3DShort(short[] weights)
99101
* flag indicating whether the final distance map should be
100102
* normalized by the first weight
101103
*/
104+
@Deprecated
102105
public DistanceTransform3DShort(ChamferWeights3D weights, boolean normalize)
103106
{
104107
this(weights.getShortWeights(), normalize);
@@ -112,6 +115,7 @@ public DistanceTransform3DShort(ChamferWeights3D weights, boolean normalize)
112115
* flag indicating whether the final distance map should be
113116
* normalized by the first weight
114117
*/
118+
@Deprecated
115119
public DistanceTransform3DShort(short[] weights, boolean normalize)
116120
{
117121
this.weights = weights;
@@ -133,6 +137,7 @@ public DistanceTransform3DShort(short[] weights, boolean normalize)
133137
* <li> the distance to the nearest background pixel otherwise</li>
134138
* </ul>
135139
*/
140+
@Deprecated
136141
public ImageStack distanceMap(ImageStack image)
137142
{
138143
// size of image

0 commit comments

Comments
 (0)