Skip to content

Commit 1765d54

Browse files
committed
Add Op annotations to relevant static methods
1 parent 2d8ae77 commit 1765d54

Some content is hidden

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

52 files changed

+3121
-117
lines changed

pom.xml

+19-1
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ Jean-Yves Tinevez and Michael Zinsmaier.</license.copyrightOwners>
200200

201201
<!-- NB: Deploy releases to the SciJava Maven repository. -->
202202
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>
203-
204203
<net.imglib2.imglib2.version>6.2.0</net.imglib2.imglib2.version>
204+
<scijava.parse.ops>true</scijava.parse.ops>
205205
</properties>
206206

207207
<repositories>
@@ -280,6 +280,24 @@ Jean-Yves Tinevez and Michael Zinsmaier.</license.copyrightOwners>
280280

281281
<build>
282282
<plugins>
283+
<plugin>
284+
<artifactId>maven-compiler-plugin</artifactId>
285+
<configuration>
286+
<annotationProcessorPaths>
287+
<path>
288+
<groupId>org.scijava</groupId>
289+
<artifactId>scijava-ops-indexer</artifactId>
290+
<version>0-SNAPSHOT</version>
291+
</path>
292+
</annotationProcessorPaths>
293+
<fork>true</fork>
294+
<showWarnings>true</showWarnings>
295+
<compilerArgs>
296+
<arg>-Aparse.ops=${scijava.parse.ops}</arg>
297+
<arg>-Aop.version=${project.version}</arg>
298+
</compilerArgs>
299+
</configuration>
300+
</plugin>
283301
<plugin>
284302
<artifactId>maven-javadoc-plugin</artifactId>
285303
<configuration>

src/main/java/net/imglib2/algorithm/binary/Thresholder.java

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class Thresholder
5959
* Returns a new boolean {@link Img} generated by thresholding the values of
6060
* the source image.
6161
*
62+
* @implNote op name='threshold.value',type=Function
6263
* @param source
6364
* the image to threshold.
6465
* @param threshold

src/main/java/net/imglib2/algorithm/componenttree/BuildComponentTree.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ public final class BuildComponentTree< T extends Type< T >, C extends PartialCom
8686
* {@link PartialComponent.Handler} which is responsible for building up the
8787
* tree structure. An implementations of {@link PartialComponent.Handler} is
8888
* provided for example by {@link PixelListComponentTree}.
89-
*
89+
*
90+
* @implNote op name='componenttree.buildComponentTree',type=Function
9091
* @param input
9192
* input image.
9293
* @param componentGenerator
@@ -110,7 +111,8 @@ public static < T extends Type< T >, C extends PartialComponent< T, C > > void b
110111
* {@link PartialComponent.Handler} which is responsible for building up the
111112
* tree structure. An implementations of {@link PartialComponent.Handler} is
112113
* provided for example by {@link PixelListComponentTree}.
113-
*
114+
*
115+
* @implNote op name='componenttree.buildComponentTree',type=Function
114116
* @param input
115117
* input image of a comparable value type.
116118
* @param componentGenerator

src/main/java/net/imglib2/algorithm/componenttree/mser/MserTree.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ public final class MserTree< T extends Type< T > > implements ComponentForest< M
105105
* {@link #buildMserTree(RandomAccessibleInterval, RealType, long, long, double, double, ImgFactory, boolean)}
106106
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
107107
* input image size.
108-
*
108+
*
109+
* @implNote op name='componenttree.buildMserTree',type=Function
109110
* @param input
110111
* the input image.
111112
* @param delta
@@ -133,7 +134,8 @@ public static < T extends RealType< T > > MserTree< T > buildMserTree( final Ran
133134
* {@link #buildMserTree(RandomAccessibleInterval, RealType, long, long, double, double, ImgFactory, boolean)}
134135
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
135136
* input image size.
136-
*
137+
*
138+
* @implNote op name='componenttree.buildMserTree',type=Function
137139
* @param input
138140
* the input image.
139141
* @param delta
@@ -159,7 +161,8 @@ public static < T extends RealType< T > > MserTree< T > buildMserTree( final Ran
159161

160162
/**
161163
* Build a MSER tree from an input image.
162-
*
164+
*
165+
* @implNote op name='componenttree.buildMserTree',type=Function
163166
* @param input
164167
* the input image.
165168
* @param delta
@@ -198,7 +201,8 @@ public static < T extends RealType< T > > MserTree< T > buildMserTree( final Ran
198201
* {@link #buildMserTree(RandomAccessibleInterval, ComputeDelta, long, long, double, double, ImgFactory, Type, Comparator)}
199202
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
200203
* input image size.
201-
*
204+
*
205+
* @implNote op name='componenttree.buildMserTree',type=Function
202206
* @param input
203207
* the input image.
204208
* @param computeDelta
@@ -226,7 +230,8 @@ public static < T extends Type< T > > MserTree< T > buildMserTree( final RandomA
226230

227231
/**
228232
* Build a MSER tree from an input image.
229-
*
233+
*
234+
* @implNote op name='componenttree.buildMserTree',type=Function
230235
* @param input
231236
* the input image.
232237
* @param computeDelta

src/main/java/net/imglib2/algorithm/componenttree/pixellist/PixelListComponentTree.java

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public final class PixelListComponentTree< T extends Type< T > > implements Comp
7474
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
7575
* input image size.
7676
*
77+
* @implNote op name='componenttree.buildPixelListComponentTree',type=Function
7778
* @param input
7879
* the input image.
7980
* @param type
@@ -92,6 +93,7 @@ public static < T extends RealType< T > > PixelListComponentTree< T > buildCompo
9293
/**
9394
* Build a component tree from an input image.
9495
*
96+
* @implNote op name='componenttree.buildPixelListComponentTree',type=Function
9597
* @param input
9698
* the input image.
9799
* @param type
@@ -120,6 +122,7 @@ public static < T extends RealType< T > > PixelListComponentTree< T > buildCompo
120122
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
121123
* input image size.
122124
*
125+
* @implNote op name='componenttree.buildPixelListComponentTree',type=Function
123126
* @param input
124127
* the input image.
125128
* @param maxValue
@@ -138,6 +141,7 @@ public static < T extends Type< T > > PixelListComponentTree< T > buildComponent
138141
/**
139142
* Build a component tree from an input image.
140143
*
144+
* @implNote op name='componenttree.buildPixelListComponentTree',type=Function
141145
* @param input
142146
* the input image.
143147
* @param maxValue

src/main/java/net/imglib2/algorithm/convolution/fast_gauss/FastGauss.java

+12
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,33 @@ public class FastGauss
7878
return Convolution.concat( steps );
7979
}
8080

81+
/**
82+
* @implNote op name='convolve.fastGauss',type=Function
83+
*/
8184
public static Convolution< RealType< ? > > convolution( final double sigma )
8285
{
8386
return new MultiDimensionConvolution<>( k -> convolution( nCopies( k, sigma ) ) );
8487
}
8588

89+
/**
90+
* @implNote op name='convolve.fastGauss',type=Function
91+
*/
8692
public static Convolution< RealType< ? > > convolution1d( final double sigma, final int direction )
8793
{
8894
return new LineConvolution<>( new FastGaussConvolverRealType( sigma ), direction );
8995
}
9096

97+
/**
98+
* @implNote op name='convolve.fastGauss',type=Computer
99+
*/
91100
public static void convolve( final double[] sigmas, final RandomAccessible< ? extends RealType< ? > > input, final RandomAccessibleInterval< ? extends RealType< ? > > output )
92101
{
93102
convolution( sigmas ).process( input, output );
94103
}
95104

105+
/**
106+
* @implNote op name='convolve.fastGauss',type=Computer
107+
*/
96108
public static void convolve( final double sigma, final RandomAccessible< ? extends RealType< ? > > input, final RandomAccessibleInterval< ? extends RealType< ? > > output )
97109
{
98110
convolution( sigma ).process( input, output );

src/main/java/net/imglib2/algorithm/convolution/kernel/Kernel1D.java

+8
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ public class Kernel1D
5353
/**
5454
* Creates a one-dimensional symmetric convolution kernel.
5555
*
56+
* @implNote op name='create.kernel1DSymmetric',type=Function
5657
* @param halfKernel
5758
* the upper half (starting at the center pixel) of the symmetric
5859
* convolution kernel.
60+
* @return a {@link Kernel1D} used for one dimensional convolutions
5961
*/
6062
public static Kernel1D symmetric( final double... halfKernel )
6163
{
@@ -68,6 +70,7 @@ public static Kernel1D symmetric( final double... halfKernel )
6870
/**
6971
* Similar to {@link #symmetric(double[])} but creates an array of
7072
* one-dimensional convolution kernels.
73+
* @implNote op name='create.kernel1DSymmetric',type=Function
7174
*/
7275
public static Kernel1D[] symmetric( final double[][] halfKernels )
7376
{
@@ -77,11 +80,13 @@ public static Kernel1D[] symmetric( final double[][] halfKernels )
7780
/**
7881
* Creates a one-dimensional asymmetric convolution kernel.
7982
*
83+
* @implNote op name='create.kernel1DAsymmetric',type=Function
8084
* @param fullKernel
8185
* an array containing the values of the kernel
8286
* @param originIndex
8387
* the index of the array element which is the origin of the
8488
* kernel
89+
* @return an asymmetric {@link Kernel1D} used for one dimensional convolutions
8590
*/
8691
public static Kernel1D asymmetric( final double[] fullKernel, final int originIndex )
8792
{
@@ -94,6 +99,7 @@ public static Kernel1D asymmetric( final double[] fullKernel, final int originIn
9499
/**
95100
* Creates a one-dimensional asymmetric convolution kernel, where the origin
96101
* of the kernel is in the middle.
102+
* @implNote op name='create.kernel1DCentralAsymmetric',type=Function
97103
*/
98104
public static Kernel1D centralAsymmetric( final double... kernel )
99105
{
@@ -103,6 +109,7 @@ public static Kernel1D centralAsymmetric( final double... kernel )
103109
/**
104110
* Similar to {@link #asymmetric(double[], int)} but creates an array of
105111
* one-dimensional convolution kernels.
112+
* @implNote op name='create.kernel1DAsymmetric',type=Function
106113
*/
107114
public static Kernel1D[] asymmetric( final double[][] fullKernels, final int[] originIndices )
108115
{
@@ -113,6 +120,7 @@ public static Kernel1D[] asymmetric( final double[][] fullKernels, final int[] o
113120
/**
114121
* Similar to {@link #centralAsymmetric(double...)} but creates an array of
115122
* one-dimensional convolution kernels.
123+
* @implNote op name='create.kernel1DCentralAsymmetric',type=Function
116124
*/
117125
public static Kernel1D[] centralAsymmetric( final double[][] kernels )
118126
{

src/main/java/net/imglib2/algorithm/convolution/kernel/SeparableKernelConvolution.java

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public class SeparableKernelConvolution
6868
* }
6969
* </pre>
7070
*
71+
* @param kernels the kernel(s) to use in the convolution
72+
* @return a {@link Convolution} object that can convolve an image
73+
* @implNote op name='filter.convolveSeparable',type=Function
7174
* @see Convolution
7275
*/
7376
public static Convolution< NumericType< ? > > convolution( final Kernel1D... kernels )
@@ -89,6 +92,10 @@ public class SeparableKernelConvolution
8992
* }
9093
* </pre>
9194
*
95+
* @param kernel the kernel to use in the convolution
96+
* @param direction the direction to use in the convolution
97+
* @return a {@link Convolution} object that can convolve an image
98+
* @implNote op name='filter.convolveSeparable',type=Function
9299
* @see Convolution
93100
*/
94101
public static Convolution< NumericType< ? > > convolution1d( final Kernel1D kernel, final int direction )
@@ -106,6 +113,7 @@ public class SeparableKernelConvolution
106113
* in their own precision. The source type S and target type T are either
107114
* both {@link RealType RealTypes} or both the same type.
108115
*
116+
* @implNote op name='filter.convolveSeparable',type=Computer
109117
* @param kernels
110118
* an array containing kernels for every dimension.
111119
* @param source

src/main/java/net/imglib2/algorithm/dog/DifferenceOfGaussian.java

+76
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,44 @@
6060
*/
6161
public class DifferenceOfGaussian
6262
{
63+
/**
64+
* Compute the difference of Gaussian for the input. Input convolved with
65+
* Gaussian of sigmaSmaller is subtracted from input convolved with Gaussian
66+
* of sigmaLarger (where {@code sigmaLarger > sigmaSmaller}).
67+
* <p>
68+
* Creates an appropriate temporary image and calls
69+
* {@link #DoG(double[], double[], RandomAccessible, RandomAccessible, RandomAccessibleInterval, ExecutorService)}
70+
* .
71+
* </p>
72+
* This method differs from
73+
* {@link #DoG(double[], double[], RandomAccessible, RandomAccessibleInterval, ExecutorService)}
74+
* only in that its parameter order is tailored to an Op. The output comes
75+
* last, and the primary input (the input image) comes first.
76+
*
77+
* @implNote op name="filter.DoG", type="org.scijava.function.Computers.Arity4"
78+
* @param input
79+
* the input image extended to infinity (or at least covering the
80+
* same interval as the dog result image, plus borders for
81+
* convolution).
82+
* @param sigmaSmaller
83+
* stddev (in every dimension) of smaller Gaussian.
84+
* @param sigmaLarger
85+
* stddev (in every dimension) of larger Gaussian.
86+
* @param service
87+
* service providing threads for multi-threading
88+
* @param dog
89+
* the Difference-of-Gaussian result image.
90+
*/
91+
public static < I extends NumericType< I >, T extends NumericType< T > & NativeType< T > > void DoG(
92+
final RandomAccessible< I > input,
93+
final double[] sigmaSmaller,
94+
final double[] sigmaLarger,
95+
final ExecutorService service,
96+
final RandomAccessibleInterval< T > dog)
97+
{
98+
DoG( sigmaSmaller, sigmaLarger, input, dog, service );
99+
}
100+
63101
/**
64102
* Compute the difference of Gaussian for the input. Input convolved with
65103
* Gaussian of sigmaSmaller is subtracted from input convolved with Gaussian
@@ -97,6 +135,44 @@ public static < I extends NumericType< I >, T extends NumericType< T > & NativeT
97135
DoG( sigmaSmaller, sigmaLarger, input, Views.translate( g1, translation ), dog, service );
98136
}
99137

138+
/**
139+
* Compute the difference of Gaussian for the input. Input convolved with
140+
* Gaussian of sigmaSmaller is subtracted from input convolved with Gaussian
141+
* of sigmaLarger (where sigmaLarger &gt; sigmaSmaller).
142+
* </p>
143+
* This method differs from
144+
* {@link #DoG(double[], double[], RandomAccessible, RandomAccessible, RandomAccessibleInterval, ExecutorService)}
145+
* only in that its parameter order is tailored to an Op. The output comes
146+
* last, and the primary input (the input image) comes first.
147+
*
148+
* @implNote op name="filter.DoG", type="org.scijava.function.Computers.Arity5"
149+
* @param input
150+
* the input image extended to infinity (or at least covering the
151+
* same interval as the dog result image, plus borders for
152+
* convolution).
153+
* @param sigmaSmaller
154+
* stddev (in every dimension) of smaller Gaussian.
155+
* @param sigmaLarger
156+
* stddev (in every dimension) of larger Gaussian.
157+
* @param tmp
158+
* temporary image, must at least cover the same interval as the
159+
* dog result image.
160+
* @param service
161+
* how many threads to use for the computation.
162+
* @param dog
163+
* the Difference-of-Gaussian result image.
164+
*/
165+
public static < I extends NumericType< I >, T extends NumericType< T > & NativeType< T > > void DoG(
166+
final RandomAccessible< I > input,
167+
final double[] sigmaSmaller,
168+
final double[] sigmaLarger,
169+
final RandomAccessible< T > tmp,
170+
final ExecutorService service,
171+
final RandomAccessibleInterval< T > dog)
172+
{
173+
DoG(sigmaSmaller, sigmaLarger, input, tmp, dog, service);
174+
}
175+
100176
/**
101177
* Compute the difference of Gaussian for the input. Input convolved with
102178
* Gaussian of sigmaSmaller is subtracted from input convolved with Gaussian

src/main/java/net/imglib2/algorithm/edge/SubpixelEdgelDetection.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public class SubpixelEdgelDetection
7373
* <p>
7474
* Note: The input image type must be a signed type! Otherwise gradient
7575
* computation will not work.
76-
*
76+
*
77+
* @implNote op name='image.subpixelEdgels', type=Function
7778
* @param input
7879
* input image
7980
* @param factory

0 commit comments

Comments
 (0)