Class GeometricMeasures3D

java.lang.Object
inra.ijpb.measure.GeometricMeasures3D

@Deprecated
public class GeometricMeasures3D
extends java.lang.Object
Deprecated.
use IntrinsicVolumes3D instead
Provides a set of static methods to compute geometric measures in 3D binary or label images. Ideally, each parameter should provide two methods to measure it:
  • a method with two (or more) input parameters: the label image and the resolution, and which returns a ResultsTable
  • a method with three (or more) input parameters: the label image, the list of labels to consider, and the resolution, and which returns an array of double, with as many elements as the number of labels

Example of code:

 
  ImageStack labelImage = ...
  int[] labels = LabelImages.findAllLabels(image);
  double[] resol = new double[]{1, 1, 1};
  double[][] ellipsoids = GeometricMeasures3D.inertiaEllipsoid(labelImage,
  	labels, resol);
  double[][] elongations = GeometricMeasures3D.computeEllipsoidElongations(ellipsoids);
 
 
Author:
David Legland
  • Method Summary

    Modifier and Type Method Description
    static ij.measure.ResultsTable boundingBox​(ij.ImageStack labelImage)
    Deprecated.
    use BoundingBox3D instead
    static double[][] boundingBox​(ij.ImageStack labelImage, int[] labels)
    Deprecated.
    Computes bounding box of each label in input stack and returns the result as an array of double for each label.
    static double[][] centroids​(ij.ImageStack labelImage, int[] labels)
    static double[][] computeEllipsoidElongations​(double[][] ellipsoids)
    Deprecated.
    static double[] computeSphericity​(double[] volumes, double[] surfaces)
    Deprecated.
    use IntrinsicVolumes3D instead
    static double[] eulerNumber​(ij.ImageStack image, int[] labels, int conn)
    static ij.measure.ResultsTable inertiaEllipsoid​(ij.ImageStack image)
    Deprecated.
    use InertiaEllipsoid instead
    static ij.measure.ResultsTable inertiaEllipsoid​(ij.ImageStack image, double[] resol)
    Deprecated.
    use InertiaEllipsoid instead
    static double[][] inertiaEllipsoid​(ij.ImageStack image, int[] labels, double[] resol)
    Deprecated.
    use InertiaEllipsoid instead
    static ij.measure.ResultsTable maximumInscribedSphere​(ij.ImageStack labelImage, double[] resol)
    Deprecated.
    use LargestInscribedBall instead
    static double[][] maximumInscribedSphere​(ij.ImageStack labelImage, int[] labels, double[] resol)
    Deprecated.
    Radius of maximum inscribed sphere of each particle within a label image.
    static ij.measure.ResultsTable surfaceArea​(ij.ImageStack labelImage, double[] resol, int nDirs)
    Deprecated.
    Computes the surface area of each label in the 3D image, using the specified resolution, and the given number of directions.
    static double[] surfaceAreaCrofton​(ij.ImageStack image, int[] labels, double[] resol, int nDirs)
    Deprecated.
    use IntrinsicVolumes3D instead
    static double surfaceAreaCrofton​(ij.ImageStack image, int label, double[] resol, int nDirs)
    Deprecated.
    use IntrinsicVolumes3D instead
    static double surfaceAreaCroftonD3​(ij.ImageStack image, double[] resol)
    Deprecated.
    use IntrinsicVolumes3D instead
    static ij.measure.ResultsTable volume​(ij.ImageStack labelImage, double[] resol)
    Deprecated.
    used IntrinsicVolumes3D instead
    static double[] volume​(ij.ImageStack labelImage, int[] labels, double[] resol)
    Deprecated.
    use IntrinsicVolumes3D instead

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • boundingBox

      @Deprecated public static final ij.measure.ResultsTable boundingBox​(ij.ImageStack labelImage)
      Deprecated.
      use BoundingBox3D instead
      Computes bounding box of each label in input stack and returns the result as a ResultsTable.
      Parameters:
      labelImage - a 3D image containing label of particles or regions
      Returns:
      a new ResultsTable containing for each label, the extent of the corresponding region
    • boundingBox

      public static final double[][] boundingBox​(ij.ImageStack labelImage, int[] labels)
      Deprecated.
      Computes bounding box of each label in input stack and returns the result as an array of double for each label.
      Parameters:
      labelImage - a 3D image containing label of particles or regions
      labels - the set of labels present in image
      Returns:
      a new array of doubles containing for each label, the extent of the corresponding region
    • volume

      @Deprecated public static final ij.measure.ResultsTable volume​(ij.ImageStack labelImage, double[] resol)
      Deprecated.
      used IntrinsicVolumes3D instead
      Measures the volume of each particle in a 3D label image.
      Parameters:
      labelImage - image containing the label of each particle
      resol - image resolution, as a double array with 3 elements
      Returns:
      the volume of each particle in the image
    • volume

      @Deprecated public static final double[] volume​(ij.ImageStack labelImage, int[] labels, double[] resol)
      Deprecated.
      use IntrinsicVolumes3D instead
      Measures the volume of each particle in the 3D label image.
      Parameters:
      labelImage - image containing the label of each particle
      labels - the set of labels for which volume has to be computed
      resol - image resolution, as a double array with 3 elements
      Returns:
      the volume of each particle in the image
    • computeSphericity

      @Deprecated public static final double[] computeSphericity​(double[] volumes, double[] surfaces)
      Deprecated.
      use IntrinsicVolumes3D instead
      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 particle
      surfaces - the surface area of each particle
      Returns:
      the sphericity index of each particle
      See Also:
      surfaceArea(ImageStack, double[], int), volume(ImageStack, int[], double[])
    • surfaceArea

      public static final ij.measure.ResultsTable surfaceArea​(ij.ImageStack labelImage, double[] resol, int nDirs)
      Deprecated.
      Computes the surface area of each label in the 3D image, using the specified resolution, and the given number of directions. Current algorithms pre-computes a LUT, then iterate on 2-by-2-by-2 configurations of voxels, and identifies the labels whose surface area measure need to be updated. For 3 directions, the surfaceAreaD3 function is an alternative that does not uses LUT.
      Parameters:
      labelImage - image containing the label of each particle
      resol - image resolution, as a double array with 3 elements
      nDirs - the number of directions to consider, either 3 or 13
      Returns:
      the surface area of each particle in the image
    • surfaceAreaCrofton

      @Deprecated public static final double[] surfaceAreaCrofton​(ij.ImageStack image, int[] labels, double[] resol, int nDirs)
      Deprecated.
      use IntrinsicVolumes3D instead
      Computes surface area for each label given in the "labels" argument.
      Parameters:
      image - image containing the label of each particle
      labels - the set of labels in the image
      resol - image resolution, as a double array with 3 elements
      nDirs - the number of directions to consider, either 3 or 13
      Returns:
      the surface area of each particle in the image
    • surfaceAreaCrofton

      @Deprecated public static final double surfaceAreaCrofton​(ij.ImageStack image, int label, double[] resol, int nDirs)
      Deprecated.
      use IntrinsicVolumes3D instead
      Computes surface area for a single label in the image, using discretization of the Crofton formula. This can be useful for binary images by using label 255.
      Parameters:
      image - the input 3D label image (with labels having integer values)
      label - the value of the label to measure
      resol - the resolution of the image, in each direction
      nDirs - the number of directions to consider for computing surface (3 or 13)
      Returns:
      the surface area measured for the given label
    • surfaceAreaCroftonD3

      @Deprecated public static final double surfaceAreaCroftonD3​(ij.ImageStack image, double[] resol)
      Deprecated.
      use IntrinsicVolumes3D instead
      Computes surface area of a binary image using 3 directions.
      Parameters:
      image - the input 3D label image (with labels having integer values)
      resol - the resolution of the image, in each direction
      Returns:
      the surface area measured for the binary image
    • eulerNumber

      @Deprecated public static final double[] eulerNumber​(ij.ImageStack image, int[] labels, int conn)
      Computes Euler number for each label 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 image
      conn - the connectivity to use (either 6 or 26)
      Returns:
      the Euler-Poincare characteristic of each region
      See Also:
      IntrinsicVolumes3D.eulerNumbers(ImageStack, int[], int)
    • centroids

      @Deprecated public static final double[][] centroids​(ij.ImageStack labelImage, int[] labels)
      Computes centroid of each label in input stack and returns the result as an array of double for each label.
      Parameters:
      labelImage - an instance of ImageStack containing region labels
      labels - the set of indices contained in the image
      Returns:
      the centroid of each region, as an array of double[3]
    • inertiaEllipsoid

      @Deprecated public static final ij.measure.ResultsTable inertiaEllipsoid​(ij.ImageStack image)
      Deprecated.
      use InertiaEllipsoid instead
      Computes inertia ellipsoid of each 3D region in input 3D label image.
      Parameters:
      image - an instance of ImageStack containing region labels
      Returns:
      the parameters of the inertia ellipsoid for each region
      Throws:
      java.lang.RuntimeException - if jama package is not found.
    • inertiaEllipsoid

      @Deprecated public static final ij.measure.ResultsTable inertiaEllipsoid​(ij.ImageStack image, double[] resol)
      Deprecated.
      use InertiaEllipsoid instead

      Computes inertia ellipsoid of each 3D region in input 3D label image.

      The result is given as a ResultsTable with as many rows as the number of labels, and 9 columns. Columns correspond to the centroid coordinates (3 values), the radius of the ellipsoid (3 values), and the orientation, given as azimut, elevation, and roll angles, in degrees (3 values).

      Parameters:
      image - an instance of ImageStack containing region labels
      resol - the resolution of the image, in each direction
      Returns:
      the parameters of the inertia ellipsoid for each region
      Throws:
      java.lang.RuntimeException - if jama package is not found.
    • inertiaEllipsoid

      @Deprecated public static final double[][] inertiaEllipsoid​(ij.ImageStack image, int[] labels, double[] resol)
      Deprecated.
      use InertiaEllipsoid instead

      Computes inertia ellipsoid from input 3D label image for each specified region label.

      The result is given as an array of double with as many rows as the number of labels, and 9 columns. Columns correspond to the centroid coordinates (3 values), the radius of the ellipsoid (3 values), and the orientation, given as azimut, elevation, and roll angles, in degrees (3 values).

      
       ImageStack labelImage = ...
       int[] labels = LabelImages.findAllLabels(image);
       double[] resol = new double[]{1, 1, 1};
       double[][] ellipsoids = GeometricMeasures3D.inertiaEllipsoid(labelImage,
                      labels, resol);
       double[][] elongations = GeometricMeasures3D.computeEllipsoidElongations(ellipsoids);
       
      Parameters:
      image - input image containing label of each particle
      labels - the list of labels for which we want to compute inertia ellipsoid
      resol - the spatial resolution, as an array of length 3.
      Returns:
      an array with as many rows as the number of labels, and 9 columns
      Throws:
      java.lang.RuntimeException - if jama package is not found.
    • computeEllipsoidElongations

      @Deprecated public static final double[][] computeEllipsoidElongations​(double[][] ellipsoids)
      Deprecated.
      Computes the three elongation factors for an array of ellipsoids.
      
       ImageStack labelImage = ...
       int[] labels = LabelImages.findAllLabels(image);
       double[] resol = new double[]{1, 1, 1};
       double[][] ellipsoids = GeometricMeasures3D.inertiaEllipsoid(labelImage,
                      labels, resol);
       double[][] elongations = GeometricMeasures3D.computeEllipsoidElongations(ellipsoids);
       
      Parameters:
      ellipsoids - an array of ellipsoids, with radius data given in columns 3, 4, and 5
      Returns:
      an array of elongation factors. When radii are ordered such that R1 > R2 > R3, the three elongation factors are defined by ratio of R1 by R2, ratio of R1 by R3, and ratio of R2 by R3.
      See Also:
      inertiaEllipsoid(ImageStack, double[]), inertiaEllipsoid(ImageStack, int[], double[])
    • maximumInscribedSphere

      @Deprecated public static final ij.measure.ResultsTable maximumInscribedSphere​(ij.ImageStack labelImage, double[] resol)
      Deprecated.
      use LargestInscribedBall instead
      Radius of maximum inscribed sphere of each particle within a label image.
      Parameters:
      labelImage - input image containing label of each particle
      resol - the spatial resolution, as an array of length 3.
      Returns:
      a ResultsTable with as many rows as the number of labels, and 4 columns (xi, yi, zi, radius)
    • maximumInscribedSphere

      public static final double[][] maximumInscribedSphere​(ij.ImageStack labelImage, int[] labels, double[] resol)
      Deprecated.
      Radius of maximum inscribed sphere of each particle within a label image.
      Parameters:
      labelImage - input image containing label of each particle
      labels - the list of labels for which we want to compute inertia ellipsoid
      resol - the spatial resolution, as an array of length 3.
      Returns:
      an array with as many rows as the number of labels, and 4 columns (xi, yi, zi, radius)