Package com.xinapse.filter
Class SobelFilter.MagnitudeFilter
java.lang.Object
com.xinapse.filter.SobelFilter.MagnitudeFilter
- All Implemented Interfaces:
SpatialFilter
- Enclosing class:
- SobelFilter
A {
SpatialFilter
for producing the magnitude of the gradient of an image.
This filter combines the x, y an z Soble filters to calculate the magnitude of the gradient.-
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 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 SobelFilter.MagnitudeFilter
new2DInstance
(float pixelXSize, float pixelYSize) Creates a new 2-DSobelFilter.MagnitudeFilter
suitable for filtering images with the given pixel sizes, to obtain the magnitude of the intensity gradient.static SobelFilter.MagnitudeFilter
new2DInstance
(ReadableImage image) Creates a new 2-DSobelFilter.MagnitudeFilter
suitable for filtering the supplied image to obtain the magnitude of the intensity gradient.static SobelFilter.MagnitudeFilter
new3DInstance
(float pixelXSize, float pixelYSize, float pixelZSize) Creates a new 3-DSobelFilter.MagnitudeFilter
suitable for filtering images with the given pixel sizes, to obtain the magnitude of the intensity gradient.static SobelFilter.MagnitudeFilter
new3DInstance
(ReadableImage image) Creates a new 3-DSobelFilter.MagnitudeFilter
suitable for filtering the supplied image to obtain the magnitude of the intensity gradient.
-
Method Details
-
new2DInstance
public static SobelFilter.MagnitudeFilter new2DInstance(ReadableImage image) throws InvalidArgumentException, InvalidImageException Creates a new 2-DSobelFilter.MagnitudeFilter
suitable for filtering the supplied image to obtain the magnitude of the intensity gradient.- Parameters:
image
- the image to which this filter is designed to apply. The image pixel size is used to determine the kernel weights.- Returns:
- new 2-D
SobelFilter.MagnitudeFilter
to obtain the magnitude of the intensity gradient. - Throws:
InvalidArgumentException
- if the filter cannot be created from the arguments.InvalidImageException
- if the image cannot be used to generate a filter.
-
new2DInstance
public static SobelFilter.MagnitudeFilter new2DInstance(float pixelXSize, float pixelYSize) throws InvalidArgumentException Creates a new 2-DSobelFilter.MagnitudeFilter
suitable for filtering images with the given pixel sizes, to obtain the magnitude of the intensity gradient.- Parameters:
pixelXSize
- the pixel width.pixelYSize
- the pixel height.- Returns:
- new 2-D
SobelFilter.MagnitudeFilter
to obtain the magnitude of the intensity gradient. - Throws:
InvalidArgumentException
- if the filter cannot be created from the arguments.
-
new3DInstance
public static SobelFilter.MagnitudeFilter new3DInstance(ReadableImage image) throws InvalidArgumentException, InvalidImageException Creates a new 3-DSobelFilter.MagnitudeFilter
suitable for filtering the supplied image to obtain the magnitude of the intensity gradient.- Parameters:
image
- the image to which this filter is designed to apply. The image pixel size is used to determine the kernel weights.- Returns:
- new 3-D
SobelFilter.MagnitudeFilter
to obtain the magnitude of the intensity gradient. - Throws:
InvalidArgumentException
- if the filter cannot be created from the arguments.InvalidImageException
- if the image cannot be used to generate a filter.
-
new3DInstance
public static SobelFilter.MagnitudeFilter new3DInstance(float pixelXSize, float pixelYSize, float pixelZSize) throws InvalidArgumentException Creates a new 3-DSobelFilter.MagnitudeFilter
suitable for filtering images with the given pixel sizes, to obtain the magnitude of the intensity gradient.- Parameters:
pixelXSize
- the pixel width.pixelYSize
- the pixel height.pixelZSize
- the pixel height.- Returns:
- new 3-D
SobelFilter.MagnitudeFilter
to obtain the magnitude of the intensity gradient. - Throws:
InvalidArgumentException
- if the filter cannot be created from the arguments.
-
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.
-