Package com.xinapse.filter
Interface SpatialFilter
- All Known Implementing Classes:
AbstractComplexKernelFilter
,AbstractKernelFilter
,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
Modifier and TypeInterfaceDescriptionstatic class
A JPanel that can be used to specify spatial filter parameters. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The number of dots to show as the filter progresses. -
Method Summary
Modifier and TypeMethodDescriptionfilter
(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.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".static void
removeNaNs
(double[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker, boolean verbose) Remove NaN (not-a-number) pixel intensity values from an array of double-precision floating-point pixel values.static void
removeNaNs
(float[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker, boolean verbose) Remove NaN (not-a-number) pixel intensity values from an array of single-precision floating-point pixel values.
-
Field Details
-
N_DOTS
static final int N_DOTSThe number of dots to show as the filter progresses.- See Also:
-
-
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.- 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, boolean verbose) 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
- 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
Filter a WritableImage "in place".- 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
void filterInPlace(WritableImage image, MonitorWorker worker, boolean verbose) throws InvalidImageException, IOException, CancelledException Filter a WritableImage "in place".- 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.CancelledException
- if the filter operation is cancelled by the user or programmatically.IOException
- if an I/O error occurs.
-
filterInPlace
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.
-
filterInPlace
void filterInPlace(Object pixels, PixelDataType dataType, int nCols, int nRows, int nSlices, MonitorWorker worker, boolean verbose) 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
- 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.
-
removeNaNs
static void removeNaNs(float[] pixels, int nCols, int nRows, int nSlices, int maxIterations, BoundaryCondition bc, MonitorWorker worker, boolean verbose) 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
- the BoundaryCondition for pixels at the boundary of the image.worker
- if non-null, the MonitorWorker by which the operation can be cancelled.verbose
- whether verbose reporting is turned on.- 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, boolean verbose) 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
- the BoundaryCondition for pixels at the boundary of the image.worker
- if non-null, the MonitorWorker by which the operation can be cancelled.verbose
- whether verbose reporting is turned on.- Throws:
CancelledException
- if the operation is cancelled by the user.
-