Class Centroid3D

java.lang.Object
All Implemented Interfaces:
Algo, AlgoListener, RegionAnalyzer<Point3D>

public class Centroid3D
extends RegionAnalyzer3D<Point3D>
Computes centroid position of regions within 3D binary or label images.
Author:
dlegland
  • Constructor Summary

    Constructors
    Constructor Description
    Centroid3D()
    Default constructor
  • Method Summary

    Modifier and Type Method Description
    Point3D[] analyzeRegions​(ij.ImageStack image, int[] labels, ij.measure.Calibration calib)
    Computes centroid of each region in input label image.
    static double[][] centroids​(ij.ImageStack labelImage, int[] labels)
    Computes centroid of each label in input image and returns the result as an array of double for each label.
    static Point3D[] centroids​(ij.ImageStack labelImage, int[] labels, ij.measure.Calibration calib)
    Compute centroid of each region in input 3D label image and returns the result as an array of Point3D.
    ij.measure.ResultsTable createTable​(java.util.Map<java.lang.Integer,​Point3D> map)
    Utility method that transforms the mapping between labels and Point3D instances into a ResultsTable that can be displayed with ImageJ.

    Methods inherited from class inra.ijpb.measure.region3d.RegionAnalyzer3D

    algoProgressChanged, algoStatusChanged, analyzeRegions, analyzeRegions, computeTable, createMap

    Methods inherited from class inra.ijpb.algo.AlgoStub

    addAlgoListener, removeAlgoListener

    Methods inherited from class java.lang.Object

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

    • Centroid3D

      public Centroid3D()
      Default constructor
  • Method Details

    • centroids

      public static final Point3D[] centroids​(ij.ImageStack labelImage, int[] labels, ij.measure.Calibration calib)
      Compute centroid of each region in input 3D label image and returns the result as an array of Point3D.
      Parameters:
      labelImage - the input image containing region labels
      labels - the array of unique labels in image
      calib - the calibration of the image
      Returns:
      an array of Point3D instances, corresponding to the centroid of each region
    • centroids

      public static final double[][] centroids​(ij.ImageStack labelImage, int[] labels)
      Computes centroid of each label in input image and returns the result as an array of double for each label. This version does not take into account the spatial calibration, and returns the centroids in pixel coordinates.
      Parameters:
      labelImage - the input image containing label of particles
      labels - the array of unique labels in image the number of directions to process, either 2 or 4
      Returns:
      an array containing for each label, the coordinates of the centroid, in pixel coordinates
    • createTable

      public ij.measure.ResultsTable createTable​(java.util.Map<java.lang.Integer,​Point3D> map)
      Utility method that transforms the mapping between labels and Point3D instances into a ResultsTable that can be displayed with ImageJ.
      Parameters:
      map - the mapping between labels and Point3Ds
      Returns:
      a ResultsTable that can be displayed with ImageJ.
    • analyzeRegions

      public Point3D[] analyzeRegions​(ij.ImageStack image, int[] labels, ij.measure.Calibration calib)
      Computes centroid of each region in input label image.
      Specified by:
      analyzeRegions in class RegionAnalyzer3D<Point3D>
      Parameters:
      image - the input image containing label of particles
      labels - the array of labels within the image
      calib - the calibration of the image
      Returns:
      an array of Point3D representing the calibrated centroid coordinates