Package jhd.FloodFill
Class EuclideanSpheres
java.lang.Object
jhd.FloodFill.EuclideanSpheres
public class EuclideanSpheres
extends java.lang.Object
Class for drawing Euclidean spheres scaled in image units
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EuclideanSpheres.RandomSphereParams
Nested class to simplify random sphere draw arguments liststatic class
EuclideanSpheres.SphereParams
Nested class to simplify sphere draw arguments list -
Constructor Summary
Constructors Constructor Description EuclideanSpheres()
Default constructor -
Method Summary
Modifier and Type Method Description int
DrawRandomSpheres(java.lang.Object[] oImageArr, int imgWidth, int imgHeight, int imgDepth, EuclideanSpheres.RandomSphereParams rsp)
Draws overlapping spheres of random size at random locations until volFrac is reached.int
DrawRandomSpheres(java.lang.Object oImage, int imgWidth, int imgHeight, int imgDepth, EuclideanSpheres.RandomSphereParams rsp)
Draws overlapping spheres of random size at random locations until volFrac is reached.int
DrawSphere(java.lang.Object[] oImageArr, int imgWidth, int imgHeight, int imgDepth, EuclideanSpheres.SphereParams sp)
Draws a sphere in user pixel units, sphere origins may lie outside the image.int
DrawSphere(java.lang.Object oImage, int imgWidth, int imgHeight, int imgDepth, EuclideanSpheres.SphereParams sp)
Draws a sphere in user pixel units, sphere origins may lie outside the image.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
EuclideanSpheres
public EuclideanSpheres()Default constructor
-
-
Method Details
-
DrawRandomSpheres
public int DrawRandomSpheres(java.lang.Object[] oImageArr, int imgWidth, int imgHeight, int imgDepth, EuclideanSpheres.RandomSphereParams rsp)Draws overlapping spheres of random size at random locations until volFrac is reached.- Parameters:
oImageArr
- An Object[] as returned by ImageJ ImagePlus imp.getStack().getImageArray();imgWidth
- The image width in pixelsimgHeight
- The image height in pixelsimgDepth
- The image depth (slices) in pixelsrsp
- A RandomSphereParameters data block- Returns:
- The number of pixels that have been set to fillVal
-
DrawSphere
public int DrawSphere(java.lang.Object[] oImageArr, int imgWidth, int imgHeight, int imgDepth, EuclideanSpheres.SphereParams sp)Draws a sphere in user pixel units, sphere origins may lie outside the image.- Parameters:
oImageArr
- An Object[] as returned by ImageJ ImagePlus imp.getStack().getImageArray();imgWidth
- The image width in pixelsimgHeight
- The image height in pixelsimgDepth
- The image depth (slices) in pixelssp
- A SphereParams data block- Returns:
- The number of voxels set to fillVal, does not include overlapped voxels.
-
DrawRandomSpheres
public int DrawRandomSpheres(java.lang.Object oImage, int imgWidth, int imgHeight, int imgDepth, EuclideanSpheres.RandomSphereParams rsp)Draws overlapping spheres of random size at random locations until volFrac is reached.- Parameters:
oImage
- An Object containing a 1D array from a row major 3D imageimgWidth
- The image width in pixelsimgHeight
- The image height in pixelsimgDepth
- The image depth (slices) in pixelsrsp
- A RandomSphereParameters data block- Returns:
- The number of pixels that have been set to fillVal
-
DrawSphere
public int DrawSphere(java.lang.Object oImage, int imgWidth, int imgHeight, int imgDepth, EuclideanSpheres.SphereParams sp)Draws a sphere in user pixel units, sphere origins may lie outside the image.- Parameters:
oImage
- An Object containing a 1D array from a row major 3D image ImageJ ImagePlus imp.getStack().getImageArray();imgWidth
- The image width in pixelsimgHeight
- The image height in pixelsimgDepth
- The image depth (slices) in pixelssp
- A SphereParams data block- Returns:
- The number of non-overlapping sphere voxels.
-