Interface SpatialFilter
- All Known Implementing Classes:
AbstractComplexKernelFilter, AbstractKernelFilter, BoxBlurFilter, ColourImageFilter, FixedWeightsComplexKernelFilter, FixedWeightsKernelFilter, GaussianBlurFilter, LaplacianFilter, MedianFilter, MorphologicalOperator, PatchSimilarityFilter, SharpenFilter, SobelFilter, SobelFilter.MagnitudeFilter
public interface SpatialFilter
Interface implemented by classes that can spatially filter images.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA JPanel that can be used to specify spatial filter parameters. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA String showing what action is being performed. -
Method Summary
Modifier and TypeMethodDescriptionfilter(ReadableImage image, MonitorWorker worker, Logger logger) Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.filter(ReadableImage image, Logger logger) Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.voidfilterInPlace(WritableImage image, MonitorWorker worker, Logger logger) Filter a WritableImage "in place".voidfilterInPlace(WritableImage image, Logger logger) Filter a WritableImage "in place".voidfilterInPlace(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, MonitorWorker worker, Logger logger) Filter an array of pixel values "in place".voidfilterInPlace(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, Logger logger) Filter an array of pixel values "in place".static voidremoveNaNs(double[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker) Remove NaN (not-a-number) pixel intensity values from an array of double-precision floating-point pixel values.static voidremoveNaNs(float[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker) Remove NaN (not-a-number) pixel intensity values from an array of single-precision floating-point pixel values.
-
Field Details
-
FILTERING_STRING
-
-
Method Details
-
filter
Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.- Parameters:
image- the image to be filtered.logger- theLoggerfor verbose reporting and error messages.- 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
WritableImage filter(ReadableImage image, MonitorWorker worker, Logger logger) throws InvalidImageException, IOException, CancelledException Filter a ReadableImage, returning a new image which is a filtered version of the supplied image.- Parameters:
image- the image to be filtered.worker- theMonitorWorkerthat may be used to cancel the filter operation.logger- theLoggerfor verbose reporting and error messages.- 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
Filter a WritableImage "in place".- Parameters:
image- the image to be filtered.logger- theLoggerfor verbose reporting and error messages.- Throws:
InvalidImageException- if the supplied image cannot be filtered with this filter.IOException- if an I/O error occurs.
-
filterInPlace
void filterInPlace(WritableImage image, MonitorWorker worker, Logger logger) throws InvalidImageException, IOException, CancelledException Filter a WritableImage "in place".- Parameters:
image- the image to be filtered.worker- theMonitorWorkerthat may be used to cancel the filter operation.logger- theLoggerfor verbose reporting and error messages.- Throws:
InvalidImageException- if the supplied image cannot be filtered with this filter.CancelledException- if the filter operation is cancelled by the user or programmatically.IOException- if an I/O error occurs.
-
filterInPlace
void filterInPlace(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, Logger logger) Filter an array of pixel values "in place".- 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.logger- theLoggerfor verbose reporting and error messages.
-
filterInPlace
void filterInPlace(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, MonitorWorker worker, Logger logger) throws CancelledException Filter an array of pixel values "in place".- 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- theMonitorWorkerthat may be used to cancel the filter operation.logger- theLoggerfor verbose reporting and error messages.- Throws:
CancelledException- if the filter operation is cancelled by the user or programmatically.
-
removeNaNs
static void removeNaNs(float[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker) throws CancelledException Remove NaN (not-a-number) pixel intensity values from an array of single-precision floating-point pixel values. The NaN values are substituted by averaging the (non-NaN) pixel intensity values in the adjacent pixels. This is done iteratively until either all NaNs are removed or the maximum number of iterations is exceeded.
Not necessarily all non-NaN values will be substituted, since there may be large patches of NaNs where the adjacent non-NaNs do not propagate to cover the NaNs.- Parameters:
pixels- the pixel values that may contain NaN values and on return will have NaN values substituted.nCols- the number of columns in the float pixel array.nRows- the number of rows in the float pixel array.nSlices- the number of slices in the float pixel array.maxIterations- the maximum number of iterations of substitution.bc- theBoundaryConditionfor pixels at the boundary of the image.worker- if non-null, theMonitorWorkerby which the operation can be cancelled.- Throws:
CancelledException- if the operation is cancelled by the user.
-
removeNaNs
static void removeNaNs(double[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker) throws CancelledException Remove NaN (not-a-number) pixel intensity values from an array of double-precision floating-point pixel values. The NaN values are substituted by averaging the (non-NaN) pixel intensity values in the adjacent pixels. This is done iteratively until either all NaNs are removed or the maximum number of iterations is exceeded.
Not necessarily all non-NaN values will be substituted, since there may be large patches of NaNs where the adjacent non-NaNs do not propagate to cover the NaNs.- Parameters:
pixels- the pixel values that may contain NaN values and on return will have NaN values substituted.nCols- the number of columns in the float pixel array.nRows- the number of rows in the float pixel array.nSlices- the number of slices in the float pixel array.maxIterations- the maximum number of iterations of substitution.bc- theBoundaryConditionfor pixels at the boundary of the image.worker- if non-null, theMonitorWorkerby which the operation can be cancelled.- Throws:
CancelledException- if the operation is cancelled by the user.
-