Class Octant<B extends BooleanType<B>>


  • public class Octant<B extends BooleanType<B>>
    extends Object
    A convenience class for storing a 2x2x2 voxel neighborhood in an image
    Author:
    Richard Domander (Royal Veterinary College, London), Mark Hiner
    • Constructor Detail

      • Octant

        public Octant​(RandomAccessibleInterval<B> interval)
        Constructs a new 2x2x2 neighborhood

        NB: Copies reference

        Parameters:
        interval - Image space where the neighborhood is located
    • Method Detail

      • getNeighborCount

        public int getNeighborCount()
        Returns the number of foreground voxels in the neighborhood
      • isNeighborForeground

        public boolean isNeighborForeground​(int n)
        Check if the nth neighbor in the 8-neighborhood is foreground
        Parameters:
        n - number of neighbor, 1 <= n <= 8
      • isNeighborhoodEmpty

        public boolean isNeighborhoodEmpty()
        True if none of the elements in the neighborhood are foreground (true)
      • setNeighborhood

        public void setNeighborhood​(long x,
                                    long y,
                                    long z)
        Set the starting coordinates of the neighborhood in the interval NB: All voxels outside the image bounds are considered 0