java.lang.Object
org.bonej.utilities.ImagePlusUtil
Utility methods for checking ImagePlus properties
- Author:
- Richard Domander
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubleanisotropy(ij.ImagePlus image) Calculates the degree of spatial calibration anisotropy.static ij.ImagePluscleanDuplicate(ij.ImagePlus image) Duplicates the image without changing the title of the copy, or cropping it to the ROI.static booleanis3D(ij.ImagePlus image) Checks if the image is 3D.static booleanisBinaryColour(ij.ImagePlus image) Checks if the image has only two different colours.static booleanChecks if the ImageStack contains native arrays that can be accessed directly from the heap.
-
Method Details
-
anisotropy
Calculates the degree of spatial calibration anisotropy.Spatial calibration is anisotropic if pixel width, height and depth are not equal.
- Parameters:
image- an ImageJ1 styleImagePlus.- Returns:
- Percentage of anisotropy. An isotropic image returns 0.0
-
cleanDuplicate
Duplicates the image without changing the title of the copy, or cropping it to the ROI.Circumvents the default behaviour of
ImagePlus.duplicate().- Parameters:
image- an ImageJ1 style ImagePlus.- Returns:
- an unchanged copy of the image.
-
is3D
Checks if the image is 3D.- Parameters:
image- an ImageJ1 styleImagePlus.- Returns:
- true if the image has more than one slice.
-
isBinaryColour
Checks if the image has only two different colours.- Parameters:
image- an ImageJ1 styleImagePlus.- Returns:
- true if there are only two distinct pixel values present in the image, false if more.
-
isNativeStack
Checks if the ImageStack contains native arrays that can be accessed directly from the heap. Returns true if safe to access directly without duplication. Returns false if the stack uses wrappers, VirtualStacks, or other non-native representations.- Parameters:
imp- ImagePlus to check- Returns:
- true if safe to access imp directly without duplication or false if the stack uses wrappers, VirtualStacks, or other non-native representations, or if there was an exception.
-