Class SbDiscreteLineProfile


  • public class SbDiscreteLineProfile
    extends Inventor
    Profile line extractor. Define a profile line extractor based on the Bresenham's Line algorithm.

    • Constructor Detail

      • SbDiscreteLineProfile

        public SbDiscreteLineProfile​(SbVec2i32 p1,
                                     SbVec2i32 p2,
                                     SoImageDataAdapter image)
        Constructor defining the profile line on the image.

        Parameters:
        p1 - begin point of the profile. Can be a 2d, 3d and 3d+t point.

        p2 - end point of the profile. Can be a 2d, 3d and 3d+t point.

        image - image to profile. Cannot be NULL. Throws an SbException if any p1 or p2 are out of image. Throws an SbException if image is NULL.
      • SbDiscreteLineProfile

        public SbDiscreteLineProfile​(SbVec3i32 p1,
                                     SbVec3i32 p2,
                                     SoImageDataAdapter image)
        Constructor defining the profile line on the image.

        Parameters:
        p1 - begin point of the profile. Can be a 2d, 3d and 3d+t point.

        p2 - end point of the profile. Can be a 2d, 3d and 3d+t point.

        image - image to profile. Cannot be NULL. Throws an SbException if any p1 or p2 are out of image. Throws an SbException if image is NULL.
      • SbDiscreteLineProfile

        public SbDiscreteLineProfile​(SbVec4i32 p1,
                                     SbVec4i32 p2,
                                     SoImageDataAdapter image)
        Constructor defining the profile line on the image.

        Parameters:
        p1 - begin point of the profile. Can be a 2d, 3d and 3d+t point.

        p2 - end point of the profile. Can be a 2d, 3d and 3d+t point.

        image - image to profile. Cannot be NULL. Throws an SbException if any p1 or p2 are out of image. Throws an SbException if image is NULL.
    • Method Detail

      • getValue

        public double getValue​(int index)
        Calls getValue(index, (int)0).
      • getValue

        public double getValue​(int index,
                               int component)
        Returns the value along the line at specified displacement relatively to first point.

        Parameters:
        index -

        component - choose the component of the voxel. Default is 0 which correspond to 1-component image. Range of index is between 0 and n-1 with n, the number of voxels in the segment (see getLength). Range of component is between 0 and c - 1 with c is the number of component of the image ( e.g c = 1 for grayscale, c = 3 for RGB, c = 4 for RGBA ). Throws an SbException if index is out of bounds.
      • getFirstPosition

        public SbVec4i32 getFirstPosition()
        Returns the first point.
      • getLength

        public long getLength()
        Returns the length of extracted data (i.e. the number of extracted voxels).
      • getPosition

        public SbVec4i32 getPosition​(int index)
        Returns the position along the line at specified displacement relatively to first point. Range of index is between 0 and n-1 with n, the number of voxels in the segment (see getLength), Throws an SbException if index is out of bounds.
      • getValueAt

        public double getValueAt​(int i)
      • getLastPosition

        public SbVec4i32 getLastPosition()
        Returns the last point.