diff --git a/src/main/java/net/imglib2/algorithm/neighborhood/CenteredRectangleShape.java b/src/main/java/net/imglib2/algorithm/neighborhood/CenteredRectangleShape.java index abd482fa2..75310604c 100755 --- a/src/main/java/net/imglib2/algorithm/neighborhood/CenteredRectangleShape.java +++ b/src/main/java/net/imglib2/algorithm/neighborhood/CenteredRectangleShape.java @@ -61,6 +61,7 @@ * * @author Tobias Pietzsch * @author Jean-Yves Tinevez + * @author Jonathan Hale (University of Konstanz) */ public class CenteredRectangleShape implements Shape { @@ -119,6 +120,24 @@ public < T > NeighborhoodsAccessible< T > neighborhoodsRandomAccessibleSafe( fin return new NeighborhoodsAccessible< T >( source, spanInterval, f ); } + /** + * @return true if skipCenter was set to true + * during construction, false otherwise. + * @see CenteredRectangleShape#CenteredRectangleShape(int[], boolean) + */ + public boolean isSkippingCenter() + { + return skipCenter; + } + + /** + * @return Copy of the span of this shape. + */ + public int[] getSpan() + { + return span.clone(); + } + @Override public String toString() { diff --git a/src/main/java/net/imglib2/algorithm/neighborhood/DiamondShape.java b/src/main/java/net/imglib2/algorithm/neighborhood/DiamondShape.java index 91468b481..23fe0a5e3 100755 --- a/src/main/java/net/imglib2/algorithm/neighborhood/DiamondShape.java +++ b/src/main/java/net/imglib2/algorithm/neighborhood/DiamondShape.java @@ -12,11 +12,23 @@ import net.imglib2.RandomAccessible; import net.imglib2.RandomAccessibleInterval; +/** + * TODO + * + * @author Jean-Yves Tinevez + * @author Jonathan Hale (University of Konstanz) + */ public class DiamondShape implements Shape { private final long radius; + /** + * Constructor + * + * @param radius + * Radius for the diamond shape. + */ public DiamondShape( final long radius ) { this.radius = radius; @@ -47,6 +59,15 @@ public < T > NeighborhoodsAccessible< T > neighborhoodsRandomAccessibleSafe( fin return new NeighborhoodsAccessible< T >( source, radius, DiamondNeighborhood.< T >factory() ); } + /** + * @return Radius of this shape. + * @see DiamondShape#DiamondShape(long) + */ + public long getRadius() + { + return radius; + } + @Override public String toString() { diff --git a/src/main/java/net/imglib2/algorithm/neighborhood/DiamondTipsShape.java b/src/main/java/net/imglib2/algorithm/neighborhood/DiamondTipsShape.java index 6a606e027..4e1e2e76f 100755 --- a/src/main/java/net/imglib2/algorithm/neighborhood/DiamondTipsShape.java +++ b/src/main/java/net/imglib2/algorithm/neighborhood/DiamondTipsShape.java @@ -12,11 +12,24 @@ import net.imglib2.RandomAccessible; import net.imglib2.RandomAccessibleInterval; + +/** + * TODO + * + * @author Jean-Yves Tinevez + * @author Jonathan Hale (University of Konstanz) + */ public class DiamondTipsShape implements Shape { private final long radius; + /** + * Constructor + * + * @param radius + * Radius for the diamond shape. + */ public DiamondTipsShape( final long radius ) { this.radius = radius; @@ -48,6 +61,15 @@ public < T > NeighborhoodsAccessible< T > neighborhoodsRandomAccessibleSafe( fin return new NeighborhoodsAccessible< T >( source, radius, f ); } + /** + * @return Radius of this shape. + * @see DiamondTipsShape#DiamondTipsShape(long) + */ + public long getRadius() + { + return radius; + } + @Override public String toString() { diff --git a/src/main/java/net/imglib2/algorithm/neighborhood/HorizontalLineShape.java b/src/main/java/net/imglib2/algorithm/neighborhood/HorizontalLineShape.java index 865aa53f8..312fa4a4e 100755 --- a/src/main/java/net/imglib2/algorithm/neighborhood/HorizontalLineShape.java +++ b/src/main/java/net/imglib2/algorithm/neighborhood/HorizontalLineShape.java @@ -16,7 +16,8 @@ * A {@link Shape} representing finite, centered, symmetric lines, that are * parallel to the image axes. * - * @author Jean-Yves Tinevez + * @author Jean-Yves Tinevez # + * @author Jonathan Hale (University of Konstanz) */ public class HorizontalLineShape implements Shape { @@ -71,6 +72,32 @@ public < T > NeighborhoodsAccessible< T > neighborhoodsRandomAccessibleSafe( fin return new NeighborhoodsAccessible< T >( source, span, dim, skipCenter, f ); } + /** + * @return true if skipCenter was set to true + * during construction, false otherwise. + * @see CenteredRectangleShape#CenteredRectangleShape(int[], boolean) + */ + public boolean isSkippingCenter() + { + return skipCenter; + } + + /** + * @return The span of this shape. + */ + public long getSpan() + { + return span; + } + + /** + * @return The dimension along which the line is layed. + */ + public int getLineDimension() + { + return dim; + } + @Override public String toString() { diff --git a/src/main/java/net/imglib2/algorithm/neighborhood/HyperSphereShape.java b/src/main/java/net/imglib2/algorithm/neighborhood/HyperSphereShape.java index dfcf85884..16e7a82de 100644 --- a/src/main/java/net/imglib2/algorithm/neighborhood/HyperSphereShape.java +++ b/src/main/java/net/imglib2/algorithm/neighborhood/HyperSphereShape.java @@ -50,6 +50,7 @@ * A factory for Accessibles on hyper-sphere neighboorhoods. * * @author Tobias Pietzsch + * @author Jonathan Hale (University of Konstanz) */ public class HyperSphereShape implements Shape { @@ -84,6 +85,20 @@ public < T > NeighborhoodsAccessible< T > neighborhoodsRandomAccessibleSafe( fin return new NeighborhoodsAccessible< T >( source, radius, HyperSphereNeighborhood.< T >factory() ); } + /** + * @return The radius of this shape. + */ + public long getRadius() + { + return radius; + } + + @Override + public String toString() + { + return "HyperSphereShape, radius = " + radius; + } + public static final class NeighborhoodsIterableInterval< T > extends AbstractInterval implements IterableInterval< Neighborhood< T > > { final RandomAccessibleInterval< T > source; diff --git a/src/main/java/net/imglib2/algorithm/neighborhood/PairOfPointsShape.java b/src/main/java/net/imglib2/algorithm/neighborhood/PairOfPointsShape.java index da4448872..afde92c8f 100755 --- a/src/main/java/net/imglib2/algorithm/neighborhood/PairOfPointsShape.java +++ b/src/main/java/net/imglib2/algorithm/neighborhood/PairOfPointsShape.java @@ -66,10 +66,18 @@ public < T > NeighborhoodsAccessible< T > neighborhoodsRandomAccessibleSafe( fin return new NeighborhoodsAccessible< T >( source, offset, f ); } + /** + * @return Copy of the offset of this shape. + */ + public long[] getOffset() + { + return offset.clone(); + } + @Override public String toString() { - return "PairShape, offset = " + Util.printCoordinates( offset ); + return "PairOfPointsShape, offset = " + Util.printCoordinates( offset ); } public static final class NeighborhoodsIterableInterval< T > extends AbstractInterval implements IterableInterval< Neighborhood< T > > diff --git a/src/main/java/net/imglib2/algorithm/neighborhood/PeriodicLineShape.java b/src/main/java/net/imglib2/algorithm/neighborhood/PeriodicLineShape.java index 5f5663064..69e976969 100755 --- a/src/main/java/net/imglib2/algorithm/neighborhood/PeriodicLineShape.java +++ b/src/main/java/net/imglib2/algorithm/neighborhood/PeriodicLineShape.java @@ -22,6 +22,7 @@ * to granulometries. Pattern Recognition Letters (1996) vol. 17 (10) pp. 1057-1063 * * @author Jean-Yves Tinevez, 2013 + * @author Jonathan Hale (University of Konstanz) */ public class PeriodicLineShape implements Shape { @@ -87,6 +88,22 @@ public < T > NeighborhoodsAccessible< T > neighborhoodsRandomAccessibleSafe( fin return new NeighborhoodsAccessible< T >( source, span, increments, f ); } + /** + * @return The span of this shape. + */ + public long getSpan() + { + return span; + } + + /** + * @return Copy of the increments of this shape. + */ + public int[] getIncrements() + { + return increments.clone(); + } + @Override public String toString() { diff --git a/src/main/java/net/imglib2/algorithm/neighborhood/RectangleShape.java b/src/main/java/net/imglib2/algorithm/neighborhood/RectangleShape.java index b44e27d6a..f9762a624 100644 --- a/src/main/java/net/imglib2/algorithm/neighborhood/RectangleShape.java +++ b/src/main/java/net/imglib2/algorithm/neighborhood/RectangleShape.java @@ -51,6 +51,7 @@ * A factory for Accessibles on rectangular neighboorhoods. * * @author Tobias Pietzsch + * @author Jonathan Hale (University of Konstanz) */ public class RectangleShape implements Shape { @@ -111,7 +112,30 @@ private Interval createSpan( final int n ) } return new FinalInterval( min, max ); } + + /** + * @return true if skipCenter was set to true + * during construction, false otherwise. + * @see CenteredRectangleShape#CenteredRectangleShape(int[], boolean) + */ + public boolean isSkippingCenter() + { + return skipCenter; + } + /** + * @return The span of this shape. + */ + public int getSpan() + { + return span; + } + + @Override + public String toString() + { + return "RectangleShape, span = " + span; + } public static final class NeighborhoodsIterableInterval< T > extends AbstractInterval implements IterableInterval< Neighborhood< T > > {