Skip to content

Commit

Permalink
WIP: More reorganizing
Browse files Browse the repository at this point in the history
  • Loading branch information
gselzer committed Aug 26, 2024
1 parent 75f2f35 commit d73c239
Show file tree
Hide file tree
Showing 20 changed files with 110 additions and 2,490 deletions.
17 changes: 16 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,21 @@ Jean-Yves Tinevez and Michael Zinsmaier.</license.copyrightOwners>
<imglib2-roi.version>0.15.0</imglib2-roi.version>
<imglib2-cache.version>1.0.0-beta-18</imglib2-cache.version>
<sc.fiji.bigdataviewer-core.version>10.4.16</sc.fiji.bigdataviewer-core.version>

<!--
NB: Older versions of OpenJDK 11 have a bug in the javadoc tool,
which causes errors like:
[ERROR] javadoc: error - The code being documented uses packages
in the unnamed module, but the packages defined in
https://github.com/scijava/scijava/apidocs/ are in named modules.
The most recent version of OpenJDK 11 known to have this problem
is 11.0.8; the oldest version known to have fixed it is 11.0.17.
Therefore, we set the minimum build JDK version to 11.0.17 here.
-->
<scijava.jvm.build.version>[11.0.17,)</scijava.jvm.build.version>
<scijava.jvm.version>8</scijava.jvm.version>
<scijava.parse.ops>true</scijava.parse.ops>
</properties>

Expand Down Expand Up @@ -292,7 +307,7 @@ Jean-Yves Tinevez and Michael Zinsmaier.</license.copyrightOwners>
<path>
<groupId>org.scijava</groupId>
<artifactId>scijava-ops-indexer</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.0</version>
</path>
</annotationProcessorPaths>
<fork>true</fork>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class Thresholder
* the number of threads to use for thresholding.
* @return a new {@link Img} of type {@link BitType} and of same dimension
* that the source image.
* @implNote op name='threshold.value'
* @implNote op name='threshold.apply'
*/
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 )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public final class BuildComponentTree< T extends Type< T >, C extends PartialCom
* tree structure. An implementations of {@link PartialComponent.Handler} is
* provided for example by {@link PixelListComponentTree}.
*
* @implNote op name='componenttree.buildComponentTree',type=Function
* @param input
* input image.
* @param componentGenerator
Expand All @@ -111,8 +110,7 @@ public static < T extends Type< T >, C extends PartialComponent< T, C > > void b
* {@link PartialComponent.Handler} which is responsible for building up the
* tree structure. An implementations of {@link PartialComponent.Handler} is
* provided for example by {@link PixelListComponentTree}.
*
* @implNote op name='componenttree.buildComponentTree',type=Function
*
* @param input
* input image of a comparable value type.
* @param componentGenerator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public final class MserTree< T extends Type< T > > implements ComponentForest< M
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
* input image size.
*
* @implNote op name='componenttree.buildMserTree',type=Function
* @implNote op name='create.mserTree',type=Function
* @param input
* the input image.
* @param delta
Expand Down Expand Up @@ -135,7 +135,7 @@ public static < T extends RealType< T > > MserTree< T > buildMserTree( final Ran
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
* input image size.
*
* @implNote op name='componenttree.buildMserTree',type=Function
* @implNote op name='create.mserTree',type=Function
* @param input
* the input image.
* @param delta
Expand All @@ -162,7 +162,7 @@ public static < T extends RealType< T > > MserTree< T > buildMserTree( final Ran
/**
* Build a MSER tree from an input image.
*
* @implNote op name='componenttree.buildMserTree',type=Function
* @implNote op name='create.mserTree',type=Function
* @param input
* the input image.
* @param delta
Expand Down Expand Up @@ -202,7 +202,7 @@ public static < T extends RealType< T > > MserTree< T > buildMserTree( final Ran
* using an {@link ArrayImgFactory} or {@link CellImgFactory} depending on
* input image size.
*
* @implNote op name='componenttree.buildMserTree',type=Function
* @implNote op name='create.mserTree',type=Function
* @param input
* the input image.
* @param computeDelta
Expand Down Expand Up @@ -231,7 +231,7 @@ public static < T extends Type< T > > MserTree< T > buildMserTree( final RandomA
/**
* Build a MSER tree from an input image.
*
* @implNote op name='componenttree.buildMserTree',type=Function
* @implNote op name='create.mserTree',type=Function
* @param input
* the input image.
* @param computeDelta
Expand Down
150 changes: 3 additions & 147 deletions src/main/java/net/imglib2/algorithm/fill/FloodFill.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public class FloodFill
* input pixel type
* @param <U>
* fill label type
* @implNote op name='image.floodFill', type=Computer2
*/
public static < T extends Type< T >, U extends Type< U > > void fill(
final RandomAccessible< T > source,
Expand All @@ -105,53 +106,6 @@ public static < T extends Type< T >, U extends Type< U > > void fill(
fill( source, target, seed, fillLabel, shape, filter );
}

/**
* Iterative n-dimensional flood fill for arbitrary neighborhoods: Starting
* at seed location, write fillLabel into target at current location and
* continue for each pixel in neighborhood defined by shape if neighborhood
* pixel is in the same connected component and fillLabel has not been
* written into that location yet.
*
* Convenience call to
* {@link #fill(RandomAccessible, RandomAccessible, Localizable, Type, Shape, BiPredicate)}.
* seedLabel is extracted from source at seed location.
* <p>
* This method differs from
* {@link #fill(RandomAccessible, RandomAccessible, Localizable, Type, Shape)}
* only in that its parameter order is tailored to an Op. The output comes
* last, and the primary input (the input image) comes first.
* </p>
*
* @implNote op name='image.floodFill', type=Computer
* @param source
* input
* @param seed
* Start flood fill at this location.
* @param fillLabel
* Immutable. Value to be written into valid flood fill
* locations.
* @param shape
* Defines neighborhood that is considered for connected
* components, e.g.
* {@link net.imglib2.algorithm.neighborhood.DiamondShape}
* @param target
* {@link RandomAccessible} to be written into. May be the same
* as input.
* @param <T>
* input pixel type
* @param <U>
* fill label type
*/
public static < T extends Type< T >, U extends Type< U > > void fill(
final RandomAccessible< T > source,
final Localizable seed,
final U fillLabel,
final Shape shape,
final RandomAccessible< U > target)
{
fill(source, target, seed, fillLabel, shape);
}

/**
* Iterative n-dimensional flood fill for arbitrary neighborhoods: Starting
* at seed location, write fillLabel into target at current location and
Expand Down Expand Up @@ -185,6 +139,7 @@ public static < T extends Type< T >, U extends Type< U > > void fill(
* input pixel type
* @param <U>
* fill label type
* @implNote op name='image.floodFill', type=Computer2
*/
public static < T, U extends Type< U > > void fill(
final RandomAccessible< T > source,
Expand All @@ -197,58 +152,6 @@ public static < T, U extends Type< U > > void fill(
fill( source, target, seed, shape, filter, targetPixel -> targetPixel.set( fillLabel ) );
}

/**
* Iterative n-dimensional flood fill for arbitrary neighborhoods: Starting
* at seed location, write fillLabel into target at current location and
* continue for each pixel in neighborhood defined by shape if neighborhood
* pixel is in the same connected component and fillLabel has not been
* written into that location yet.
*
* Convenience call to
* {@link FloodFill#fill(RandomAccessible, RandomAccessible, Localizable, Shape, BiPredicate, Consumer)}
* with {@link Type#set} as writer.
* <p>
* This method differs from
* {@link #fill(RandomAccessible, RandomAccessible, Localizable, Type, Shape, BiPredicate)}
* only in that its parameter order is tailored to an Op. The output comes
* last, and the primary input (the input image) comes first.
* </p>
*
* @implNote op name='image.floodFill', type=Computer
* @param source
* input
* @param seed
* Start flood fill at this location.
* @param fillLabel
* Immutable. Value to be written into valid flood fill
* locations.
* @param shape
* Defines neighborhood that is considered for connected
* components, e.g.
* {@link net.imglib2.algorithm.neighborhood.DiamondShape}
* @param filter
* Returns true if pixel has not been visited yet and should be
* written into. Returns false if target pixel has been visited
* or source pixel is not part of the same connected component.
* @param target
* {@link RandomAccessible} to be written into. May be the same
* as input.
* @param <T>
* input pixel type
* @param <U>
* fill label type
*/
public static < T, U extends Type< U > > void fill(
final RandomAccessible< T > source,
final Localizable seed,
final U fillLabel,
final Shape shape,
final BiPredicate< T, U > filter,
final RandomAccessible< U > target)
{
fill( source, target, seed, shape, filter, targetPixel -> targetPixel.set( fillLabel ) );
}

/**
*
* Iterative n-dimensional flood fill for arbitrary neighborhoods: Starting
Expand Down Expand Up @@ -279,6 +182,7 @@ public static < T, U extends Type< U > > void fill(
* input pixel type
* @param <U>
* fill label type
* @implNote op name='image.floodFill', type=Computer2
*/
public static < T, U > void fill(
final RandomAccessible< T > source,
Expand Down Expand Up @@ -335,54 +239,6 @@ public static < T, U > void fill(
}

}
/**
*
* Iterative n-dimensional flood fill for arbitrary neighborhoods: Starting
* at seed location, write fillLabel into target at current location and
* continue for each pixel in neighborhood defined by shape if neighborhood
* pixel is in the same connected component and fillLabel has not been
* written into that location yet.
* <p>
* This method differs from
* {@link #fill(RandomAccessible, RandomAccessible, Localizable, Shape, BiPredicate, Consumer)}
* only in that its parameter order is tailored to an Op. The output comes
* last, and the primary input (the input image) comes first.
* </p>
*
* @implNote op name='image.floodFill', type=Computer
* @param source
* input
* @param seed
* Start flood fill at this location.
* @param shape
* Defines neighborhood that is considered for connected
* components, e.g.
* {@link net.imglib2.algorithm.neighborhood.DiamondShape}
* @param filter
* Returns true if pixel has not been visited yet and should be
* written into. Returns false if target pixel has been visited
* or source pixel is not part of the same connected component.
* @param writer
* Defines how fill label is written into target at current
* location.
* @param target
* {@link RandomAccessible} to be written into. May be the same
* as input.
* @param <T>
* input pixel type
* @param <U>
* fill label type
*/
public static < T, U > void fill(
final RandomAccessible< T > source,
final Localizable seed,
final Shape shape,
final BiPredicate< T, U > filter,
final Consumer< U > writer,
final RandomAccessible< U > target )
{
fill(source, target, seed, shape, filter, writer);
}

/**
* Iterative n-dimensional flood fill for arbitrary neighborhoods: Starting
Expand Down
Loading

0 comments on commit d73c239

Please sign in to comment.