|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xinapse.filter.AbstractKernelFilter
public abstract class AbstractKernelFilter
This class provides a skeletal implementation of the SpatialFilter interface, to minimize the effort required to implement this interface.
To implement a SpatialFilter, the programmer needs only to extend this class and provide an implementation for the filterInPlaceFloat, getNKernelCols, getNKernelRows and getNKernelSlices methods. Filtering of all other pixel data types will then be performed with this class's default implementations for the other filtering methods. However, these methods are quite inefficient, since they simply coerce the pixel values to float, perform the filtering operation using filterInPlaceFloat method, and then coerce the result back to the original data type. The programmer may therefore choose to implement more efficient methods for the specific data types that they know this filter will be used with. Furthermore, if the default implementations are used, filtering of double-precision, integer and long data types may suffer from lack of precision.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.xinapse.filter.SpatialFilter |
|---|
SpatialFilter.SpecifierPanel |
| Field Summary |
|---|
| Fields inherited from interface com.xinapse.filter.SpatialFilter |
|---|
N_DOTS |
| Method Summary | |
|---|---|
MultiSliceImage |
filter(MultiSliceImage image)
Filter a MultiSliceImage, returning a new image which is a filtered version of the supplied image. |
MultiSliceImage |
filter(MultiSliceImage image,
MonitorWorker worker,
boolean verbose)
Filter a MultiSliceImage, returning a new image which is a filtered version of the supplied image. |
static MultiSliceImage |
filter(SpatialFilter filter,
MultiSliceImage image,
MonitorWorker worker,
boolean verbose)
Filter a MultiSliceImage using the supplied filter, returning a new image which is a filtered version of the supplied image. |
void |
filterInPlace(MultiSliceImage image)
Filter a MultiSliceImage "in place". |
void |
filterInPlace(MultiSliceImage image,
MonitorWorker worker,
boolean verbose)
Filter a MultiSliceImage "in place". |
void |
filterInPlace(java.lang.Object pixels,
PixelDataType dataType,
int nCols,
int nRows,
int nSlices)
Filter an array of pixel values "in place". |
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". |
static void |
filterInPlace(SpatialFilter filter,
MultiSliceImage image)
Filter a MultiSliceImage "in place" using the supplied filter. |
static void |
filterInPlace(SpatialFilter filter,
MultiSliceImage image,
MonitorWorker worker,
boolean verbose)
Filter an array of pixel values "in place". |
static void |
filterInPlace(SpatialFilter filter,
java.lang.Object pixels,
PixelDataType dataType,
int nCols,
int nRows,
int nSlices)
Filter an array of pixel values "in place". |
void |
filterInPlaceBinary(BitSet pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of binary pixel values "in place". |
void |
filterInPlaceByte(byte[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of signed byte pixel values "in place". |
void |
filterInPlaceDouble(double[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of double-precision pixel values "in place". |
abstract void |
filterInPlaceFloat(float[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of floating-point pixel values "in place". |
void |
filterInPlaceInt(int[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of signed int pixel values "in place". |
void |
filterInPlaceLong(long[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of long pixel values "in place". |
void |
filterInPlaceShort(short[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of signed short pixel values "in place". |
void |
filterInPlaceUByte(byte[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of unsigned byte pixel values "in place". |
void |
filterInPlaceUInt(int[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of unsigned int pixel values "in place". |
void |
filterInPlaceUShort(short[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
Filter an array of unsigned short pixel values "in place". |
abstract int |
getNKernelCols()
Returns the number of columns in the filter kernel. |
abstract int |
getNKernelRows()
Returns the number of rows in the filter kernel. |
abstract int |
getNKernelSlices()
Returns the number of slices in the filter kernel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public MultiSliceImage filter(MultiSliceImage image)
throws InvalidImageException
SpatialFilter
filter in interface SpatialFilterimage - the image to be filtered.
InvalidImageException - if the supplied image cannot be filtered with this filter.
public MultiSliceImage filter(MultiSliceImage image,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
SpatialFilter
filter in interface SpatialFilterimage - the image to be filtered.worker - the MonitorWorker that may be used to cancel the filter operation.verbose - whether verbose reporting to System.out is turned on.
InvalidImageException - if the supplied image cannot be filtered with this filter.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlace(MultiSliceImage image)
throws InvalidImageException
SpatialFilter
filterInPlace in interface SpatialFilterimage - the image to be filtered.
InvalidImageException - if the supplied image cannot be filtered with this filter.
public void filterInPlace(MultiSliceImage image,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
SpatialFilter
filterInPlace in interface SpatialFilterimage - the image to be filtered.worker - the MonitorWorker that may be used to cancel the filter operation.verbose - whether verbose reporting to System.out is turned on.
InvalidImageException - if the supplied image cannot be filtered with this filter.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlace(java.lang.Object pixels,
PixelDataType dataType,
int nCols,
int nRows,
int nSlices)
SpatialFilter
filterInPlace in interface SpatialFilterpixels - 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.
public void filterInPlace(java.lang.Object pixels,
PixelDataType dataType,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
SpatialFilter
filterInPlace in interface SpatialFilterpixels - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public abstract void filterInPlaceFloat(float[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.public abstract int getNKernelCols()
public abstract int getNKernelRows()
public abstract int getNKernelSlices()
public void filterInPlaceBinary(BitSet pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlaceByte(byte[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlaceUByte(byte[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlaceShort(short[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlaceUShort(short[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlaceInt(int[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlaceUInt(int[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlaceLong(long[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public void filterInPlaceDouble(double[] pixels,
int nCols,
int nRows,
int nSlices,
MonitorWorker worker,
boolean verbose)
throws CancelledException
pixels - the array of image pixel values.nCols - the number of image columnsnRows - 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.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public static MultiSliceImage filter(SpatialFilter filter,
MultiSliceImage image,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
filter - the filter to be applied.image - the image to be filtered.worker - the MonitorWorker that may be used to cancel the filter operation.verbose - whether verbose reporting to System.out is turned on.
InvalidImageException - if the supplied image cannot be filtered with the filter.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
public static void filterInPlace(SpatialFilter filter,
MultiSliceImage image)
throws InvalidImageException
filter - the filter to be applied.image - the image to be filtered.
InvalidImageException - if the supplied image cannot be filtered with the filter.
public static void filterInPlace(SpatialFilter filter,
java.lang.Object pixels,
PixelDataType dataType,
int nCols,
int nRows,
int nSlices)
filter - the filter to be applied.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.
public static void filterInPlace(SpatialFilter filter,
MultiSliceImage image,
MonitorWorker worker,
boolean verbose)
throws InvalidImageException,
CancelledException
filter - the filter to be applied.image - the image to be filtered.worker - the MonitorWorker that may be used to cancel the filter operation.verbose - whether verbose reporting to System.out is turned on.
InvalidImageException - if the supplied image cannot be filtered with the filter.
CancelledException - if the filter operation is cancelled by the user or
programmatically.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||