com.xinapse.filter
Class MorphologicalOperator

java.lang.Object
  extended by com.xinapse.filter.AbstractKernelFilter
      extended by com.xinapse.filter.MorphologicalOperator
All Implemented Interfaces:
SpatialFilter

public final class MorphologicalOperator
extends AbstractKernelFilter
implements SpatialFilter

A SpatialFilter for performing a morphological operation on an image.


Nested Class Summary
static class MorphologicalOperator.MorphologicalSpecifierPanel
          A FilterSpecifierPanel for a moprphological operation filter.
static class MorphologicalOperator.Op
          An enumeration of the possible morphological operations on an image.
 
Nested classes/interfaces inherited from interface com.xinapse.filter.SpatialFilter
SpatialFilter.SpecifierPanel
 
Field Summary
static MorphologicalOperator DILATE_2D_3_X_3
          A 2-D dilate operator with a 3x3 kernel.
static MorphologicalOperator DILATE_3D_3_X_3_X_3
          A 3-D dilate operator with a 3x3x3 kernel.
static MorphologicalOperator ERODE_2D_3_X_3
          A 2-D erode operator with a 3x3 kernel.
static MorphologicalOperator ERODE_3D_3_X_3_X_3
          A 3-D erode operator with a 3x3x3 kernel.
static org.apache.commons.cli.Options OPTIONS
          The Options for selecting a MorphologicalOperator.
 
Fields inherited from interface com.xinapse.filter.SpatialFilter
N_DOTS
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests whether the supplied argument is equal to this MorphologicalOperator.
 void filterInPlace(java.lang.Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, MonitorWorker worker, boolean verbose)
          Filter an array of pixel values "in place".
 void filterInPlaceFloat(float[] pixels, int nCols, int nRows, int nSlices, MonitorWorker worker, boolean verbose)
          Filter an array of floating-point pixel values "in place".
static java.lang.String getName()
          Returns the human-readable name of this filter.
 int getNKernelCols()
          Returns the number of columns in the filter kernel.
 int getNKernelRows()
          Returns the number of rows in the filter kernel.
 int getNKernelSlices()
          Returns the number of slices in the filter kernel.
static java.lang.String getOptionName()
          Returns the name of this type of filter when specifying it in program optional arguments.
static org.apache.commons.cli.Options getOptions()
          Returns the options for this type of filter.
static SpatialFilter.SpecifierPanel getSpecifierPanel(java.lang.String preferencesNodeName)
          Returns a SpatialFilter.SpecifierPanel that can be used to set the parameters for a MorphologicalOperator.
static void main(java.lang.String[] args)
          Runs a self-test of this class.
static MorphologicalOperator newCircular2DInstance(int kernelSize, MorphologicalOperator.Op op)
          Creates a new MorphologicalOperator with a 2-D circular kernel.
static MorphologicalOperator newCubic3DInstance(int kernelSize, MorphologicalOperator.Op op)
          Creates a new MorphologicalOperator with a 3-D cubic kernel.
static MorphologicalOperator newInstance(org.apache.commons.cli.CommandLine commandLine, LoadableImage image)
          Creates a new MorphologicalOperator using the supplied command line arguments.
static MorphologicalOperator newRectangular2DInstance(int kernelSize, MorphologicalOperator.Op op)
          Creates a new MorphologicalOperator with a 2-D rectangular kernel.
static MorphologicalOperator newSpherical3DInstance(int kernelSize, MorphologicalOperator.Op op)
          Creates a new MorphologicalOperator with a 3-D spherical kernel.
 java.lang.String toString()
          Returns a String describing the operator.
 
Methods inherited from class com.xinapse.filter.AbstractKernelFilter
filter, filter, filter, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlaceBinary, filterInPlaceByte, filterInPlaceDouble, filterInPlaceInt, filterInPlaceLong, filterInPlaceShort, filterInPlaceUByte, filterInPlaceUInt, filterInPlaceUShort
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.xinapse.filter.SpatialFilter
filter, filter, filterInPlace, filterInPlace, filterInPlace
 

Field Detail

ERODE_2D_3_X_3

public static final MorphologicalOperator ERODE_2D_3_X_3
A 2-D erode operator with a 3x3 kernel.


DILATE_2D_3_X_3

public static final MorphologicalOperator DILATE_2D_3_X_3
A 2-D dilate operator with a 3x3 kernel.


ERODE_3D_3_X_3_X_3

public static final MorphologicalOperator ERODE_3D_3_X_3_X_3
A 3-D erode operator with a 3x3x3 kernel.


DILATE_3D_3_X_3_X_3

public static final MorphologicalOperator DILATE_3D_3_X_3_X_3
A 3-D dilate operator with a 3x3x3 kernel.


OPTIONS

public static final org.apache.commons.cli.Options OPTIONS
The Options for selecting a MorphologicalOperator.

Method Detail

newInstance

public static MorphologicalOperator newInstance(org.apache.commons.cli.CommandLine commandLine,
                                                LoadableImage image)
                                         throws com.xinapse.util.InvalidArgumentException
Creates a new MorphologicalOperator using the supplied command line arguments.

Parameters:
commandLine - the command line from which a program is invoked.
image - the image to which this filter is designed to apply.
Throws:
com.xinapse.util.InvalidArgumentException

newRectangular2DInstance

public static MorphologicalOperator newRectangular2DInstance(int kernelSize,
                                                             MorphologicalOperator.Op op)
Creates a new MorphologicalOperator with a 2-D rectangular kernel.

Parameters:
kernelSize - the kernel size.
op - the MorphologicalOperator.Op to perform.

newCircular2DInstance

public static MorphologicalOperator newCircular2DInstance(int kernelSize,
                                                          MorphologicalOperator.Op op)
Creates a new MorphologicalOperator with a 2-D circular kernel.

Parameters:
kernelSize - the kernel size (diameter).
op - the MorphologicalOperator.Op to perform.

newCubic3DInstance

public static MorphologicalOperator newCubic3DInstance(int kernelSize,
                                                       MorphologicalOperator.Op op)
Creates a new MorphologicalOperator with a 3-D cubic kernel.

Parameters:
kernelSize - the kernel size.
op - the MorphologicalOperator.Op to perform.

newSpherical3DInstance

public static MorphologicalOperator newSpherical3DInstance(int kernelSize,
                                                           MorphologicalOperator.Op op)
Creates a new MorphologicalOperator with a 3-D spherical kernel.

Parameters:
kernelSize - the kernel size (diameter).
op - the MorphologicalOperator.Op to perform.

getNKernelCols

public int getNKernelCols()
Description copied from class: AbstractKernelFilter
Returns the number of columns in the filter kernel.

Specified by:
getNKernelCols in class AbstractKernelFilter
Returns:
the number of columns in the filter kernel.

getNKernelRows

public int getNKernelRows()
Description copied from class: AbstractKernelFilter
Returns the number of rows in the filter kernel.

Specified by:
getNKernelRows in class AbstractKernelFilter
Returns:
the number of rows in the filter kernel.

getNKernelSlices

public int getNKernelSlices()
Description copied from class: AbstractKernelFilter
Returns the number of slices in the filter kernel.

Specified by:
getNKernelSlices in class AbstractKernelFilter
Returns:
the number of slices in the filter kernel.

filterInPlaceFloat

public void filterInPlaceFloat(float[] pixels,
                               int nCols,
                               int nRows,
                               int nSlices,
                               MonitorWorker worker,
                               boolean verbose)
                        throws CancelledException
Description copied from class: AbstractKernelFilter
Filter an array of floating-point pixel values "in place".

Specified by:
filterInPlaceFloat in class AbstractKernelFilter
Parameters:
pixels - the array of image pixel values.
nCols - the number of image columns
nRows - the number of image rows.
nSlices - the number of image slices.
worker - the MonitorWorker that may be used to cancel the filter operation.
verbose - whether verbose reporting to System.out is turned on.
Throws:
CancelledException - if the filter operation is cancelled by the user or programmatically.

filterInPlace

public void filterInPlace(java.lang.Object pixels,
                          PixelDataType dataType,
                          int nCols,
                          int nRows,
                          int nSlices,
                          MonitorWorker worker,
                          boolean verbose)
                   throws CancelledException
Description copied from interface: SpatialFilter
Filter an array of pixel values "in place".

Specified by:
filterInPlace in interface SpatialFilter
Overrides:
filterInPlace in class AbstractKernelFilter
Parameters:
pixels - the array of image pixel values.
dataType - the PixelDataType of the pixels.
nCols - the number of image columns.
nRows - the number of image rows.
nSlices - the number of image slices.
worker - the MonitorWorker that may be used to cancel the filter operation.
verbose - whether verbose reporting to System.out is turned on.
Throws:
CancelledException - if the filter operation is cancelled by the user or programmatically.

toString

public java.lang.String toString()
Returns a String describing the operator.

Overrides:
toString in class java.lang.Object
Returns:
a String describing the MorphologicalOperator.

getOptionName

public static java.lang.String getOptionName()
Returns the name of this type of filter when specifying it in program optional arguments.

Returns:
the name of the filter for selection in program arguments.

getOptions

public static org.apache.commons.cli.Options getOptions()
Returns the options for this type of filter.

Returns:
the options for this type of filter.

getSpecifierPanel

public static SpatialFilter.SpecifierPanel getSpecifierPanel(java.lang.String preferencesNodeName)
Returns a SpatialFilter.SpecifierPanel that can be used to set the parameters for a MorphologicalOperator.

Parameters:
preferencesNodeName - the preferences node name from which the initial settings will be taken.
Returns:
a SpatialFilter.SpecifierPanel to set the parameters for this type of filter.

getName

public static java.lang.String getName()
Returns the human-readable name of this filter.

Returns:
the human-readable name of this filter.

equals

public boolean equals(java.lang.Object o)
Tests whether the supplied argument is equal to this MorphologicalOperator.

Overrides:
equals in class java.lang.Object
Parameters:
o - the Object to be tested for equality.

main

public static void main(java.lang.String[] args)
Runs a self-test of this class.

Parameters:
args - the program aguments (ignored).


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.