Class BinaryConfigurationsHistogram2D

java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.measure.region2d.BinaryConfigurationsHistogram2D
All Implemented Interfaces:
Algo

public class BinaryConfigurationsHistogram2D
extends AlgoStub
Computes histogram of binary configurations composed of 2-by-2 pixels (planar images). Implements the Algo interface, so the progress can be tracked.
Author:
dlegland
  • Constructor Summary

    Constructors
    Constructor Description
    BinaryConfigurationsHistogram2D()
    Default empty constructor.
  • Method Summary

    Modifier and Type Method Description
    static double[] applyLut​(int[][] histograms, double[] lut)
    Applies look-up-table of values for each configuration for each label, based on the 16-array of count for each binary configuration.
    static int[] applyLut​(int[][] histograms, int[] lut)
    Applies look-up-table of values for each configuration for each label, based on the 16-array of count for each binary configuration.
    static double applyLut​(int[] histogram, double[] lut)
    Applies look-up-table of values for each configuration, based on the array of count for each binary configuration.
    static int applyLut​(int[] histogram, int[] lut)
    Applies look-up-table of values for each configuration, based on the array of count for each binary configuration.
    int[] process​(ij.process.ImageProcessor binaryImage)
    Computes the histogram of binary configurations for the region within the input binary image.
    int[][] process​(ij.process.ImageProcessor labelImage, int[] labels)
    Computes the histogram of binary configurations for each region of the input label image.
    int[] processInnerFrame​(ij.process.ImageProcessor binaryImage)
    Applies a look-up-table for each of the 2x2 pixel configurations with all pixels within the input binary image, and returns the sum of contributions for each label.

    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

    • BinaryConfigurationsHistogram2D

      public BinaryConfigurationsHistogram2D()
      Default empty constructor.
  • Method Details

    • applyLut

      public static final double applyLut​(int[] histogram, double[] lut)
      Applies look-up-table of values for each configuration, based on the array of count for each binary configuration.
      Parameters:
      histogram - the count of each type of 2-by-2 binary configurations, as an array
      lut - the value to associate to each configuration
      Returns:
      the sum of the products of counts by the associated value
    • applyLut

      public static final int applyLut​(int[] histogram, int[] lut)
      Applies look-up-table of values for each configuration, based on the array of count for each binary configuration.
      Parameters:
      histogram - the count of each type of 2-by-2 binary configurations, as an array
      lut - the value to associate to each configuration
      Returns:
      the sum of the products of counts by the associated value
    • applyLut

      public static final double[] applyLut​(int[][] histograms, double[] lut)
      Applies look-up-table of values for each configuration for each label, based on the 16-array of count for each binary configuration.
      Parameters:
      histograms - the count of each type of 2-by-2 binary configuration of each label, as a nLabels-by-16 array
      lut - the value to associate to each configuration
      Returns:
      the sum of the products of counts by the associated value for each label
    • applyLut

      public static final int[] applyLut​(int[][] histograms, int[] lut)
      Applies look-up-table of values for each configuration for each label, based on the 16-array of count for each binary configuration.
      Parameters:
      histograms - the count of each type of 2-by-2 binary configuration of each label, as a nLabels-by-16 array
      lut - the value to associate to each configuration
      Returns:
      the sum of the products of counts by the associated value for each label
    • process

      public int[] process​(ij.process.ImageProcessor binaryImage)
      Computes the histogram of binary configurations for the region within the input binary image. Takes into account the border of the image: histogram considers all the 2-by-2 configurations that contain at least one pixel of the image.
      Parameters:
      binaryImage - the input image containing the region the analyze
      Returns:
      an array of integers containing the 16-elements histogram of binary configurations
      See Also:
      processInnerFrame(ImageProcessor)
    • processInnerFrame

      public int[] processInnerFrame​(ij.process.ImageProcessor binaryImage)
      Applies a look-up-table for each of the 2x2 pixel configurations with all pixels within the input binary image, and returns the sum of contributions for each label. This method is used for computing densities of Euler number, perimeter and area from binary images.
      Parameters:
      binaryImage - the input 2D binary image
      Returns:
      an array of 16 integers containing the number of each binary configurations
      See Also:
      process(ImageProcessor)
    • process

      public int[][] process​(ij.process.ImageProcessor labelImage, int[] labels)
      Computes the histogram of binary configurations for each region of the input label image. Takes into account the border of the image: histograms consider all the 2-by-2 configurations that contain at least one pixel of the image.
      Parameters:
      labelImage - the input image containing region labels
      labels - the list of region labels
      Returns:
      an array of integer containing for each region, the 16-elements histogram of binary configurations