Class IJProcessing
 This focuses especially on common processing operations involving ImageProcessor, including the creation
 of labeled images and Rois.
- Since:
- v0.6.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic intConstant for 4-connectivity when tracing Rois.static intConstant for 8-connectivity when tracing Rois.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T extends ImageProcessor>
 Tadd(T ip, ImageProcessor... ipOthers) Pixelwise sum of input images.static RoiautoThresholdToRoi(ImageProcessor ip, String method) Apply an auto-threshold to an image, and generate a Roi from the result.autoThresholdToSplitRois(ImageProcessor ip, String method, int connectivity) Apply an auto-threshold to an image, and generate a zero or more Rois from the result based on connected components.static OverlaycreateOverlay(Collection<? extends Roi> rois) Create an overlay containing all the Rois in the provided collection.static <T extends ImageProcessor>
 Tdivide(T ip, ImageProcessor... ipOthers) Pixelwise division of the input images.static ImageProcessorlabelImage(ImageProcessor ip, int connectivity) Create a labeled image using the thresholds set on anImageProcessor(inclusive).static ImageProcessorlabelImage(ImageProcessor ip, int connectivity, DoublePredicate predicate) Create a labeled image using the thresholds set on anImageProcessor.labelsToRois(ImageProcessor ipLabels) Create ImageJ Rois from labels in an image.static Roi[]labelsToRoisArray(ImageProcessor ipLabels) Create ImageJ Rois from labels in an image.static <T extends ImageProcessor>
 Tmax(T ip, ImageProcessor... ipOthers) Pixelwise maximum of the input images.static <T extends ImageProcessor>
 Tmin(T ip, ImageProcessor... ipOthers) Pixelwise minimum of the input images.static <T extends ImageProcessor>
 Tmultiply(T ip, ImageProcessor... ipOthers) Pixelwise multiplication of the input images.static <T extends ImageProcessor>
 Tsubtract(T ip, ImageProcessor... ipOthers) Pixelwise subtraction of one or more images from the first image passed as a parameter.static RoiCreate an ImageJ ROI from a thresholded image.thresholdToSplitRois(ImageProcessor ip, int connectivity) Create a list of ImageJ ROIs by tracing connected components in a thresholded image.static PolygonRoiConvert a traced outline from the ImageJ Wand into a PolygonRoi.
- 
Field Details- 
CONNECTIVITY_4public static int CONNECTIVITY_4Constant for 4-connectivity when tracing Rois.
- 
CONNECTIVITY_8public static int CONNECTIVITY_8Constant for 8-connectivity when tracing Rois.
 
- 
- 
Constructor Details- 
IJProcessingpublic IJProcessing()
 
- 
- 
Method Details- 
autoThresholdToRoiApply an auto-threshold to an image, and generate a Roi from the result.The threshold of the image will be set temporarily and then removed afterwards. - Parameters:
- ip- the input image
- method- a method string, as accepted by- ImageProcessor.setAutoThreshold(String)
- Returns:
- the threshold Roi, or null if no thresholded pixels were found
 
- 
autoThresholdToSplitRoispublic static List<Roi> autoThresholdToSplitRois(ImageProcessor ip, String method, int connectivity) Apply an auto-threshold to an image, and generate a zero or more Rois from the result based on connected components.The threshold of the image will be set temporarily and then removed afterwards. - Parameters:
- ip- the input image
- method- a method string, as accepted by- ImageProcessor.setAutoThreshold(String)
- connectivity- either 4 or 8
- Returns:
- a list containing a Roi for each connected component
 
- 
thresholdToRoiCreate an ImageJ ROI from a thresholded image.This makes use of ThresholdToSelection, and returns null if no Roi is found.- Parameters:
- ip- the image, with min and/or max thresholds already set.
- Returns:
- a Roi generated by applying the threshold, or null if there are no thresholded pixels
 
- 
thresholdToSplitRoisCreate a list of ImageJ ROIs by tracing connected components in a thresholded image.This makes use of ThresholdToSelection, and returns null if no Roi is found.- Parameters:
- ip- the image, with min and/or max thresholds already set
- connectivity- may be 4 or 8
- Returns:
- a Roi generated by applying the threshold, or null if there are no thresholded pixels
 
- 
labelImageCreate a labeled image using the thresholds set on anImageProcessor(inclusive).- Parameters:
- ip- the input image
- connectivity- may be 4 or 8
- Returns:
- labelled image, as a ShortProcessor (if possible) or FloatProcessor (if necessary)
 
- 
labelImagepublic static ImageProcessor labelImage(ImageProcessor ip, int connectivity, DoublePredicate predicate) Create a labeled image using the thresholds set on anImageProcessor.- Parameters:
- ip- the input image
- connectivity- may be 4 or 8
- predicate- the predicate to determine if a pixel should be labeled based on its value
- Returns:
- labelled image, as a ShortProcessor (if possible) or FloatProcessor (if necessary)
- Since:
- v0.6.0
 
- 
labelsToRoisArrayCreate ImageJ Rois from labels in an image.Note that this is intended to handle disconnected Rois and Rois that contain holes, such that the Roi contains all pixels with the given label and no other pixels. - Parameters:
- ipLabels- the labeled image; generally this should be a ByteProcessor or ShortProcessor
- Returns:
- an array of length n; output[i] is the ROI for label i+1, or null if no Roi is found with that label.
 
- 
labelsToRoisCreate ImageJ Rois from labels in an image.This is similar to labelsToRoisArray(ImageProcessor)but omits any null Rois. Consequently, when labels can be missing it is not possible to relate the index from the list to the original label.- Parameters:
- ipLabels- the labeled image; generally this should be a ByteProcessor or ShortProcessor
- Returns:
- a list of Rois that were found
 
- 
wandToRoiConvert a traced outline from the ImageJ Wand into a PolygonRoi.- Parameters:
- wand-
- Returns:
 
- 
createOverlayCreate an overlay containing all the Rois in the provided collection.- Parameters:
- rois-
- Returns:
 
- 
subtractPixelwise subtraction of one or more images from the first image passed as a parameter. The input images are unchanged.- Parameters:
- ip- the first image
- ipOthers- additional images
- Returns:
- a new image representing the result of the subtraction.
 
- 
addPixelwise sum of input images. The input images are unchanged.- Parameters:
- ip- the first image
- ipOthers- additional images
- Returns:
- a new image representing the result of the addition.
 
- 
multiplyPixelwise multiplication of the input images. The input images are unchanged.- Parameters:
- ip- the first image
- ipOthers- additional images
- Returns:
- a new image representing the result of the multiplication.
 
- 
dividePixelwise division of the input images. The input images are unchanged.- Parameters:
- ip- the first image
- ipOthers- additional images
- Returns:
- a new image representing the result of the division.
 
- 
maxPixelwise maximum of the input images. The input images are unchanged.- Parameters:
- ip- the first image
- ipOthers- additional images
- Returns:
- a new image representing the result of the max operation.
 
- 
minPixelwise minimum of the input images. The input images are unchanged.- Parameters:
- ip- the first image
- ipOthers- additional images
- Returns:
- a new image representing the result of the min operation.
 
 
-