public class SoVRLdmFileWriter extends SoVolumeWriter
doMultiResolution
is set to true). However the writeTile() method also allows the application to directly store lower resolution tiles in case a proprietary subsampling algorithm is being used. The result will normally be a .ldm file (LDM header) and a .dat file (data).
It is not necessary, in all cases, to create the lower resolution tiles or even to create the complete set of full resolution tiles. This class supports partial writing feature. If some tiles are missing when the finish method is called, then in addition to the header and data files there will also be a .fcp file with the same name as the header and data files. The LDM header file will contain a reference to this file in the CompletionFilename tag. The .fcp file stores information about which tiles actually exist. Tiles that do not exist are considered to be filled with a constant default value (see defaultValue
). This feature allows us, for example, to compute and visualize a subset of the volume before committing to computation on the whole volume. However note that the writer currently pre-allocates disk space for the ".dat" file assuming that all tiles will exist. So skipping creation of the subsampled tiles or writing only a subset of the tiles can reduce computation time and disk I/O time, but it does not reduce the disk space requirement for the volume.
The first step is to create an SoVRLdmFileWriter
object and initialize it with the desired characteristics for the output volume. The initialize methods initialize the writer using its current parameters. It must not be modified once initialized.
The next step is to write data into the LDM file using the writeTile methods.
The final step is to call the finish method. This will optionally generate the lower resolution tiles (see doMultiResolution
), cleanup and close the LDM file.
SoVRLdmFileWriter writer = new SoVRLdmFileWriter(); // set parameters writer.headerFilename.setValue( "myFile.ldm" ); writer.dimension.setValue( 128, 128, 128 ); writer.extent.setValue( -1,-1,-1, 1,1,1 ); // Initialize writer.initialize(); // Write data SoLDMTileID tileID = new SoLDMTileID( 0 ); SoCpuBufferObject tileBuffer = new SoCpuBufferObject(); writer.writeTile( tileID, tileBuffer ); // Finalize writer.finish();
See also:
Modifier and Type | Class and Description |
---|---|
static class |
SoVRLdmFileWriter.CoordinateTypes
Coordinate type used by this data set.
|
SoVolumeWriter.WordFormats
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFDouble |
bitSetThreashold
Set the bitset threshold value.
|
SoSFInt32 |
compressionLevel
Set compression level.
|
SoSFString |
compressionName
Compression name.
|
static int |
COORDINATES_RECTILINEAR
Deprecated.
|
static int |
COORDINATES_UNIFORM
Deprecated.
|
SoMFFloat |
coordinatesX
Rectilinear coordinates along X.
|
SoMFFloat |
coordinatesY
Rectilinear coordinates along Y.
|
SoMFFloat |
coordinatesZ
Rectilinear coordinates along Z.
|
SoSFEnum<SoVRLdmFileWriter.CoordinateTypes> |
coordinateType
.
|
SoSFBool |
crcCheck
Set CRC32 check on compression.
|
SoSFString |
dataFilename
Data Filename.
|
SoSFDouble |
defaultValue
Set the default value.
|
SoSFBool |
doMultiResolution
Auto compute sub-resolution tiles when finish writing.
|
SoSFBool |
enableHistogram
Specify if the histogram must be computed or not.
|
SoSFBool |
enableTileMinMax
Specify if tile min/max should be computed even if
enableHistogram is false. |
SoSFString |
headerFilename
Header Filename.
|
SoSFBool |
headerOnly
Generate only header file.
|
SoSFVec2d |
inputDataRange
Range of input datas ((min, max) of data).
|
SoSFBool |
isRGBA
true if RGBA mode (output will be unsigned int32 RGBA values).
|
SoSFInt32 |
lowResAlgorithm
Specifies the algorithm used to build low resolution tiles.
|
SoSFString |
originalFilename
Filename of original file.
|
SoSFBool |
saveAsBitSet
Save the data as a bitSet (8 values per byte).
|
SoSFVec3i32 |
tileDimension
Tile dimension.
|
SoSFDouble |
undefinedValue
Set the undefined value.
|
SoSFBool |
verbose
verbose.
|
dataType, dimension, extent, WF_BIG_ENDIAN, WF_LITTLE_ENDIAN, wordFormat
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoVRLdmFileWriter()
Constructor.
|
closeAllHandles, finish, initialize, isDataConverted, restoreAllHandles, writeSubSlice, writeTile
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable, touch
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int COORDINATES_UNIFORM
SoVRLdmFileWriter.CoordinateTypes.COORDINATES_UNIFORM
instead.@Deprecated public static final int COORDINATES_RECTILINEAR
SoVRLdmFileWriter.CoordinateTypes.COORDINATES_RECTILINEAR
instead.public final SoSFString headerFilename
public final SoSFString dataFilename
public final SoSFString originalFilename
public final SoSFVec3i32 tileDimension
public final SoSFBool doMultiResolution
public final SoSFInt32 lowResAlgorithm
public final SoSFBool saveAsBitSet
bitSetThreashold
if you use this feature. Default is false.public final SoSFDouble bitSetThreashold
saveAsBitSet
is true.public final SoSFBool isRGBA
public final SoSFBool enableHistogram
Disabling histogram generation will greatly speedup the writing process, but some VolumeViz rendering features and optimizations won't be available.
Enabling the histogram enables computation of:
Note also that if RGBA mode is set then no histogram is computed.
public final SoSFBool enableTileMinMax
enableHistogram
is false.
Note that when enableHistogram to true, tile min/max is always computed. Default is false.public final SoSFDouble undefinedValue
SoHeightFieldRender
(vertices with undefined values are not rendered).public final SoSFDouble defaultValue
public final SoSFString compressionName
compressionLevel
field to adjust compression quality. If empty, no compression will be used. Default is empty.public final SoSFInt32 compressionLevel
compressionName
): -For gzip, it must be between 0 and 9: 0 gives no compression, 9 gives best compression but slower speed. Default is 3. -For jpeg, it must be between 0 and 100: 0 gives best compression but most loss of data, 100 gives minimum compression and minimum data alteration. Default is 85.
-1 use default value of specified compressor (3 for gzip, 85 for jpeg). Default is -1.
public final SoSFBool headerOnly
public final SoSFBool verbose
public final SoSFBool crcCheck
compressionName
), adds a data integrity check value to all compressed tiles. If the environment variable LDM_COMPRESS_CHECK_CRC32 is set, data values will be checked each time they are read from disk. Default is false.public final SoSFVec2d inputDataRange
public final SoSFEnum<SoVRLdmFileWriter.CoordinateTypes> coordinateType
public final SoMFFloat coordinatesX
public final SoMFFloat coordinatesY
public final SoMFFloat coordinatesZ
Generated on August 20, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com