Package inra.ijpb.measure
Class IntrinsicVolumes3D
java.lang.Object
inra.ijpb.measure.IntrinsicVolumes3D
public class IntrinsicVolumes3D
extends java.lang.Object
Collection of static classes for the computation of intrinsic volumes
(volume, surface area, mean breadth and Euler number) for binary or label 3D
images.
Static methods provides computation of either the intrinsic volumes for
individual regions / labels, or the density of the intrinsic volumes for
porous media.
For binary images, a binary stack is expected, together with the spatial
calibration of the image. For label images, the list of region labels within
images should be specified as an array of integers.
- Author:
- dlegland
- See Also:
IntrinsicVolumes2D
,IntrinsicVolumesAnalyzer3D
-
Method Summary
Modifier and Type Method Description static double
eulerNumber(ij.ImageStack image, int conn)
Measures the Euler number of the region within the binary image, using the specified connectivity.static double
eulerNumberDensity(ij.ImageStack image, ij.measure.Calibration calib, int conn)
Measures the Euler number density of the foreground region within a binary image, using the specified connectivity.static double[]
eulerNumbers(ij.ImageStack image, int[] labels, int conn)
Measures the Euler number of each region given in the "labels" argument, using the specified connectivity.static double
interfaceSurfaceArea(ij.ImageStack image, int label1, int label2, ij.measure.Calibration calib, int nDirs)
Measures the surface area of the interface between two regions in a 3D label image.static double
meanBreadth(ij.ImageStack image, ij.measure.Calibration calib, int nDirs, int conn2d)
Measures the mean breadth of a single region within a 3D binary image.static double
meanBreadthDensity(ij.ImageStack image, ij.measure.Calibration calib, int nDirs, int conn2d)
Measures the mean breadth density of a single region within a 3D binary image.static double[]
meanBreadths(ij.ImageStack image, int[] labels, ij.measure.Calibration calib, int nDirs, int conn2d)
Measures the mean breadth of each region within a label image.static double
samplingVolume(ij.ImageStack image, ij.measure.Calibration calib)
Returns the "inner volume" of the 3D image, i.e. the calibrated volume of the image without taking into account the voxels at the border of the image.static double[]
sphericity(double[] volumes, double[] surfaces)
Helper function that computes the sphericity index of 3D particles, based on the value of volume and surface area.static double
sphericity(double volume, double surface)
Helper function that computes the sphericity index of 3D particles, based on the value of volume and surface area.static double
surfaceArea(ij.ImageStack image, ij.measure.Calibration calib, int nDirs)
Measures the surface area of a single region within a 3D binary image.static double
surfaceAreaDensity(ij.ImageStack image, ij.measure.Calibration calib, int nDirs)
Measures the surface area density of a single region within a 3D binary image.static double[]
surfaceAreas(ij.ImageStack image, int[] labels, ij.measure.Calibration calib, int nDirs)
Measures the surface area of each region within a label image.static double
volume(ij.ImageStack image, ij.measure.Calibration calib)
Measures the volume of a single region within a 3D binary image.static double
volumeDensity(ij.ImageStack image)
Measures the volume density of a single region within a 3D binary image.static double[]
volumes(ij.ImageStack labelImage, int[] labels, ij.measure.Calibration calib)
Measures the volume of each region within a 3D label image.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
volume
public static final double volume(ij.ImageStack image, ij.measure.Calibration calib)Measures the volume of a single region within a 3D binary image.- Parameters:
image
- the binary image containing the regioncalib
- the spatial calibration of the image- Returns:
- the volume of the region in the image
- See Also:
BinaryImages.countForegroundVoxels(ImageStack)
-
volumes
public static final double[] volumes(ij.ImageStack labelImage, int[] labels, ij.measure.Calibration calib)Measures the volume of each region within a 3D label image.- Parameters:
labelImage
- image containing the label of each regionlabels
- the set of labels for which volume has to be computedcalib
- the spatial calibration of the image- Returns:
- the volume of each region within the image
-
volumeDensity
public static final double volumeDensity(ij.ImageStack image)Measures the volume density of a single region within a 3D binary image.- Parameters:
image
- the binary image containing the region- Returns:
- the volume density of the region within the image
-
interfaceSurfaceArea
public static final double interfaceSurfaceArea(ij.ImageStack image, int label1, int label2, ij.measure.Calibration calib, int nDirs)Measures the surface area of the interface between two regions in a 3D label image.- Parameters:
image
- the 3D image containing the label of each particlelabel1
- the label of the first regionlabel2
- the label of the second regioncalib
- the spatial calibration of the imagenDirs
- the number of directions to consider, either 3 or 13- Returns:
- the surface area of each region within the image
- See Also:
InterfaceSurfaceArea
-
surfaceArea
public static final double surfaceArea(ij.ImageStack image, ij.measure.Calibration calib, int nDirs)Measures the surface area of a single region within a 3D binary image. Uses discretization of the Crofton formula, that consists in computing numbers of intersections with lines of various directions.- Parameters:
image
- image containing the label of each particlecalib
- the spatial calibration of the imagenDirs
- the number of directions to consider, either 3 or 13- Returns:
- the surface area of each region within the image
-
surfaceAreas
public static final double[] surfaceAreas(ij.ImageStack image, int[] labels, ij.measure.Calibration calib, int nDirs)Measures the surface area of each region within a label image. Uses discretization of the Crofton formula, that consists in computing numbers of intersections with lines of various directions.- Parameters:
image
- image containing the label of each particlelabels
- the set of labels in the imagecalib
- the spatial calibration of the imagenDirs
- the number of directions to consider, either 3 or 13- Returns:
- the surface area of each region within the image
-
surfaceAreaDensity
public static final double surfaceAreaDensity(ij.ImageStack image, ij.measure.Calibration calib, int nDirs)Measures the surface area density of a single region within a 3D binary image. Uses discretization of the Crofton formula, that consists in computing numbers of intersections with lines of various directions.- Parameters:
image
- image containing the label of each particlecalib
- the spatial calibration of the imagenDirs
- the number of directions to consider, either 3 or 13- Returns:
- the surface area density of the binary phase within the image
-
sphericity
public static final double sphericity(double volume, double surface)Helper function that computes the sphericity index of 3D particles, based on the value of volume and surface area. The sphericity is computed using the following formula:sphericity = 36 * PI * V^2 / S^3
A perfect ball would have a sphericity index close to 1, a very complex particle will present a lower sphericity index.- Parameters:
volume
- the volume of a regionsurface
- the surface area of a region- Returns:
- the sphericity index
- See Also:
surfaceAreas(ij.ImageStack, int[], ij.measure.Calibration, int)
,volumes(ij.ImageStack, int[], ij.measure.Calibration)
-
sphericity
public static final double[] sphericity(double[] volumes, double[] surfaces)Helper function that computes the sphericity index of 3D particles, based on the value of volume and surface area. The sphericity is computed using the following formula:sphericity = 36 * PI * V^2 / S^3
A perfect ball would have a sphericity index close to 1, a very complex particle will present a lower sphericity index.- Parameters:
volumes
- the volume of each particlesurfaces
- the surface area of each particle- Returns:
- the sphericity index of each particle
- See Also:
surfaceAreas(ij.ImageStack, int[], ij.measure.Calibration, int)
,volumes(ij.ImageStack, int[], ij.measure.Calibration)
-
meanBreadth
public static final double meanBreadth(ij.ImageStack image, ij.measure.Calibration calib, int nDirs, int conn2d)Measures the mean breadth of a single region within a 3D binary image. The mean breadth is proportional to the integral of mean curvature: mb = 2*pi*IMC.- Parameters:
image
- image containing the label of each particlecalib
- the spatial calibration of the imagenDirs
- the number of directions to consider, either 3 or 13conn2d
- the connectivity to use on planar sections with square tiles (either 4 or 8)- Returns:
- the mean breadth of the binary region within the image
-
meanBreadths
public static final double[] meanBreadths(ij.ImageStack image, int[] labels, ij.measure.Calibration calib, int nDirs, int conn2d)Measures the mean breadth of each region within a label image. The mean breadth is proportional to the integral of mean curvature: mb = 2*pi*IMC. Uses discretization of the Crofton formula, that consists in computing euler number of intersection with planes of various orientations.- Parameters:
image
- image containing the label of each regionlabels
- the set of labels in the imagecalib
- the spatial calibration of the imagenDirs
- the number of directions to consider, either 3 or 13conn2d
- the connectivity to use on planar sections with square tiles (either 4 or 8)- Returns:
- the mean breadth of each region within the image
-
meanBreadthDensity
public static final double meanBreadthDensity(ij.ImageStack image, ij.measure.Calibration calib, int nDirs, int conn2d)Measures the mean breadth density of a single region within a 3D binary image. Uses discretization of the Crofton formula, that consists in computing euler number of intersection with planes of various orientations.- Parameters:
image
- image containing a binary regioncalib
- the spatial calibration of the imagenDirs
- the number of directions to consider, either 3 or 13conn2d
- the connectivity to use on planar sections with square tiles (either 4 or 8)- Returns:
- the surface area density of the binary phase within the image
-
eulerNumber
public static final double eulerNumber(ij.ImageStack image, int conn)Measures the Euler number of the region within the binary image, using the specified connectivity.- Parameters:
image
- the input 3D binary imageconn
- the connectivity to use (either 6 or 26)- Returns:
- the Euler number of the region within the binary image
-
eulerNumbers
public static final double[] eulerNumbers(ij.ImageStack image, int[] labels, int conn)Measures the Euler number of each region given in the "labels" argument, using the specified connectivity.- Parameters:
image
- the input 3D label image (with labels having integer values)labels
- the set of unique labels in imageconn
- the connectivity to use (either 6 or 26)- Returns:
- the Euler number of each region within the image
-
eulerNumberDensity
public static final double eulerNumberDensity(ij.ImageStack image, ij.measure.Calibration calib, int conn)Measures the Euler number density of the foreground region within a binary image, using the specified connectivity.- Parameters:
image
- the input 3D binary imagecalib
- the spatial calibration of the imageconn
- the connectivity to use (either 6 or 26)- Returns:
- the Euler number density within the binary image
-
samplingVolume
public static final double samplingVolume(ij.ImageStack image, ij.measure.Calibration calib)Returns the "inner volume" of the 3D image, i.e. the calibrated volume of the image without taking into account the voxels at the border of the image.- Parameters:
image
- the input 3D imagecalib
- the spatial calibration of the image- Returns:
- the calibrated volume of the portion of image witout border voxels
-