com.xinapse.filter
Class MedianFilter

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

public final class MedianFilter
extends AbstractKernelFilter
implements SpatialFilter

A SpatialFilter for performing a median filtering of an image.


Nested Class Summary
static class MedianFilter.MedianSpecifierPanel
          A FilterSpecifierPanel for a median filter.
 
Nested classes/interfaces inherited from interface com.xinapse.filter.SpatialFilter
SpatialFilter.SpecifierPanel
 
Field Summary
 
Fields inherited from interface com.xinapse.filter.SpatialFilter
N_DOTS
 
Constructor Summary
MedianFilter(int[] kernelSize)
          Construct a MedianFilter with a kernel size specified by the argument.
 
Method Summary
 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 MedianFilter.
static void main(java.lang.String[] args)
          Runs a self-test of this class.
static MedianFilter newInstance(org.apache.commons.cli.CommandLine commandLine, LoadableImage image)
          Creates a new MedianFilter using the supplied command line arguments.
 java.lang.String toString()
          Returns a String describing this MedianFilter.
 
Methods inherited from class com.xinapse.filter.AbstractKernelFilter
filter, filter, filter, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlaceBinary, filterInPlaceByte, filterInPlaceDouble, filterInPlaceInt, filterInPlaceLong, filterInPlaceShort, filterInPlaceUByte, filterInPlaceUInt, filterInPlaceUShort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.xinapse.filter.SpatialFilter
filter, filter, filterInPlace, filterInPlace, filterInPlace, filterInPlace
 

Constructor Detail

MedianFilter

public MedianFilter(int[] kernelSize)
             throws java.lang.IllegalArgumentException
Construct a MedianFilter with a kernel size specified by the argument.

Parameters:
kernelSize - the kernel size in each direction.
Throws:
java.lang.IllegalArgumentException - if any of the kernel size values is illegal.
Method Detail

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.

newInstance

public static MedianFilter newInstance(org.apache.commons.cli.CommandLine commandLine,
                                       LoadableImage image)
                                throws com.xinapse.util.InvalidArgumentException
Creates a new MedianFilter 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. Not used in the design of a MedianFilter.
Throws:
com.xinapse.util.InvalidArgumentException

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.

toString

public java.lang.String toString()
Returns a String describing this MedianFilter.

Overrides:
toString in class java.lang.Object
Returns:
a String describing this MedianFilter.

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 MedianFilter.

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.

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.