Class EulerCorrection<B extends BooleanType<B>>

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

    public class EulerCorrection<B extends BooleanType<B>>
    extends Object
    implements Computers.Arity1<RandomAccessibleInterval<B>,​DoubleType>
    An Op which calculates the correction needed to approximate the contribution of the image to the Euler characteristic χ of the whole image. That is, it's assumed that the image is a small part cut from a larger sample.

    From Odgaard & Gundersen (see below): "-- the Euler characteristic of the entire 3-D space will not be obtained by simply adding the Euler characteristics of cubic specimens. By doing this, the contribution of the lower dimensional elements will not be considered". They give the correction as c = -1/2χ_2 - 1/4χ_1 - -1/8χ_0, where

    • χ_2 = χ of all the faces of the stack
    • χ_1 = χ of all the edges of the stack
    • χ_0 = χ of all the corner vertices of the stack.
    Each face contributes to two, each edge to four, and each corner to eight stacks.

    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:
    Michael Doube (Royal Veterinary College, London), Richard Domander (Royal Veterinary College, London) NB: Methods are public and static to help testing
    Implementation Note:
    op names='topology.eulerCorrection'
    • Constructor Detail

      • EulerCorrection

        public EulerCorrection()
    • Method Detail

      • stackCorners

        public static <B extends BooleanType<B>> int stackCorners​(EulerCorrection.Traverser<B> traverser)
        Counts the foreground voxels in stack corners

        Calculates χ_0 from Odgaard and Gundersen

      • stackEdges

        public static <B extends BooleanType<B>> long stackEdges​(EulerCorrection.Traverser<B> traverser)
        Count the foreground voxels on the edges lining the stack

        Contributes to χ_1 from Odgaard and Gundersen

      • stackFaces

        public static <B extends BooleanType<B>> int stackFaces​(EulerCorrection.Traverser<B> traverser)
        Count the foreground voxels on the faces that line the stack

        Contributes to χ_2 from Odgaard and Gundersen

      • voxelEdgeIntersections

        public static <B extends BooleanType<B>> long voxelEdgeIntersections​(EulerCorrection.Traverser<B> traverser)
        Count the number of intersections between voxels in each 2x1 neighborhood and the the edges of the stack

        Contributes to χ_1 from Odgaard and Gundersen

      • voxelEdgeFaceIntersections

        public static <B extends BooleanType<B>> long voxelEdgeFaceIntersections​(EulerCorrection.Traverser<B> traverser)
        Count the intersections between voxel edges in each 2x2 neighborhood and the faces lining the stack

        Contributes to χ_2 from Odgaard and Gundersen

      • voxelFaceIntersections

        public static <B extends BooleanType<B>> long voxelFaceIntersections​(EulerCorrection.Traverser<B> traverser)
        Count the intersections between voxels in each 2x2 neighborhood and the faces lining the stack

        Contributes to χ_2 from Odgaard and Gundersen