Skip to content

Commit 75f2f35

Browse files
committed
Add Op annotations to relevant static methods
1 parent 53a2a06 commit 75f2f35

Some content is hidden

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

48 files changed

+2944
-126
lines changed

pom.xml

+23
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ Jean-Yves Tinevez and Michael Zinsmaier.</license.copyrightOwners>
206206
<imglib2-roi.version>0.15.0</imglib2-roi.version>
207207
<imglib2-cache.version>1.0.0-beta-18</imglib2-cache.version>
208208
<sc.fiji.bigdataviewer-core.version>10.4.16</sc.fiji.bigdataviewer-core.version>
209+
<scijava.parse.ops>true</scijava.parse.ops>
209210
</properties>
210211

211212
<repositories>
@@ -281,4 +282,26 @@ Jean-Yves Tinevez and Michael Zinsmaier.</license.copyrightOwners>
281282
<scope>test</scope>
282283
</dependency>
283284
</dependencies>
285+
286+
<build>
287+
<plugins>
288+
<plugin>
289+
<artifactId>maven-compiler-plugin</artifactId>
290+
<configuration>
291+
<annotationProcessorPaths>
292+
<path>
293+
<groupId>org.scijava</groupId>
294+
<artifactId>scijava-ops-indexer</artifactId>
295+
<version>1.0.1-SNAPSHOT</version>
296+
</path>
297+
</annotationProcessorPaths>
298+
<fork>true</fork>
299+
<compilerArgs>
300+
<arg>-Ascijava.ops.parse=${scijava.parse.ops}</arg>
301+
<arg>-Ascijava.ops.opVersion=${project.version}</arg>
302+
</compilerArgs>
303+
</configuration>
304+
</plugin>
305+
</plugins>
306+
</build>
284307
</project>

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

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public class Thresholder
7070
* the number of threads to use for thresholding.
7171
* @return a new {@link Img} of type {@link BitType} and of same dimension
7272
* that the source image.
73+
* @implNote op name='threshold.value'
7374
*/
7475
public static final < T extends Type< T > & Comparable< T >> Img< BitType > threshold( final Img< T > source, final T threshold, final boolean above, final int numThreads )
7576
{

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
@@ -88,11 +88,23 @@ public class FastGauss
8888
return new LineConvolution<>( new FastGaussConvolverRealType( sigma ), direction );
8989
}
9090

91+
/**
92+
* @param sigmas the standard deviations of the Gaussian blur (in each dimension)
93+
* @param input the input data to blur
94+
* @param output the preallocated output buffer
95+
* @implNote op name='filter.gauss', type=Computer
96+
*/
9197
public static void convolve( final double[] sigmas, final RandomAccessible< ? extends RealType< ? > > input, final RandomAccessibleInterval< ? extends RealType< ? > > output )
9298
{
9399
convolution( sigmas ).process( input, output );
94100
}
95101

102+
/**
103+
* @param sigma the standard deviation of the Gaussian blur (in all dimensions)
104+
* @param input the input data to blur
105+
* @param output the preallocated output buffer
106+
* @implNote op name='filter.gauss', 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

+20
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public class Kernel1D
5656
* @param halfKernel
5757
* the upper half (starting at the center pixel) of the symmetric
5858
* convolution kernel.
59+
* @return a {@link Kernel1D} used for one dimensional convolutions
60+
* @implNote op name='create.kernel1DSymmetric'
5961
*/
6062
public static Kernel1D symmetric( final double... halfKernel )
6163
{
@@ -68,6 +70,9 @@ 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+
* @param halfKernels the upper halves (starting at the center pixel) of the symmetric convolution kernels
74+
* @return an array of {@link Kernel1D}s used for one dimensional convolutions
75+
* @implNote op name='create.kernel1DSymmetric'
7176
*/
7277
public static Kernel1D[] symmetric( final double[][] halfKernels )
7378
{
@@ -82,6 +87,8 @@ public static Kernel1D[] symmetric( final double[][] halfKernels )
8287
* @param originIndex
8388
* the index of the array element which is the origin of the
8489
* kernel
90+
* @return an asymmetric {@link Kernel1D} used for one dimensional convolutions
91+
* @implNote op name='create.kernel1DAsymmetric'
8592
*/
8693
public static Kernel1D asymmetric( final double[] fullKernel, final int originIndex )
8794
{
@@ -94,6 +101,9 @@ public static Kernel1D asymmetric( final double[] fullKernel, final int originIn
94101
/**
95102
* Creates a one-dimensional asymmetric convolution kernel, where the origin
96103
* of the kernel is in the middle.
104+
* @param kernel the raw data of the symmetric convolution kernel
105+
* @return a {@link Kernel1D} used for one dimensional convolutions
106+
* @implNote op name='create.kernel1DCentralAsymmetric'
97107
*/
98108
public static Kernel1D centralAsymmetric( final double... kernel )
99109
{
@@ -103,6 +113,13 @@ public static Kernel1D centralAsymmetric( final double... kernel )
103113
/**
104114
* Similar to {@link #asymmetric(double[], int)} but creates an array of
105115
* one-dimensional convolution kernels.
116+
* @param fullKernels
117+
* arrays containing the values of each kernel
118+
* @param originIndices
119+
* the indices of the array elements at the origin of each
120+
* kernel
121+
* @return an array of {@link Kernel1D}s used for one dimensional convolutions
122+
* @implNote op name='create.kernel1DAsymmetric'
106123
*/
107124
public static Kernel1D[] asymmetric( final double[][] fullKernels, final int[] originIndices )
108125
{
@@ -113,6 +130,9 @@ public static Kernel1D[] asymmetric( final double[][] fullKernels, final int[] o
113130
/**
114131
* Similar to {@link #centralAsymmetric(double...)} but creates an array of
115132
* one-dimensional convolution kernels.
133+
* @param kernels the upper halves (starting at the center pixel) of the symmetric convolution kernels
134+
* @return an array of {@link Kernel1D}s used for one dimensional convolutions
135+
* @implNote op name='create.kernel1DCentralAsymmetric'
116136
*/
117137
public static Kernel1D[] centralAsymmetric( final double[][] kernels )
118138
{

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

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public class SeparableKernelConvolution
114114
* the required source interval.
115115
* @param target
116116
* target image.
117+
* @implNote op name='filter.convolve', type=Computer
117118
*/
118119
public static void convolve( final Kernel1D[] kernels,
119120
final RandomAccessible< ? extends NumericType< ? > > 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=Computer
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=Computer
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)