SoVRLdmFileWriter Class |
Write data to disk in LDM format.
Namespace: OIV.LDM.Writers
The SoVRLdmFileWriter type exposes the following members.
Name | Description | |
---|---|---|
SoVRLdmFileWriter | Constructor. |
Name | Description | |
---|---|---|
CloseAllHandles | Close all opened files (ldm, data and completion file) so that someone else can access them for reading or writing. | |
CopyFieldValues(SoFieldContainer) | Calls CopyFieldValues(fc, false). (Inherited from SoFieldContainer.) | |
CopyFieldValues(SoFieldContainer, Boolean) | Copies the contents of fc's fields into this object's fields. | |
Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) | |
EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
FieldsAreEqual | Returns true if this object's fields are exactly equal to fc's fields. | |
Finish | Finalize creation of files. | |
Get | Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
GetAllFields | Returns a list of fields, including the eventIn's and eventOut's. | |
GetEventIn | Returns a the eventIn with the given name. | |
GetEventOut | Returns the eventOut with the given name. | |
GetField | Returns a the field of this object whose name is fieldName. | |
GetFieldName | Returns the name of the given field in the fieldName argument. | |
GetFields | Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetName | Returns the name of an instance. | |
GetStringName | (Inherited from SoBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HasDefaultValues | Returns true if all of the object's fields have their default values. | |
Initialize | Initialize writer from current parameters. | |
IsDataConverted | Return true, as ldm format is organized in tiles. | |
IsNotifyEnabled | Notification is the process of telling interested objects that this object has changed. | |
IsSynchronizable | Gets the ScaleViz synchronizable state of this object. | |
RestoreAllHandles | Re-open ldm, data and completion file that was closed by the OIV.LDM.Writers.SoVRLdmFileWriter.CloseAllHandles() method. | |
Set | Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
SetName | (Inherited from SoBase.) | |
SetSynchronizable | Sets this to be a ScaleViz synchronizable object. | |
SetToDefaults | Sets all fields in this object to their default values. | |
ToString |
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.) | |
Touch | Marks an instance as modified, simulating a change to it. | |
WriteSubSlice | Writes the data contained in the specified subslice. | |
WriteTile | Given a tileID, writes a tile if the data is organized in tiles (see OIV.LDM.SoLDMTileID). |
Name | Description | |
---|---|---|
bitSetThreashold | Set the bitset threshold value. | |
compressionLevel | Set compression level. | |
compressionName | Compression name. | |
coordinatesX | Rectilinear coordinates along X. | |
coordinatesY | Rectilinear coordinates along Y. | |
coordinatesZ | Rectilinear coordinates along Z. | |
coordinateType | . | |
crcCheck | Set CRC32 check on compression. | |
dataFilename | Data Filename. | |
dataType | Type of input data (that will be given in the writeXXX method) . | |
defaultValue | Set the default value. | |
dimension | Dimension of dataset, in voxels. | |
doMultiResolution | Auto compute sub-resolution tiles when finish writing. | |
enableHistogram | Specify if the histogram must be computed or not. | |
enableTileMinMax | Specify if tile min/max should be computed even if OIV.LDM.Writers.SoVRLdmFileWriter.enableHistogram is false. | |
extent | Extent of dataset. | |
headerFilename | Header Filename. | |
headerOnly | Generate only header file. | |
inputDataRange | Range of input datas ((min, max) of data). | |
IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) | |
isRGBA | true if RGBA mode (output will be unsigned int32 RGBA values). | |
lowResAlgorithm | Specifies the algorithm used to build low resolution tiles. | |
originalFilename | Filename of original file. | |
saveAsBitSet | Save the data as a bitSet (8 values per byte). | |
tileDimension | Tile dimension. | |
undefinedValue | Set the undefined value. | |
UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) | |
verbose | verbose. | |
wordFormat | Endianess of data. |
Creates an LDM file (in the VSG .ldm format) and allows the application to store data blocks in any order. The most common usage is to store blocks of full resolution data. This class can automatically generate the lower resolution (subsampled) tiles after the full resolution data has been stored (when the OIV.LDM.Writers.SoVRLdmFileWriter.Finish() method is called and OIV.LDM.Writers.SoVRLdmFileWriter.doMultiResolution is set to true). However the OIV.LDM.Writers.SoVRLdmFileWriter.WriteTile(OIV.LDM.SoLDMTileID, OIV.Inventor.Devices.SoBufferObject) 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 OIV.LDM.Writers.SoVRLdmFileWriter.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 OIV.LDM.Writers.SoVRLdmFileWriter.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 OIV.LDM.Writers.SoVRLdmFileWriter object and initialize it with the desired characteristics for the output volume. The OIV.LDM.Writers.SoVRLdmFileWriter.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 OIV.LDM.Writers.SoVRLdmFileWriter.WriteTile(OIV.LDM.SoLDMTileID, OIV.Inventor.Devices.SoBufferObject) methods.
The final step is to call the OIV.LDM.Writers.SoVRLdmFileWriter.Finish() method. This will optionally generate the lower resolution tiles (see OIV.LDM.Writers.SoVRLdmFileWriter.doMultiResolution), cleanup and close the LDM file.
SoVRLdmFileWriter writer = new SoVRLdmFileWriter(); writer.headerFilename.Value = "myFile.ldm"; writer.dimension.SetValue( 128, 128, 128 ); writer.extent.SetValue( -1,-1,-1, 1,1,1 ); writer.Initialize(); SoLDMTileID tileID = 0; SoCpuBufferObject tileBuffer = new SoCpuBufferObject(); writer.WriteTile( tileID, tileBuffer ); writer.Finish();