Click or drag to resize
SoVRLdmFileWriter Class

Write data to disk in LDM format.

Inheritance Hierarchy

Namespace: OIV.LDM.Writers
Assembly: OIV.LDM (in OIV.LDM.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public class SoVRLdmFileWriter : SoVolumeWriter

The SoVRLdmFileWriter type exposes the following members.

Constructors
  NameDescription
Public methodSoVRLdmFileWriter

Constructor.

Top
Methods
  NameDescription
Public methodCloseAllHandles

Close all opened files (ldm, data and completion file) so that someone else can access them for reading or writing.

(Overrides SoVolumeWriterCloseAllHandles.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodFinish

Finalize creation of files.

(Overrides SoVolumeWriterFinish.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodInitialize

Initialize writer from current parameters.

(Overrides SoVolumeWriterInitialize.)
Public methodIsDataConverted

Return true, as ldm format is organized in tiles.

(Overrides SoVolumeWriterIsDataConverted.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodRestoreAllHandles

Re-open ldm, data and completion file that was closed by the OIV.LDM.Writers.SoVRLdmFileWriter.CloseAllHandles() method.

(Overrides SoVolumeWriterRestoreAllHandles.)
Public methodSet

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.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoBase.)
Public methodWriteSubSlice

Writes the data contained in the specified subslice.

(Inherited from SoVolumeWriter.)
Public methodWriteTile

Given a tileID, writes a tile if the data is organized in tiles (see OIV.LDM.SoLDMTileID).

(Overrides SoVolumeWriterWriteTile(SoLDMTileID, SoBufferObject).)
Top
Properties
  NameDescription
Public propertybitSetThreashold

Set the bitset threshold value.

Public propertycompressionLevel

Set compression level.

Public propertycompressionName

Compression name.

Public propertycoordinatesX

Rectilinear coordinates along X.

Public propertycoordinatesY

Rectilinear coordinates along Y.

Public propertycoordinatesZ

Rectilinear coordinates along Z.

Public propertycoordinateType

.

Public propertycrcCheck

Set CRC32 check on compression.

Public propertydataFilename

Data Filename.

Public propertydataType

Type of input data (that will be given in the writeXXX method) .

(Inherited from SoVolumeWriter.)
Public propertydefaultValue

Set the default value.

Public propertydimension

Dimension of dataset, in voxels.

(Inherited from SoVolumeWriter.)
Public propertydoMultiResolution

Auto compute sub-resolution tiles when finish writing.

Public propertyenableHistogram

Specify if the histogram must be computed or not.

Public propertyenableTileMinMax

Specify if tile min/max should be computed even if OIV.LDM.Writers.SoVRLdmFileWriter.enableHistogram is false.

Public propertyextent

Extent of dataset.

(Inherited from SoVolumeWriter.)
Public propertyheaderFilename

Header Filename.

Public propertyheaderOnly

Generate only header file.

Public propertyinputDataRange

Range of input datas ((min, max) of data).

Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertyisRGBA

true if RGBA mode (output will be unsigned int32 RGBA values).

Public propertylowResAlgorithm

Specifies the algorithm used to build low resolution tiles.

Public propertyoriginalFilename

Filename of original file.

Public propertysaveAsBitSet

Save the data as a bitSet (8 values per byte).

Public propertytileDimension

Tile dimension.

Public propertyundefinedValue

Set the undefined value.

Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Public propertyverbose

verbose.

Public propertywordFormat

Endianess of data.

(Inherited from SoVolumeWriter.)
Top
Remarks

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.

EXAMPLE

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();

See Also