java.lang.Object
org.bonej.utilities.RoiManagerUtil
A class containing utility methods for the ImageJ RoiManager
- Author:
- Michael Doube, Richard Domander
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisActiveOnAllSlices(int sliceNumber) Checks if a ROI is active on all slices.static List<org.joml.Vector3d> Gets the coordinates of all point ROIs in the manager.static booleanDetermine whether the ROI Manager is not active or has no entriesunionMaskFromRoiManager(net.imglib2.RandomAccessibleInterval<?> xyView, int z1, int t1, int c1) Build a 2D union mask (BitType) for the given XY view and (z,t,c) plane using ROIs from the (visible) IJ1 RoiManager.
-
Method Details
-
isActiveOnAllSlices
public static boolean isActiveOnAllSlices(int sliceNumber) Checks if a ROI is active on all slices.- Parameters:
sliceNumber- the slice number or z-position of the ROI.- Returns:
- true if the ROI is not associated with a particular slide.
-
pointROICoordinates
Gets the coordinates of all point ROIs in the manager.NB z-coordinates start from 1. If a ROI is not associated with a slice, it's z = 0.
- Parameters:
manager- an instance ofRoiManager.- Returns:
- point ROI coordinates.
-
roiManagerIsEmpty
public static boolean roiManagerIsEmpty()Determine whether the ROI Manager is not active or has no entries- Returns:
- true if there are no ROIs to process
-
unionMaskFromRoiManager
public static net.imglib2.RandomAccessibleInterval<net.imglib2.type.logic.BitType> unionMaskFromRoiManager(net.imglib2.RandomAccessibleInterval<?> xyView, int z1, int t1, int c1) Build a 2D union mask (BitType) for the given XY view and (z,t,c) plane using ROIs from the (visible) IJ1 RoiManager. The returned mask is aligned to the view's interval.- Parameters:
xyView- 2D view (may have non-zero min).z1- 1-based Z position (IJ1 convention)t1- 1-based T position (IJ1 convention)c1- 1-based C position (IJ1 convention)- Returns:
- a BitType mask that represents all the ROIs active on this XY slice or null if the ROI Manager is null or empty, or if there are no ROIs active on this XY slice.
-