Class SoVolumeConverter


  • public class SoVolumeConverter
    extends SoBaseLDMConverter
    Class for converting volume data sets into the LDM format.

    This class converts existing volume data sets into the LDM (Large Data Management) format.

    The LDM converter classes provide many powerful features. Information common to all converter classes is documented in SoConverter, including:

    • Command line parsing for easy creation of stand-alone converter programs.

    • Checkpoint and restart for interrupted conversions.

    • Multiple subsampling algorithms for creating low resolution tiles.

    • Automatic loading of any supported data format (see SoVolumeData).

    • Conversion of any data format by providing a custom reader (see SoVolumeReader).

    • Optional data compression to reduce disk space.

    • Optional data type conversion, e.g. float to byte.

    You can subclass from SoVolumeConverter to use a custom volume reader, provide a custom subsampling method, etc. A custom volume reader can be used to convert almost any data format into LDM format. To use a custom volume reader, derive a new class from SoVolumeReader and override the getReader() method. To use a custom subsampling method override the sampleTile method. See for example $OIVJHOME/examples/volumeviz/sample/genericConverter/withDefaultReader/Main.java.

    See Also:
    SoConverter, SoBaseLDMConverter, SoVolumeReader
    • Constructor Detail

      • SoVolumeConverter

        public SoVolumeConverter()
    • Method Detail

      • setReader

        public void setReader​(SoVolumeReader reader)
        Defines the reader that will be used to read the input file given to the convert method. If null is given or if this method is not called, a reader by default will be used according to the extension of the file.
      • sampleTile

        public void sampleTile​(SbVec3i32 tile_dim,
                               int data_type,
                               int border,
                               java.nio.ByteBuffer[] octant_tiles,
                               java.nio.ByteBuffer parent_tile)
        Method used to downsample a tile. The input are the eight higher resolution tiles used to create the one lower resolution tile (parent). By default, the converter simply takes one voxel out of two in the higher resolution tile to create the parent tile. This method can be overriden by a custom converter to use a different approach.

        Protected usage only.

        Parameters:
        tile_dim - is the size of the tile to create in number of voxels.
        data_type - is the type of the data (see SoVolumeData)
        border - takes a 0 or 1 value to let the user know whether border between tiles should be handled.
        octant_tiles - are the values of the 8 higher resolution tiles. Attention : octant_tiles[i] is null if the i-th octant is free of data (the data is an asymmetric volume).
        parent_tile - is the output buffer that must be filled when overriding this method
      • progress

        public boolean progress​(int numTilesGenerated,
                                int numTilesToGenerate)
        This method is called each time a tile of data is generated. If this method returns false, the task is stopped. By default it returns true.

        Protected usage only. This method can be overriden by a custom converter to abort the conversion conditionnaly and/or to update a progress bar.

        Parameters:
        numTilesGenerated - represents the number of tiles already generated
        numTilesToGenerate - is the total number of tiles to generate.
      • getXmlTags

        public java.lang.String getXmlTags()
        Gets a string containing some xml tags that will be inserted in the header of the converted file.

        Protected usage only. This method must be overriden by a custom converter to insert xml tags.

        Returns:
        String null by default