Class EulerCharacteristic26N<B extends BooleanType<B>>

  • All Implemented Interfaces:
    BiConsumer<RandomAccessibleInterval<B>,​DoubleType>, Computers.Arity1<RandomAccessibleInterval<B>,​DoubleType>

    public class EulerCharacteristic26N<B extends BooleanType<B>>
    extends Object
    implements Computers.Arity1<RandomAccessibleInterval<B>,​DoubleType>
    An Op which calculates the Euler characteristic (χ) of the given 3D binary image.
    Here Euler characteristic is defined as χ = β_0 - β_1 + β_2, where β_i are so called Betti numbers
    • β_0 = number of separate particles
    • β_1 = number of handles
    • β_2 = number enclosed cavities

    The Op calculates χ by using the triangulation algorithm described by Toriwaki & Yonekura (see below).
    There it's calculated X = ∑Δχ(V), where V is a 2x2x2 neighborhood around each point in the 3D space.
    We are using the 26-neighborhood version of the algorithm. The Δχ(V) values here are predetermined.

    For the algorithm see
    Toriwaki J, Yonekura T (2002)
    Euler Number and Connectivity Indexes of a Three Dimensional Digital Picture
    Forma 17: 183-209
    http://www.scipress.org/journals/forma/abstract/1703/17030183.html

    For the Betti number definition of Euler characteristic see
    Odgaard A, Gundersen HJG (1993)
    Quantification of connectivity in cancellous bone, with special emphasis on 3-D reconstructions
    Bone 14: 173-182
    doi:10.1016/8756-3282(93)90245-6

    Author:
    Richard Domander (Royal Veterinary College, London), David Legland - original MatLab implementation
    Implementation Note:
    op names='topology.eulerCharacteristic26N'
    • Constructor Detail

      • EulerCharacteristic26N

        public EulerCharacteristic26N()
    • Method Detail

      • neighborhoodEulerIndex

        public static <B extends BooleanType<B>> int neighborhoodEulerIndex​(RandomAccess<B> access,
                                                                            long x,
                                                                            long y,
                                                                            long z)
        Determines the LUT index for this 2x2x2 neighborhood
        Parameters:
        access - The space where the neighborhood is
        x - Location of the neighborhood in the 1st spatial dimension (x)
        y - Location of the neighborhood in the 2nd spatial dimension (y)
        z - Location of the neighborhood in the 3rd spatial dimension (z)
        Returns:
        the index of the Δχ value for this configuration of voxels