Package com.xinapse.filter
Class AbstractComplexKernelFilter
java.lang.Object
com.xinapse.filter.AbstractComplexKernelFilter
- All Implemented Interfaces:
SpatialFilter
- Direct Known Subclasses:
FixedWeightsComplexKernelFilter
This class provides a skeletal implementation of the
SpatialFilter
interface,
for complex data to minimize the effort required to implement this interface.
To implement a SpatialFilter
for complex data, the programmer needs only to
extend this class and provide an implementation for the
getNKernelCols()
, getNKernelRows()
and getNKernelSlices()
methods.
-
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
Modifier and TypeMethodDescriptionstatic WritableImage
filter
(SpatialFilter filter, ReadableImage image, MonitorWorker worker, boolean verbose) Filter a ReadableImage using the supplied filter, returning a new image which is a filtered version of the supplied image.filter
(ReadableImage image) Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.filter
(ReadableImage image, MonitorWorker worker, boolean verbose) Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.static void
filterInPlace
(SpatialFilter filter, WritableImage image) Filter a WritableImage "in place" using the supplied filter.static void
filterInPlace
(SpatialFilter filter, WritableImage image, MonitorWorker worker, boolean verbose) Filter an image "in place".static void
filterInPlace
(SpatialFilter filter, Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices) Filter an array of pixel values "in place".void
filterInPlace
(WritableImage image) Filter a WritableImage "in place".void
filterInPlace
(WritableImage image, MonitorWorker worker, boolean verbose) Filter a WritableImage "in place".void
filterInPlace
(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices) Filter an array of pixel values "in place".void
filterInPlace
(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, MonitorWorker worker, boolean verbose) Filter an array of pixel values "in place".abstract int
Returns the number of columns in the filter kernel.abstract int
Returns the number of rows in the filter kernel.abstract int
Returns the number of slices in the filter kernel.
-
Method Details
-
filter
Description copied from interface:SpatialFilter
Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.- Specified by:
filter
in interfaceSpatialFilter
- Parameters:
image
- the image to be filtered.- Returns:
- a filtered version of the supplied image.
- Throws:
InvalidImageException
- if the supplied image cannot be filtered with this filter.IOException
- if an I/O error occurs.
-
filter
public WritableImage filter(ReadableImage image, MonitorWorker worker, boolean verbose) throws InvalidImageException, IOException, CancelledException Description copied from interface:SpatialFilter
Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.- Specified by:
filter
in interfaceSpatialFilter
- Parameters:
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.- Returns:
- a filtered version of the supplied image.
- Throws:
InvalidImageException
- if the supplied image cannot be filtered with this filter.IOException
- if an I/O error occurs.CancelledException
- if the filter operation is cancelled by the user or programmatically.
-
filterInPlace
Description copied from interface:SpatialFilter
Filter a WritableImage "in place".- Specified by:
filterInPlace
in interfaceSpatialFilter
- Parameters:
image
- the image to be filtered.- Throws:
InvalidImageException
- if the supplied image cannot be filtered with this filter.IOException
- if an I/O error occurs.
-
filterInPlace
public void filterInPlace(WritableImage image, MonitorWorker worker, boolean verbose) throws InvalidImageException, IOException, CancelledException Description copied from interface:SpatialFilter
Filter a WritableImage "in place".- Specified by:
filterInPlace
in interfaceSpatialFilter
- Parameters:
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.- Throws:
InvalidImageException
- if the supplied image cannot be filtered with this filter.IOException
- if an I/O error occurs.CancelledException
- if the filter operation is cancelled by the user or programmatically.
-
filterInPlace
Description copied from interface:SpatialFilter
Filter an array of pixel values "in place".- Specified by:
filterInPlace
in interfaceSpatialFilter
- 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.
-
filterInPlace
public void filterInPlace(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 interfaceSpatialFilter
- 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.
-
getNKernelCols
public abstract int getNKernelCols()Returns the number of columns in the filter kernel.- Returns:
- the number of columns in the filter kernel.
-
getNKernelRows
public abstract int getNKernelRows()Returns the number of rows in the filter kernel.- Returns:
- the number of rows in the filter kernel.
-
getNKernelSlices
public abstract int getNKernelSlices()Returns the number of slices in the filter kernel.- Returns:
- the number of slices in the filter kernel.
-
filter
public static WritableImage filter(SpatialFilter filter, ReadableImage image, MonitorWorker worker, boolean verbose) throws InvalidImageException, IOException, CancelledException Filter a ReadableImage using the supplied filter, returning a new image which is a filtered version of the supplied image.- Parameters:
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.- Returns:
- a new image which is a filtered version of the supplied image.
- Throws:
InvalidImageException
- if the supplied image cannot be filtered with the filter.IOException
- if an I/O error occurs.CancelledException
- if the filter operation is cancelled by the user or programmatically.
-
filterInPlace
public static void filterInPlace(SpatialFilter filter, WritableImage image) throws InvalidImageException, IOException Filter a WritableImage "in place" using the supplied filter.- Parameters:
filter
- the filter to be applied.image
- the image to be filtered.- Throws:
InvalidImageException
- if the supplied image cannot be filtered with the filter.IOException
- if an I/O error occurs.
-
filterInPlace
public static void filterInPlace(SpatialFilter filter, Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices) Filter an array of pixel values "in place".- Parameters:
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.
-
filterInPlace
public static void filterInPlace(SpatialFilter filter, WritableImage image, MonitorWorker worker, boolean verbose) throws InvalidImageException, IOException, CancelledException Filter an image "in place".- Parameters:
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.- Throws:
InvalidImageException
- if the supplied image cannot be filtered with the filter.CancelledException
- if the filter operation is cancelled by the user or programmatically.IOException
- if an I/O error occurs.
-