Package qupath.imagej.processing
Class SimpleThresholding
java.lang.Object
qupath.imagej.processing.SimpleThresholding
Collection of static methods to threshold images, either with single global thresholds or
using the pixel values of a second image.
Output is a ByteProcessor where 255 represents 'positive' pixels, and zero represents the background.
- Author:
- Pete Bankhead
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ByteProcessor
greaterThan
(ImageProcessor ip1, ImageProcessor ip2) Created a binary image by thresholding pixels to find where ip1 > ip2static ByteProcessor
greaterThanOrEqual
(ImageProcessor ip1, ImageProcessor ip2) Created a binary image by thresholding pixels to find where ip1 >= ip2static ByteProcessor
imagesEqual
(ImageProcessor ip1, ImageProcessor ip2) Created a binary image by identifying pixels where ip1 == ip2static ByteProcessor
thresholdAbove
(ImageProcessor ip, float threshold) Created a binary image by thresholding pixels to find where ip1 > thresholdstatic ByteProcessor
thresholdAboveEquals
(ImageProcessor ip, float threshold) Created a binary image by thresholding pixels to find where ip1 >= thresholdstatic ByteProcessor
thresholdBelow
(ImageProcessor ip, float threshold) Created a binary image by thresholding pixels to find where ip1 < thresholdstatic ByteProcessor
thresholdBelowEquals
(ImageProcessor ip, float threshold) Created a binary image by thresholding pixels to find where ip1 <= thresholdstatic ByteProcessor
thresholdBetween
(ImageProcessor ip, float lowThreshold, float highThreshold) Created a binary image by thresholding pixels to find where ip >= lowThreshold and ip <= highThresholdstatic ROI
thresholdToROI
(ImageProcessor ip, RegionRequest request) Generate a QuPath ROI from an ImageProcessor.static ROI
thresholdToROI
(BufferedImage img, double minThreshold, double maxThreshold, int band, RegionRequest request) Generate a QuPath ROI by thresholding an image channel image.static ROI
thresholdToROI
(Raster raster, double minThreshold, double maxThreshold, int band, TileRequest request) Generate a QuPath ROI by thresholding an image channel image, deriving coordinates from a TileRequest.
-
Constructor Details
-
SimpleThresholding
public SimpleThresholding()
-
-
Method Details
-
greaterThanOrEqual
Created a binary image by thresholding pixels to find where ip1 >= ip2- Parameters:
ip1
-ip2
-- Returns:
-
greaterThan
Created a binary image by thresholding pixels to find where ip1 > ip2- Parameters:
ip1
-ip2
-- Returns:
-
thresholdBelow
Created a binary image by thresholding pixels to find where ip1 < threshold- Parameters:
ip
-threshold
-- Returns:
-
thresholdBelowEquals
Created a binary image by thresholding pixels to find where ip1 <= threshold- Parameters:
ip
-threshold
-- Returns:
-
imagesEqual
Created a binary image by identifying pixels where ip1 == ip2- Parameters:
ip1
-ip2
-- Returns:
-
thresholdAbove
Created a binary image by thresholding pixels to find where ip1 > threshold- Parameters:
ip
-threshold
-- Returns:
-
thresholdAboveEquals
Created a binary image by thresholding pixels to find where ip1 >= threshold- Parameters:
ip
-threshold
-- Returns:
-
thresholdBetween
public static ByteProcessor thresholdBetween(ImageProcessor ip, float lowThreshold, float highThreshold) Created a binary image by thresholding pixels to find where ip >= lowThreshold and ip <= highThreshold- Parameters:
ip
-lowThreshold
-highThreshold
-- Returns:
-
thresholdToROI
public static ROI thresholdToROI(BufferedImage img, double minThreshold, double maxThreshold, int band, RegionRequest request) Generate a QuPath ROI by thresholding an image channel image.- Parameters:
img
- the input image (any type)minThreshold
- minimum threshold; pixels >= minThreshold will be includedmaxThreshold
- maximum threshold; pixels <= maxThreshold will be includedband
- the image band to threshold (channel)request
- aRegionRequest
corresponding to this image, used to calibrate the coordinates. If null, we assume no downsampling and an origin at (0,0).- Returns:
- See Also:
-
thresholdToROI
public static ROI thresholdToROI(Raster raster, double minThreshold, double maxThreshold, int band, TileRequest request) Generate a QuPath ROI by thresholding an image channel image, deriving coordinates from a TileRequest.This can give a more accurate result than depending on a RegionRequest because it is possible to avoid some loss of precision.
- Parameters:
raster
-minThreshold
-maxThreshold
-band
-request
-- Returns:
- See Also:
-
thresholdToROI
Generate a QuPath ROI from an ImageProcessor.It is assumed that the ImageProcessor has had its min and max threshold values set.
- Parameters:
ip
-request
-- Returns:
-