theba.core.ImageFunctions Class Reference

List of all members.

Static Public Member Functions

static double bendingEnergy (short[] pixels, int width, int height)
static int floodFill2D (int xp, int yp, int width, int height, final short[] input, short[] output, short value)
static ArrayList< Point > borderTrace (short[] pixels, int width, int height)
static double circlish (short[] mask, int width, int height)
static int countOutlinePixels (final short[] input, int xp, int yp, int width, int height, short val)
static double curvature (short[] pixels, int width, int height)
static void delete3D (Stack volume, int xp, int yp, int zp)
static short[] dilate (short[] input, int width, int height)
static short[] dilate (short[] input, int width, int height, Rectangle bounds)
static short[] dilate (short[] input, short[] output, int width, int height, Rectangle bounds)
static short[] dilate (short[] input, short[] output, int width, int height, Rectangle bounds, short val)
static short[] dilateMasked (short[] input, short[] output, short[] mask, int width, int height, Rectangle bounds, short val)
static void dilate3d (Stack voxels)
static int dilateAndCount (final short[] input, short[] output, short[] mask, int width, int height, Rectangle bounds)
static short[] erode (short[] input, int width, int height)
static short[] erode (short[] input, int width, int height, Rectangle bounds)
static short[] erode (short[] input, short[] output, int width, int height, Rectangle bounds)
static void erode3d (Stack voxels)
static int floodFill2D (int xp, int yp, int width, int height, final short[] input, short value)
static int floodFill2D (final short[] input, short[] output, int xp, int yp, int width, int height, short val)
static int floodFill2DMasked (int xp, int yp, int width, int height, short[] input, short[] mask, short[] output, short val)
static long floodFill3D (Stack volume, int xp, int yp, int zp, short val)
static long floodFill3D26 (Stack volume, int xp, int yp, int zp, short newValue)
static short[] geodist (short[] input, short[] mask, int width, int height)
static double[] getArcLenghts (int[] chaincode)
static Point getAveragePoint (short[] lumenMask, int width, int height)
static Point getAveragePoint (short[] lumenMask, int width, int height, short currentId)
static short[] distance2d (short[] input, int width, int height)
static short[] distance2d (short[] input, int width, int height, Rectangle bounds)
static void distance3d (Stack voxels)
static double eccentricity (short[] pixels, int width, int height)
static Rectangle getBounds (short[] image, int width, int height, int margin)
static Rectangle getBounds (short[] image, int width, int height, int margin, short id)
static int[] getChaincode (ArrayList borderPoints)
static double getInterpolatedValue (double[] xa, double[] ya, double x)
static short[] invertMask (short[] input, boolean in_place)
static short[] mask (short[] input, short[] mask, boolean in_place)
static short[] mask (short[] input, short[] mask, boolean in_place, int width, int height, Rectangle bounds)
static void median3d (Stack voxels)
static boolean touchBorder (short[] mask, int w, int h)

Static Public Attributes

static short[] cachedMap = null

Detailed Description

This is a library-class containing often-used functions to manipulate 3D and 2D images.

Author:
jensbw
perchrh

Definition at line 29 of file ImageFunctions.java.


Member Function Documentation

static double theba.core.ImageFunctions.bendingEnergy ( short[]  pixels,
int  width,
int  height 
) [static]

Calculates the bending energy of a region

Returns:
The bending energy of the non-zero region in pixels

Definition at line 37 of file ImageFunctions.java.

static ArrayList<Point> theba.core.ImageFunctions.borderTrace ( short[]  pixels,
int  width,
int  height 
) [static]

Creates an arraylist of points for a single connected pixel-mask

Definition at line 95 of file ImageFunctions.java.

static double theba.core.ImageFunctions.circlish ( short[]  mask,
int  width,
int  height 
) [static]

Definition at line 157 of file ImageFunctions.java.

static int theba.core.ImageFunctions.countOutlinePixels ( final short[]  input,
int  xp,
int  yp,
int  width,
int  height,
short  val 
) [static]

Counts the pixels on the outline border of a 2D-region

Returns:
The pixelCount of the outline border of the indicated region

Definition at line 166 of file ImageFunctions.java.

static double theba.core.ImageFunctions.curvature ( short[]  pixels,
int  width,
int  height 
) [static]

The curvature of a region indicated by 1's in the pixel-mask

Returns:
The curvature of a region indicated by 1's in the pixel-mask

Definition at line 215 of file ImageFunctions.java.

static void theba.core.ImageFunctions.delete3D ( Stack  volume,
int  xp,
int  yp,
int  zp 
) [static]

Fills a 3D region with 0 by use of a 26-connected flood-fill

Parameters:
xmin 
ymin 

Definition at line 225 of file ImageFunctions.java.

References theba.core.ImageFunctions.floodFill3D26(), and theba.core.Stack.getVoxel().

static short [] theba.core.ImageFunctions.dilate ( short[]  input,
short[]  output,
int  width,
int  height,
Rectangle  bounds,
short  val 
) [static]

Bounded dilation of a region by 1 pixel

Parameters:
val The label of the region to dilate
Returns:

Definition at line 302 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.dilate ( short[]  input,
short[]  output,
int  width,
int  height,
Rectangle  bounds 
) [static]

Dilates an input-array by 1 pixel

Parameters:
copy dilates in-place if false, returns a copy if true
A boundrary inscribing the region to be processed
Returns:

Definition at line 266 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.dilate ( short[]  input,
int  width,
int  height,
Rectangle  bounds 
) [static]

Dilates an input-array by 1 pixel

Parameters:
copy dilates in-place if false, returns a copy if true
A boundrary inscribing the region to be processed
Returns:

Definition at line 252 of file ImageFunctions.java.

References theba.core.ImageFunctions.dilate().

static short [] theba.core.ImageFunctions.dilate ( short[]  input,
int  width,
int  height 
) [static]

Dilates an input-array

dilates in-place if false, returns a copy if true

Returns:

Definition at line 239 of file ImageFunctions.java.

Referenced by theba.core.ImageFunctions.dilate().

static void theba.core.ImageFunctions.dilate3d ( Stack  voxels  )  [static]

Dilates a 3d volume using the elementary 6-connected 1-voxel structure element

Parameters:
voxels 

Definition at line 391 of file ImageFunctions.java.

References theba.core.Stack.getDepth(), theba.core.Stack.getHeight(), theba.core.Stack.getSlice(), theba.core.Stack.getWidth(), and theba.core.gui.ThebaGUI.setProgress().

static int theba.core.ImageFunctions.dilateAndCount ( final short[]  input,
short[]  output,
short[]  mask,
int  width,
int  height,
Rectangle  bounds 
) [static]

Masked dilation of an input-array by 1 pixel and calculation of the amount of added pixels

dilates in-place if false, returns a copy if true

Parameters:
A boundary inscribing the region to be processed
Returns:
The amount of added pixels by this dilation

Definition at line 444 of file ImageFunctions.java.

Referenced by theba.core.ImageFunctions.geodist().

static short [] theba.core.ImageFunctions.dilateMasked ( short[]  input,
short[]  output,
short[]  mask,
int  width,
int  height,
Rectangle  bounds,
short  val 
) [static]

Binary dilation, works only when inputs have 1 and 0 values Anythin detected under the 4-connected dilation element and inside the mask will be marked by the val-parameter

This function is used as part of the geodesic distance transform

Parameters:
val 
Returns:

Definition at line 344 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.distance2d ( short[]  input,
int  width,
int  height,
Rectangle  bounds 
) [static]

Returns the bounded distancemap from any non-zero regions marked by the input-mask

Returns:
The resulting distance-map

Definition at line 1028 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.distance2d ( short[]  input,
int  width,
int  height 
) [static]

Returns the distancemap from any non-zero regions marked by the input-mask

Parameters:
input 
width 
height 
Returns:

Definition at line 961 of file ImageFunctions.java.

static void theba.core.ImageFunctions.distance3d ( Stack  voxels  )  [static]

Creates a three-dimensional distance-map by applying a forward and backward pass of a distance-propagation mask. (linear execution time)

Parameters:
voxels The stack to use. Note that the resulting map is written directly back to this stack

Definition at line 1110 of file ImageFunctions.java.

References theba.core.Stack.getDepth(), theba.core.Stack.getHeight(), theba.core.Stack.getSlice(), theba.core.Stack.getWidth(), theba.core.gui.ThebaGUI.setProgress(), and theba.core.gui.ThebaGUI.setProgressComplete().

static double theba.core.ImageFunctions.eccentricity ( short[]  pixels,
int  width,
int  height 
) [static]

The eccentricity of a 2D connected non-zero region

Returns:
The eccentricity of a region

Definition at line 1214 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.erode ( short[]  input,
short[]  output,
int  width,
int  height,
Rectangle  bounds 
) [static]

Erodes an input-array by 1 pixel

Parameters:
copy erodes in-place if false, returns a copy if true
A boundrary inscribing the region to be processed
Returns:

Definition at line 520 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.erode ( short[]  input,
int  width,
int  height,
Rectangle  bounds 
) [static]

Erodes an input-array by 1 pixel

Parameters:
copy erodes in-place if false, returns a copy if true
A boundrary inscribing the region to be processed
Returns:

Definition at line 506 of file ImageFunctions.java.

References theba.core.ImageFunctions.erode().

static short [] theba.core.ImageFunctions.erode ( short[]  input,
int  width,
int  height 
) [static]

Erodes an input-array

erodes in-place if false, returns a copy if true

Returns:

Definition at line 493 of file ImageFunctions.java.

Referenced by theba.core.ImageFunctions.erode().

static void theba.core.ImageFunctions.erode3d ( Stack  voxels  )  [static]

Erodes a 3d volume using the elementary 6-connected 1-voxel structure element

Parameters:
voxels 

Definition at line 556 of file ImageFunctions.java.

References theba.core.Stack.flush(), theba.core.Stack.getDepth(), theba.core.Stack.getHeight(), theba.core.Stack.getSlice(), theba.core.Stack.getWidth(), and theba.core.gui.ThebaGUI.setProgress().

static int theba.core.ImageFunctions.floodFill2D ( final short[]  input,
short[]  output,
int  xp,
int  yp,
int  width,
int  height,
short  val 
) [static]

Fills a region by 4-connected flood-fill

Returns:
the number of filled pixels

Definition at line 655 of file ImageFunctions.java.

static int theba.core.ImageFunctions.floodFill2D ( int  xp,
int  yp,
int  width,
int  height,
final short[]  input,
short  value 
) [static]

Fills a region by 4-connected flood-fill

Returns:
the number of filled pixels

Definition at line 605 of file ImageFunctions.java.

static int theba.core.ImageFunctions.floodFill2D ( int  xp,
int  yp,
int  width,
int  height,
final short[]  input,
short[]  output,
short  value 
) [static]

Applies 4-connected 2D flood-fill (not in-place)

Returns:

Definition at line 46 of file ImageFunctions.java.

static int theba.core.ImageFunctions.floodFill2DMasked ( int  xp,
int  yp,
int  width,
int  height,
short[]  input,
short[]  mask,
short[]  output,
short  val 
) [static]

Floodfills a 2D- region using a mask to restrict the area to be filled

Parameters:
val 
Returns:

Definition at line 696 of file ImageFunctions.java.

static long theba.core.ImageFunctions.floodFill3D ( Stack  volume,
int  xp,
int  yp,
int  zp,
short  val 
) [static]
static long theba.core.ImageFunctions.floodFill3D26 ( Stack  volume,
int  xp,
int  yp,
int  zp,
short  newValue 
) [static]

26-connected flood-fill

Flood-filling regions that have already been given the indicated label, will return 0

Parameters:
volume The current stack used for input and output
newValue The value to be filled with

Definition at line 814 of file ImageFunctions.java.

References theba.core.Stack.getDepth(), theba.core.Stack.getHeight(), theba.core.Stack.getVoxel(), theba.core.Stack.getVoxelUnchecked(), theba.core.Stack.getWidth(), theba.core.Stack.setVoxel(), theba.core.Stack.setVoxelUnchecked(), theba.core.math.Point3D.x, theba.core.math.Point3D.y, and theba.core.math.Point3D.z.

Referenced by theba.core.ImageFunctions.delete3D().

static short [] theba.core.ImageFunctions.geodist ( short[]  input,
short[]  mask,
int  width,
int  height 
) [static]
Returns:
A geodesic 2D map

Definition at line 867 of file ImageFunctions.java.

References theba.core.ImageFunctions.dilateAndCount().

static double [] theba.core.ImageFunctions.getArcLenghts ( int[]  chaincode  )  [static]

Calculates the arc lengths of a chaincode

Parameters:
chaincode An int[] containing an 8-way chaincode for a region
Returns:
A double] containing the arc lengths

Definition at line 890 of file ImageFunctions.java.

static Point theba.core.ImageFunctions.getAveragePoint ( short[]  lumenMask,
int  width,
int  height,
short  currentId 
) [static]

Calculates the centroid of a labeled 2D region

Returns:
The centroid represented by a Point-object

Definition at line 935 of file ImageFunctions.java.

static Point theba.core.ImageFunctions.getAveragePoint ( short[]  lumenMask,
int  width,
int  height 
) [static]

Calculates the centroid of a non-zero 2D region

Returns:
The centroid represented by a Point-object

Definition at line 914 of file ImageFunctions.java.

static Rectangle theba.core.ImageFunctions.getBounds ( short[]  image,
int  width,
int  height,
int  margin,
short  id 
) [static]

Same as above, but only checks for a spesific short-value

Parameters:
id 
Returns:

Definition at line 1274 of file ImageFunctions.java.

static Rectangle theba.core.ImageFunctions.getBounds ( short[]  image,
int  width,
int  height,
int  margin 
) [static]

Scans through an image and finds extremal points

A margin can be added to the bounds specified in pixels I.e a 2*2 image with a margin of 1 will end up as a 4*4 image

Number of pixels to padd at each border

Returns:
A rectangle inscribing all non-zero elements of the image

Definition at line 1229 of file ImageFunctions.java.

static int [] theba.core.ImageFunctions.getChaincode ( ArrayList  borderPoints  )  [static]

Returns the int[] chaincode of a list of Point-objects

Parameters:
borderPoints An arrayList containing Point-objects
Returns:
An int[] containing the 8-way chaincode of each border-point

Definition at line 1321 of file ImageFunctions.java.

static double theba.core.ImageFunctions.getInterpolatedValue ( double[]  xa,
double[]  ya,
double  x 
) [static]

Definition at line 1363 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.invertMask ( short[]  input,
boolean  in_place 
) [static]

Accepts a short-array and returns a copy where all non-zero values have been set to 0 and all other values have been set to 255

Parameters:
input 
Returns:

Definition at line 1419 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.mask ( short[]  input,
short[]  mask,
boolean  in_place,
int  width,
int  height,
Rectangle  bounds 
) [static]

Accepts two equal-length arrays and creates a new array with only those values from input where mask!=0

Parameters:
returns a copy if false, otherwise a reference to the input-array is returned
Returns:
output A new array, including only those values from input where mask>0

Definition at line 1476 of file ImageFunctions.java.

static short [] theba.core.ImageFunctions.mask ( short[]  input,
short[]  mask,
boolean  in_place 
) [static]

Accepts two equal-length arrays and creates a new array with only those values from input where mask!=0

Parameters:
returns a copy if false, otherwise a reference to the input-array is returned
Returns:
output A new array, including only those values from input where mask>0

Definition at line 1445 of file ImageFunctions.java.

static void theba.core.ImageFunctions.median3d ( Stack  voxels  )  [static]

Returns the 3x3 median in-place of a binary stack

Parameters:
voxels 

Definition at line 1511 of file ImageFunctions.java.

References theba.core.Stack.getDepth(), theba.core.Stack.getHeight(), theba.core.Stack.getSlice(), theba.core.Stack.getWidth(), and theba.core.gui.ThebaGUI.setProgress().

static boolean theba.core.ImageFunctions.touchBorder ( short[]  mask,
int  w,
int  h 
) [static]

Evaluate if a region touches the border edges

Parameters:
mask Input width non-zero values indication a region
w Width
h Height
Returns:
True if the region the border edges

Definition at line 1563 of file ImageFunctions.java.


Member Data Documentation

short [] theba.core.ImageFunctions.cachedMap = null [static]

Definition at line 30 of file ImageFunctions.java.


The documentation for this class was generated from the following file:

Generated on Fri Nov 13 08:57:08 2009 for Theba by  doxygen 1.6.1