Package qupath.imagej.processing
Class IJFilters
java.lang.Object
qupath.imagej.processing.IJFilters
Helper class for filtering ImageJ images.
Many of these methods call built-in ImageJ filters, but adding them as static methods in a single class here may make them easier to find and use... and there are some extras that aren't part of ImageJ.
Important notes:
- In general, the input image is unchanged and a new output image is created.
- These methods do not pay attention to any Roi that has been set on the image!
- Since:
- v0.6.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageProcessor
blackTopHat
(ImageProcessor ip, double radius) Apply a black tophat filter; this is equivalent to subtracting an 'opened' image from the original.static ImageProcessor
close
(ImageProcessor ip, double radius) Apply a morphological closing; this is equivalent to applying a maximum followed by a minimum filter.static ImageProcessor
closingByReconstruction
(ImageProcessor ip, double radius) Apply a closing by (morphological) reconstruction.static FloatProcessor
differenceOfGaussians
(ImageProcessor ip, double sigma1, double sigma2) Apply a Difference of Gaussians filter to an input image.static ImageProcessor
dilate
(ImageProcessor ip, double radius) Apply a dilation; this is equivalent to applying a maximum filter.static ImageProcessor
erode
(ImageProcessor ip, double radius) Apply an erosion; this is equivalent to applying a minimum filter.static ByteProcessor
extendedMaxima
(ImageProcessor ip, double h) Find regional maxima in an image above a defined height.static ByteProcessor
extendedMinima
(ImageProcessor ip, double h) Find regional minima in an image above a defined height.static ImageProcessor
gaussian
(ImageProcessor ip, double sigma) Apply a Gaussian filter to an input image.static FloatProcessor
hMaxima
(ImageProcessor ip, double h) Suppress small local maxima in an image using a H-maxima transform.static FloatProcessor
hMinima
(ImageProcessor ip, double h) Suppress small local minima in an image using a H-minima transform.static ImageProcessor
maximum
(ImageProcessor ip, double radius) Apply a maximum filter.static ImageProcessor
mean
(ImageProcessor ip, double radius) Apply a mean (average) filter.static ImageProcessor
median
(ImageProcessor ip, double radius) Apply a median filter.static ImageProcessor
minimum
(ImageProcessor ip, double radius) Apply a minimum filter.static ImageProcessor
open
(ImageProcessor ip, double radius) Apply a morphological opening; this is equivalent to applying a minimum followed by a maximum filter.static ImageProcessor
openingByReconstruction
(ImageProcessor ip, double radius) Apply an opening by (morphological) reconstruction.static ByteProcessor
Find regional maxima in an image.static ByteProcessor
Find regional minima in an image.static ImageProcessor
whiteTopHat
(ImageProcessor ip, double radius) Apply a white tophat filter; this is equivalent to subtracting the original image from the a 'closed' image.
-
Constructor Details
-
IJFilters
public IJFilters()
-
-
Method Details
-
mean
Apply a mean (average) filter.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
-
median
Apply a median filter.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
-
maximum
Apply a maximum filter.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
-
minimum
Apply a minimum filter.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
-
dilate
Apply a dilation; this is equivalent to applying a maximum filter.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
-
erode
Apply an erosion; this is equivalent to applying a minimum filter.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
-
open
Apply a morphological opening; this is equivalent to applying a minimum followed by a maximum filter.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
-
close
Apply a morphological closing; this is equivalent to applying a maximum followed by a minimum filter.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
-
blackTopHat
Apply a black tophat filter; this is equivalent to subtracting an 'opened' image from the original.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
- See Also:
-
whiteTopHat
Apply a white tophat filter; this is equivalent to subtracting the original image from the a 'closed' image.- Parameters:
ip
- the input imageradius
- the filter radius- Returns:
- the filtered image
- See Also:
-
openingByReconstruction
Apply an opening by (morphological) reconstruction.- Parameters:
ip
- the input imageradius
- the radius of the initial opening filter- Returns:
- the filtered image
-
closingByReconstruction
Apply a closing by (morphological) reconstruction.- Parameters:
ip
- the input imageradius
- the radius of the initial closing filter- Returns:
- the filtered image
-
regionalMaxima
Find regional maxima in an image.Note: Use with caution! This method is experimental and may change.
- Parameters:
ip
- the input image- Returns:
- a binary image with 255 at the location of regional maxima and 0 elsewhere
-
regionalMinima
Find regional minima in an image.Note: Use with caution! This method is experimental and may change.
- Parameters:
ip
- the input image- Returns:
- a binary image with 255 at the location of regional minima and 0 elsewhere
-
hMaxima
Suppress small local maxima in an image using a H-maxima transform.Note: Use with caution! This method is experimental and may change.
- Parameters:
ip
- the input imageh
- the height of maxima to suppress- Returns:
- the input with maxima suppressed
-
hMinima
Suppress small local minima in an image using a H-minima transform.Note: Use with caution! This method is experimental and may change.
- Parameters:
ip
- the input imageh
- the height of minima to suppress- Returns:
- the input with minima suppressed
-
extendedMaxima
Find regional maxima in an image above a defined height.Note: Use with caution! This method is experimental and may change.
- Parameters:
ip
- the input imageh
- the height of the maxima- Returns:
- a binary image with 255 at the location of regional maxima and 0 elsewhere
-
extendedMinima
Find regional minima in an image above a defined height.Note: Use with caution! This method is experimental and may change.
- Parameters:
ip
- the input imageh
- the height of the minima- Returns:
- a binary image with 255 at the location of regional minima and 0 elsewhere
-
gaussian
Apply a Gaussian filter to an input image.- Parameters:
ip
- the input imagesigma
- the sigma value of the Gaussian filter- Returns:
- the filtered image
-
differenceOfGaussians
Apply a Difference of Gaussians filter to an input image.- Parameters:
ip
- the input imagesigma1
- the sigma value of the first Gaussian filtersigma2
- the sigma value of the second Gaussian filter (to be subtracted)- Returns:
- the filtered image
-