Class SoVRRasterStackReader

  • All Implemented Interfaces:
    SafeDisposable

    public class SoVRRasterStackReader
    extends SoVolumeReader
    Raster stack reader. Reader for a volume defined by a "stack" of images.

    A raster stack is a list of raster images (that is, containing pixels, not vector graphics) of the same size so as to create a voxel volume. This reader uses a descriptive file (.lst) including a header and a list of all the raster image filenames. The file is structured as follows:

     Parameters {
       Raw 0
       Dims 2048 2048 100
       Size 10.000000 10.000000 10.000000 1250.000000 1250.000000 500.000000
       Channel 2
     }
    
     C:/tmp/tiff/img00000.tiff
     C:/tmp/tiff/img00001.tiff
     C:/tmp/tiff/img00002.tiff
     C:/tmp/tiff/img00003.tiff
     C:/tmp/tiff/img00004.tiff
     ....
    
    OR
     Parameters {
       Raw 1
       Endianess 1
       HeaderLength 256
       PrimType 0
       Binary 0
       Dims 1024 1024 300
       Size 50.000000 50.000000 50.000000 1050.000000 1050.000000 250.000000
       Channel 1
     }
    
     img00000.raw
     img00001.raw
     img00002.raw
     img00003.raw
     img00004.raw
     ....
    
    Header Description

    • Raw: 0 (formatted data file), 1 (raw data file).
    • Endianess: 0 (little endian), 1 (big endian) (for raw data only).
    • HeaderLength: length of header in characters/bytes (for raw data only).
    • PrimType: See SoDataSet.DataType (for raw data only).
    • Binary: 0 (ASCII), 1 (binary) (for raw data only).
    • Dims: height, width, depth in pixels of the stack.
    • Size: Xmin Ymin Zmin Xmax Ymax Zmax, bounding box of the data set.
    • Channel: See SoVRRasterStackReader.ChannelSelection.

    Images in the list can be of different formats (uses all files formats supported by Open Inventor). VolumeViz can load image data in most common image formats including BMP, DDS, GIF, JPEG, JPEG2000, PNG and TIFF.

    If images are different sizes, RD_UNSUPPORTED_DATA_TYPE_ERROR is returned by getDataChar.

    The file path can be relative or absolute.

    It is mandatory to have a line break after each property and/or filename otherwise VolumeViz could be unable to read the file properly.

    • Constructor Detail

      • SoVRRasterStackReader

        public SoVRRasterStackReader()
        Constructor.
    • Method Detail

      • setSize

        public void setSize​(SbBox3f size)
        Defines the bounding box size in physical units of the data set.
      • setDirectory

        public boolean setDirectory​(java.lang.String directory)
        Specify a directory containing image files to load (jpg, png, tif,...). Each image file in this folder with the exact same dimension and the exact same number of components will be loaded.

        Notes:

        • The directory should contain only valid image files.
        • The file format is automatically detected.
        • If the images are RGB or RGBA, the volume is loaded as RGBA data. (It is not possible to load a single component using this method.)

        Parameters:
        directory - The directory from which to load files.

        Returns:
        true if successful.

        Since:
        Open Inventor 9.5.0