Click or drag to resize
SoVolumeData Class

Volume data property node.

Inheritance Hierarchy

Namespace: OIV.VolumeViz.Nodes
Assembly: OIV.VolumeViz (in OIV.VolumeViz.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public class SoVolumeData : SoDataSet

The SoVolumeData type exposes the following members.

Constructors
  NameDescription
Public methodSoVolumeData

Constructor.

Top
Methods
  NameDescription
Public methodAffectsState

Returns true if a node has an effect on the state during traversal.

(Inherited from SoNode.)
Public methodCallback
(Inherited from SoDataSet.)
Public methodCopy
Calls Copy(false).
(Inherited from SoNode.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
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 methodDistribute
(Inherited from SoNode.)
Public methodDoAction
Public methodEditBoxes

Replace all voxels in the region defined by a list of boxes with the specified value.

(Overrides SoDataSetEditBoxes(IListSbVec3i32, Int32, Double).)
Public methodEditSolidShape

Replaces all voxels intersecting the given shape with the specified value.

(Overrides SoDataSetEditSolidShape(SoNode, Double).)
Public methodEditSubVolume(SbBox3i32, SoBufferObject)

Replaces the contents of a subvolume with the given data.

(Overrides SoDataSetEditSubVolume(SbBox3i32, SoBufferObject).)
Public methodEditSubVolume(SbBox3i32, Double)

Replaces the contents of a subvolume with the specified value.

(Overrides SoDataSetEditSubVolume(SbBox3i32, Double).)
Public methodEditSurfaceShape

Replaces all voxels intersecting the polygons or lines defined by the surfaceShape and given thickness with the specified value.

(Overrides SoDataSetEditSurfaceShape(SoNode, Single, Double).)
Public methodEditTile(SoLDMTileID, SoBufferObject)

Replaces the contents of a tile with the given data.

(Overrides SoDataSetEditTile(SoLDMTileID, SoBufferObject).)
Public methodEditTile(SoLDMTileID, Double)

Replaces the contents of a tile with the specified value.

(Overrides SoDataSetEditTile(SoLDMTileID, Double).)
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 methodFinishEditing

Terminates an editing transaction.

(Overrides SoDataSetFinishEditing(Int32).)
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 methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBoundingBox
(Inherited from SoDataSet.)
Public methodGetCenterVolumeBox
Public methodGetCoordinateType
Public methodGetDataSize

Returns the number of bytes per voxel in VolumeViz.

(Inherited from SoDataSet.)
Public methodGetDataType

Returns the data type.

(Inherited from SoDataSet.)
Public methodGetDatumSize

Returns the number of bytes per voxel.

(Inherited from SoDataSet.)
Public methodGetDimension

Returns the data set dimension.

(Inherited from SoDataSet.)
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 methodGetHistogram
Returns the histogram of the volume data. Returns null reference if the requested data is not available.
Public methodGetLdmDataAccess

Returns a reference to the OIV.LDM.SoLDMDataAccess object.

(Inherited from SoDataSet.)
Public methodGetLDMReader

Returns a pointer to the current data set reader object.

(Inherited from SoDataSet.)
Public methodGetLDMTopoOctree

Returns the LDMTopoOctree used by this OIV.LDM.Nodes.SoDataSet.

(Inherited from SoDataSet.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodGetMinMax(Double, Double)

Returns min and max values of the data set.

(Overrides SoDataSetGetMinMax(Double, Double).)
Public methodGetMinMax(Int64, Int64)

Returns min and max values of the data set data.

(Overrides SoDataSetGetMinMax(Int64, Int64).)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetOverlapping Obsolete.
(Inherited from SoDataSet.)
Public methodGetPrimitiveCount
(Inherited from SoNode.)
Public methodGetReader Obsolete.

Returns the current data set reader object.

(Inherited from SoDataSet.)
Public methodGetRectilinearCoordinates

Returns a vector describing mapping from uniform space to rectilinear space.

Public methodGetRenderEngineMode

Returns the supported Render engine mode.

(Inherited from SoNode.)
Public methodGetRenderUnitID
Public methodGetSizeVolumeBox
Public methodGetStringName (Inherited from SoBase.)
Public methodGetTexMemorySize Obsolete.

Returns the maximum texture memory size to use in mega texels.

Public methodGetTileDimension

Returns the tile dimension.

(Inherited from SoDataSet.)
Public methodGetTileIDInMemory

Debug purpose only.

(Inherited from SoDataSet.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetVolumeBox
Public methodGLRender
Public methodGLRenderBelowPath
(Inherited from SoNode.)
Public methodGLRenderInPath
(Inherited from SoNode.)
Public methodGLRenderOffPath
(Inherited from SoNode.)
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoDataSet.)
Public methodHasDefaultValues

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

(Inherited from SoFieldContainer.)
Public methodHasEditedTile

Returns true if DataSet has edited tiles.

(Inherited from SoDataSet.)
Public methodIsBoundingBoxIgnoring

This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored.

(Inherited from SoNode.)
Public methodIsDataInMemory

Indicates whether the data attached to a tile is in main memory.

(Inherited from SoDataSet.)
Public methodIsInMemory

Indicates whether a tile is in main memory.

(Inherited from SoDataSet.)
Public methodIsNotifyEnabled

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

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override flag.

(Inherited from SoNode.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodNumSigBits

Returns the number of significant bits.

(Inherited from SoDataSet.)
Public methodPick
(Inherited from SoDataSet.)
Public methodRayPick
(Inherited from SoNode.)
Public methodReadTile(SoBufferObject, SoLDMTileID, Boolean)

Copies the specified tile into the provided buffer.

(Inherited from SoDataSet.)
Public methodReadTile(SoLDMTileID, SoBufferObject, Boolean)

Copies the specified tile into the provided buffer.

(Inherited from SoDataSet.)
Public methodReadTile(SoLDMTileID, Byte, Boolean) Obsolete.
(Inherited from SoDataSet.)
Public methodRedoEditing

Redo all modifications associated with the specified transaction id.

(Overrides SoDataSetRedoEditing(Int32).)
Public methodReSampling(SbVec3i32, SoVolumeDataSubMethods) Obsolete.
Calls ReSampling(dimension, subMethod, OIV.VolumeViz.Nodes.SoVolumeData.OverMethods( .SoVolumeData.NONE )).
Public methodReSampling(SbVec3i32, SoVolumeDataSubMethods, SoVolumeDataOverMethods) Obsolete.

Re-samples the volume down to or up to the given dimension using the sub-sampling method OIV.VolumeViz.Nodes.SoVolumeData.SubMethods and the over-sampling method OIV.VolumeViz.Nodes.SoVolumeData.OverMethods.

Public methodResetReader
(Inherited from SoDataSet.)
Public methodSaveEditing
Save modifications to a file.
(Inherited from SoDataSet.)
Public methodSaveEditing(Boolean)
Save modifications to a file.
(Inherited from SoDataSet.)
Public methodSaveEditing(Boolean, IListString)
Save modifications to a file.
(Inherited from SoDataSet.)
Public methodSearch
(Inherited from SoNode.)
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 methodSetLDMReader

Sets the LDM volume reader object to use.

(Inherited from SoDataSet.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Turns the override flag on or off.

(Inherited from SoNode.)
Public methodSetReader(SoVolumeReader) Obsolete.
Calls SetReader(reader, false).
(Inherited from SoDataSet.)
Public methodSetReader(SoVolumeReader, Boolean) Obsolete.

This method allows the data to be read directly from the disk using the specified subclass of OIV.LDM.Readers.SoVolumeReader.

(Inherited from SoDataSet.)
Public methodSetRGBAData

Force data to be considered as RGBA values.

Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetTexMemorySize Obsolete.

Specifies the maximum texture memory size to use in mega texels.

Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodStartEditing

Initiate an editing transaction.

(Overrides SoDataSetStartEditing(Int32).)
Public methodSubSetting Obsolete.

Extracts the data volume defined by region.

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 SoNode.)
Public methodUndoEditing

Undo all modifications associated with the specified transaction id.

(Overrides SoDataSetUndoEditing(Int32).)
Public methodUpdateRegions

Updates regions of the volume that have been modified.

Public methodUpdateTilesInTextureMemory

Reloads textures corresponding to the given tile IDs.

Public methodUseFakeData

Creates fake data in buffer.

(Overrides SoDataSetUseFakeData(SoLDMTileID, SoBufferObject).)
Public methodVoxelToXYZ(SbBox3f)

Converts the specified box in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z).

(Inherited from SoDataSet.)
Public methodVoxelToXYZ(SbVec3f)

Converts the specified point in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z).

(Inherited from SoDataSet.)
Public methodWrite
(Inherited from SoDataSet.)
Public methodWriteTile

Write the specified tile using the specified writer.

(Inherited from SoDataSet.)
Public methodXYZToVoxel(SbBox3f)

Converts the specified box in geometric coordinates to voxel coordinates.

(Inherited from SoDataSet.)
Public methodXYZToVoxel(SbVec3f)

Converts the specified point in geometric coordinates (X,Y,Z) to voxel coordinates (I,J,K).

(Inherited from SoDataSet.)
Top
Properties
  NameDescription
Public propertyallocateResourceOnRender

Indicates if resource allocation is done only on first render traversal or as soon as the node is created.

(Inherited from SoDataSet.)
Public propertydata

Specifies the volume data, including dimensions, data type and number of significant bits.

Public propertydataRGBA

Contains true if the volume contains RGBA values rather than scalar values.

Public propertydataSetId

When using multiple OIV.LDM.Nodes.SoDataSet nodes, the OIV.LDM.Nodes.SoDataSet.dataSetId field uniquely identifies each data set used in the compositing.

(Inherited from SoDataSet.)
Public propertydataTransform

If set to an appropriate OIV.LDM.Nodes.SoLDMDataTransform object, the object's transformFunction method is called after each tile is loaded, but before it is stored in main memory.

(Inherited from SoDataSet.)
Public propertyextent

The real size (extent) of the volume in modeling coordinates.

(Inherited from SoDataSet.)
Public propertyfileName

Indicates the file location containing the data set.

(Inherited from SoDataSet.)
Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertyLDMDataTransformCallback Obsolete.

If set, the user-defined function is called after each tile is loaded, but before it is stored in main memory.

(Inherited from SoDataSet.)
Public propertyldmResourceParameters

Contains an OIV.LDM.Nodes.SoLDMResourceParameters object which allows you to set LDM resource parameters.

(Inherited from SoDataSet.)
Public propertyReader

Returns the current data set reader object.

(Inherited from SoDataSet.)
Public propertytexturePrecision

For scalar (non-RGBA) data, specifies the size of voxel values on the GPU in bits.

(Inherited from SoDataSet.)
Public propertyundefinedValue

Data with this value won't be rendered.

(Inherited from SoDataSet.)
Public propertyuseCompressedTexture

Controls use of OpenGL lossy texture compression for RGBA data (if available).

(Inherited from SoDataSet.)
Public propertyuseExtendedData

If true, VolumeViz stores an additional copy of each loaded tile.

Public propertyusePalettedTexture

For a volume containing scalar data values, controls whether scalar values (true) or RGBA values (false) are loaded on the GPU (the name is historical).

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

Note: On graphics boards that support programmable shaders, this field is ignored (virtually all graphics boards support programmable shaders).

Top
Remarks

This class defines the data volume and its properties, and also provides utilities for extracting a subset of the volume and for resampling the volume. The data can be stored in memory, read from a file or accessed via a user-defined reader. This node provides the data for the volume rendering shape nodes (OIV.VolumeViz.Nodes.SoVolumeRender, OIV.VolumeViz.Nodes.SoOrthoSlice, OIV.VolumeViz.Nodes.SoObliqueSlice, etc.) and is the parent class for some specialized data nodes (OIV.VolumeViz.Nodes.SoHeightFieldGeometry, OIV.VolumeViz.Nodes.SoVolumeMask, etc.).

Note: Since the camera viewpoint is used to determine which part of the volume to load, the behavior of OIV.VolumeViz.Nodes.SoVolumeData is not correctly defined when no camera node has been traversed before the OIV.VolumeViz.Nodes.SoVolumeData. This can result in console warnings.

The data volume can be specified by:

  • Setting the fileName field This implies that the volume is stored on disk, in one of the file formats for which VolumeViz has a built-in reader. This is the most common way to load data. VolumeViz will automatically select a volume reader class based on the file extension, for example ".am" for the AmiraMesh file format. If the filename does not have an extension or does not have the appropriate extension, the application must specify a volume reader explicitly using OIV.LDM.Nodes.SoDataSet.SetReader(OIV.LDM.Readers.SoVolumeReader, System.Boolean). See the supported file formats below. Note that, unlike other nodes, OIV.VolumeViz.Nodes.SoVolumeData and its derived classes do not search the OIV.Inventor.SoInput directory list to find files.

Calling the OIV.LDM.Nodes.SoDataSet.SetReader(OIV.LDM.Readers.SoVolumeReader, System.Boolean) method This is the most general method because an application can specify an instance of one of the standard VolumeViz readers or an instance of a custom subclass of OIV.LDM.Readers.SoVolumeReader. You might use this method with a standard VolumeViz reader class if the data file's name has a non-standard extension. In other words, if VolumeViz will not be able to select the correct volume reader automatically, explicitly create an instance of the correct reader and pass it to the OIV.LDM.Nodes.SoDataSet.SetReader(OIV.LDM.Readers.SoVolumeReader, System.Boolean) method. VolumeViz will get the volume properties (dimensions, size, data type, etc) and access the volume data through the specified reader object. Creating an instance of a custom volume reader (see OIV.LDM.Readers.SoVolumeReader for more information) allows the application to completely control how, and from where, the data is loaded. For example the data could be accessed through an application specific API. Note: When using a custom reader, any reader method that changes the volume properties (dimension, size, data type, etc) should notify the OIV.VolumeViz.Nodes.SoVolumeData node by calling the reader's OIV.Inventor.Nodes.SoNode.Touch() method. If this notification is not done, OIV.VolumeViz.Nodes.SoVolumeData fields, for example extent, won't be updated correctly. Applications can use the () method to query the current volume reader, but should always verify the class type before using the returned object.

  • Setting the OIV.VolumeViz.Nodes.SoVolumeData.data field This implies that the entire volume has already been loaded into a contiguous block of CPU memory. We call this an "in-memory" volume. Volume reader: Note that when a file format reader or custom volume reader is currently being used, setting the data field will automatically replace the current volume reader. Subsequent calls to () will return an OIV.VolumeViz.Readers.SoVRMemoryReader. Tile size: Note that VolumeViz always manages volume data internally as "tiles" and the default tile size is small. Generally you wll get better performance by explicitly setting a larger tile size (see the ldmResourceParameters field and OIV.LDM.Nodes.SoLDMResourceParameters.tileDimension).

Volume Properties:

  • Dimensions The dimensions of the volume (number of voxels on each axis) are normally determined by the volume reader from information in ithe data file(s), the number of images in the stack, etc. (When you set the OIV.VolumeViz.Nodes.SoVolumeData.data field directly you specify the volume dimensions.) You can query the volume dimensions using the OIV.VolumeViz.Nodes.SoVolumeData.data field. For example:

    SbVec3i32 voldim = volumeData.data.GetSize();

  • Extent The geometric extent of the volume in 3D is initially determined by the volume reader but can also be set using the extent field. The volume extent is the bounding box of the volume in world coordinates. Often the volume extent in 3D is set equal to the dimensions of the volume or to values that are proportional to the volume dimensions. For example, -1 to 1 on the longest axis of the volume and proportional values for the other axes puts the origin (0,0,0) at the center of the volume, simplifying rotations. However the volume extent can be any range, for example the range of line numbers in a seismic survey. The volume extent indirectly specifies the voxel size/spacing. You can query the current volume extent using the extent field. For example:

    SbBox3f volext = volumeData.extent.Value;

    Notes:

    • Modify extent: The application can change the volume extent (but not the dimensions) at any time. This changes the bounding box of the volume and scales the volume visualization nodes (OIV.VolumeViz.Nodes.SoOrthoSlice, etc) associated with the volume. Changing the volume extent effectively changes the voxel size. This is commonly used, for example, to scale a seismic volume along the time axis.

    • Transform nodes: The volume extent and orientation (like geometry) can be modified by transformation nodes in the scene graph and this in turn modifies the appearance of volume visualization nodes (OIV.VolumeViz.Nodes.SoVolumeRender, OIV.VolumeViz.Nodes.SoOrthoSlice, etc). However the same transformation must be applied to the volume data node as well as the volume rendering nodes associated with that volume. Effectively any transformation nodes that affect the volume must be placed before the volume data node.

    • DICOM: For some data formats, including DICOM, the volume 'position' is considered to be the center of the first voxel. VolumeViz considers the volume extent to include all of the first and last voxels. Therefore the extent 'min' is the outside corner of the first voxel. NOTE: Open Inventor versions < 9.8 do not automatically set the volume extent based on the Image Position Patient attribute. Use the MedicalHelper method dicomAdjustVolume.

  • Voxel size/spacing If the volume data is uniformly sampled, the voxel size is the volume extent divided by the volume dimensions. The voxel size can be different for each axis (uniform along each axis). However VolumeViz is not limited to uniformly spaced voxels. VolumeViz also supports "rectilinear" coordinates where the voxel positions are explicitly given for each axis and also supports "projection" using the OIV.Inventor.Nodes.SoProjection node (with some limitations). This allows rendering of volumes defined, for example, in cylindrical coordinates or geographic coordinates.

  • Data type VolumeViz supports volumes containing scalar data as signed and unsigned integer values (byte, short, int) or floating point values. VolumeViz also supports volumes containing RGBA data (explicit color value for each voxel). In this case the data type is always unsigned integer. You can query if the volume contains explicit RGBA values by getting the value of the OIV.VolumeViz.Nodes.SoVolumeData.dataRGBA field. The data type is determined by the reader (or when setting the OIV.VolumeViz.Nodes.SoVolumeData.data field). You can query the data type and/or number of bytes per voxel using methods inherited from OIV.LDM.Nodes.SoDataSet. For example:

    int bytesPerVoxel = volumeData.GetDataSize();
    SoDataSet.DataTypes type = volumeData.GetDataType();

  • Data range In volumes using data types larger than byte, the actual range of data values is usually smaller than the range of the data type. The application can use an OIV.LDM.Nodes.SoDataRange node to specify the range of values that will be mapped into the transfer function. For some formats the application can get min and max values from the meta-data. For DICOM data, see OIV.VolumeViz.Readers.SoVRDicomData or the MedicalHelper method dicomAdjustDataRange(). In any case, the application can query the actual minimum and maximum values using the getMinMax methods. For example:

    double minval, maxval;
    bool ok = volumeData.GetMinMax( out minval, out maxval );

    Note 1: These methods might force VolumeViz to load the entire data set if the volume reader does not implement the getMinMax query. For example in an LDM format data set, the min and max values are stored in the LDM header, so the query is very fast. For other data sets VolumeViz may be forced to load the entire data set and scan all the values to compute the min and max values. Note 2: Changing the data range (OIV.LDM.Nodes.SoDataRange) may be slow if the size of the data values is larger than the OIV.LDM.Nodes.SoDataSet.texturePrecision setting. For example 32 bit values with texturePrecision = 8 or 16. In this case the data values must be re-scaled and resent to the GPU when the data range is changed.

  • Other: Many other volume properties can be specified using fields of OIV.LDM.Nodes.SoDataSet and OIV.VolumeViz.Nodes.SoVolumeData. The ldmResourceParameters field contains an OIV.LDM.Nodes.SoLDMResourceParameters object that controls, for example, the amount of CPU memory and GPU memory that the volume can use.

Basic volume visualization tools:

Advanced volume visualization:

  • Custom shaders Custom transfer functions, custom rendering effects and custom blending are just a few of the many possibilities that can be specified using an OIV.VolumeViz.Nodes.SoVolumeShader node and GLSL shader functions. VolumeViz provides a framework of prebuilt shader functions for commonly used calculations and effects. This allows applications to extend or replace stages in the rendering pipeline while still taking advantage of other VolumeViz features.

  • Clipping Volume visualizations can be clipped in multiple ways:

    • Volume visualizations can be clipped by clipping planes (OIV.Inventor.Nodes.SoClipPlane) like any other Open Inventor geometry. (However for clipping against axis aligned planes, using an OIV.LDM.Nodes.SoROI node is much more efficient.)

    • Volume visualizations can be clipped against a box specified in voxel coordinates using an OIV.LDM.Nodes.SoROI node. The box can be modified by a secondary exclusion box, allowing cut-away views like the "chair cut" in seismic visualization.

    • Volume visualizations can be clipped against arbitrary polygonal geometry using an OIV.VolumeViz.Nodes.SoVolumeClippingGroup node. The clipping geometry can be any closed shape, for example a cylinder or a shape extruded from a polygon.

    • Volume visualizations can be clipping against a surface defined by a "height field" (for example a seismic horizon) using an OIV.VolumeViz.Nodes.SoUniformGridClipping node.

    • Volume visualizations can be clipped against an arbitrary voxel region using an OIV.VolumeViz.Nodes.SoVolumeMask node. OIV.VolumeViz.Nodes.SoVolumeMask also allows applying different transfer functions to different regions and other powerful features.

    • Multiple clipping techniques may be combined to "sculpt" volume regions.

  • Interactivity VolumeViz allows the creation of highly interactive volume rendering applications:

  • Transforming data Volume data can transformed "on the fly" at several stages in the pipeline:

    • The OIV.LDM.Nodes.SoLDMDataTransform class (see the dataTransform field of OIV.LDM.Nodes.SoDataSet) applies a computation to each LDM data tile requested from the volume reader before the tile is stored in system memory. This can be used to apply "static" filters to the data, for example to apply DICOM Rescale Slope and Intercept values.

    • The OIV.VolumeViz.Nodes.SoVolumeTransform node applies a computation to the LDM data tiles just before they are sent to the GPU. This can be used to apply dynamic filters to the data, for example computing seismic attribute values.

    • Both mechanisms can be used to create multiple data sets from a single data set.

  • Multiple data sets

    • Multiple OIV.VolumeViz.Nodes.SoVolumeData nodes can be inserted in the same scene graph.

    • If the volumes are independent and rendered separately, use an OIV.VolumeViz.Nodes.SoVolumeGroup node to manage and correctly render intersecting regions.

    • More commonly multiple volumes will be combined into a single data set or single rendering using data compositing or render compositing. In these cases use an OIV.LDM.Nodes.SoMultiDataSeparator as the parent of the nodes that will be composited.

    • Render compositing (see OIV.VolumeViz.Nodes.SoVolumeShader) means combining multiple volumes on the GPU at render time using a fragment shader. Render compositing can be used, for example, to implement "co-blending" of multiple volumes or to implement multi-channel color combining.

    • Data compositing allows you to combine multiple volumes (see OIV.LDM.Nodes.SoDataCompositor) on the CPU at data loading time. Data compositing can be used, for example, to visualize the difference between two data sets.

    • (More details below)

  • Data Access LDM is a powerful data manager for large volume data and VolumeViz provides a Data Access API that allows applications to take advantage of this for applying algorithms to their volume data.

    • OIV.LDM.SoLDMDataAccess provides the methods to extract data from a volume. The data is accessible whether the OIV.VolumeViz.Nodes.SoVolumeData is part of a scene graph or not.

    • Data access methods can be invoked synchronously or asynchronously to allow simultaneous loading and computation. The application can request data at any resolution level, independent of the resolution level currently being used for rendering

    • VolumeViz supports a variety of data requests including:

      • Subvolume: The set of voxels inside a specified subvolume.

      • Plane: The set of voxels intersecting an arbitrary plane.

      • Line: The set of voxels intersecting an arbitrary line.

      • Trace: A column of axis aligned voxels (e.g. a seismic trace).

      • Polyline: The set of voxels intersecting an arbitrary polyline.

      • Tile: Direct access to the tile containing a specified voxel.

    • Extracted, modified or synthesized data can be written to an LDM format file by subvolume or tile using the OIV.LDM.Converters.SoLDMWriter class.

  • Computation Volume computations can take advantage of the Open Inventor computing framework to manage data, devices and algorithms on the CPU and GPU.

Multiple data sets:

Multiple OIV.VolumeViz.Nodes.SoVolumeData nodes can be inserted in the same scene graph. If the volumes are independent and rendered separately, use an OIV.VolumeViz.Nodes.SoVolumeGroup node to manage and correctly render intersecting regions. More commonly multiple volumes will be combined together in a single rendering using render compositing (OIV.VolumeViz.Nodes.SoVolumeShader) or data compositing (OIV.LDM.Nodes.SoDataCompositor). In these cases you must use an OIV.LDM.Nodes.SoMultiDataSeparator as the parent of the nodes that will be composited.

Render compositing (OIV.VolumeViz.Nodes.SoVolumeShader or OIV.VolumeViz.Nodes.SoVolumeRenderingQuality) is a way of combining multiple volumes on the GPU at render time using a GLSL fragment shader. The volumes can each have their own transfer function or they can all use the same one. Render compositing can be used, for example, to implement "co-blending" of multiple volumes or to implement multi-channel color combining. The number of volumes to compose is limited by the number of OpenGL texture units supported by the graphics board (normally at least 16). This number is returned by the OIV.LDM.Nodes.SoDataSet.GetMaxNumDataSets() function.

Data compositing allows you to combine multiple volume data sets (see OIV.LDM.Nodes.SoDataCompositor) or to transform a single data set in memory (see OIV.LDM.Nodes.SoDataSet.LDMDataTransformCallback) instead of storing the combined data sets on disk. For example, it can be used to visualize the result of the difference between two data sets. There is no limit on the number of volumes that can be composed on the CPU.

Note that the word composition is also used in OIV.VolumeViz.Nodes.SoVolumeRender. There it refers to the way that samples along the raycasting ray are combined to form the final image.

The dataSetId field is used to differentiate OIV.VolumeViz.Nodes.SoVolumeData nodes when doing render or data compositing.

Some rules must be observed when doing render or data compositing:

  • Each OIV.VolumeViz.Nodes.SoVolumeData node must have a unique dataSetId.

  • All the OIV.VolumeViz.Nodes.SoVolumeData nodes to be composited must have the same volume dimensions (number of voxels in X, Y, and Z) and tile size.

  • All the OIV.VolumeViz.Nodes.SoVolumeData nodes to be composited, as well as the compositing node (e.g. OIV.VolumeViz.Nodes.SoVolumeShader or OIV.VolumeViz.Nodes.SoVolumeRenderingQuality) and the rendering node (e.g. OIV.VolumeViz.Nodes.SoVolumeRender), must be under an OIV.LDM.Nodes.SoMultiDataSeparator node.

  • The OIV.VolumeViz.Nodes.SoVolumeData nodes to be composited must be all scalar data sets or all RGBA data sets. To composite scalar and RGBA data sets under the same OIV.LDM.Nodes.SoMultiDataSeparator, set the usePalettedTexture field to false in the scalar dataset's OIV.VolumeViz.Nodes.SoVolumeData node to force the scalar data to be converted into RGBA data.

  • An OIV.VolumeViz.Nodes.SoVolumeData node used in a data compositing scheme must not be inserted multiple times in the scene graph. Use another volume data node pointing to the same file.

  • Each OIV.VolumeViz.Nodes.SoVolumeData node has its own resource settings (see field ldmResourceParameters). The resources required for the composition are the sum of the resources for all of the OIV.VolumeViz.Nodes.SoVolumeData nodes involved.

When using a fragment shader to do render compositing, texture coordinates can be retrieved from texture unit 0 (texture coordinates are sent using glTexCoord function). To minimize the number of texture units needed, all the transfer functions (see OIV.LDM.Nodes.SoTransferFunction) for the volumes to be composited are stored in a single 2D texture. By default this texture is loaded in texture unit 0. However this default behavior can be changed through OIV.Inventor.SoPreferences using the environment variable IVVR_TF_TEX_UNIT. Each volume's data is loaded in the texture unit specified by its dataSetId. Therefore do not set dataSetId to the texture unit used to store the transfer functions.

Please see OIV.LDM.Nodes.SoMultiDataSeparator and OIV.VolumeViz.Nodes.SoVolumeShader for more information, and example code, for compositing multiple volumes.

RGBA Data

Voxels in an RGBA volume are UNSIGNED_INT32, containing 8 bits each of Red, Green, Blue and Alpha. All rendering nodes (slices, volume rendering, etc) work with RGBA volumes. Region of Interest, clipping and other features also work with RGBA volumes. However because the volume already specifies the colors to be used for rendering, the data range, transfer function and some rendering features are ignored. Lighting works with RGBA volumes using gradient vectors computed from the luminance value of the voxels.

Notes:

  • In-memory volumes For compatibility with older versions of Open Inventor, if the data is in-memory the unsigned int values must contain ABGR values, not RGBA. Use the OIV.Inventor.SbColor getPackedValueEndiannessOrder() method to convert values, not the getPackedValue() method.

  • Texture compression The useCompressedTexture option (see OIV.LDM.Nodes.SoDataSet) is true by default. This can significantly reduce the amount of GPU memory required to hold an RGBA volume. But it uses a "lossy" compression algorithm which may result in values on the GPU being slightly different than the actual value in the volume. For example "gray scale" colors could have a slight color in some cases. You should always set this option to false when using "RGBA" data to store 32-bit "id" values. Please also note that this compression is not supported on Intel GPUs, so you should set this option to false in this case as well.

Volume Editing

Volume editing is based on transactions. A transaction is created by calling the following methods:

int transactionId;
volumeData.StartEditing(out transactionId);
volumeData.FinishEditing(transactionId);
Starting a transaction returns a unique id identifying the current transaction. This id is used to finish the transaction by calling FinishEditing().After the transaction is finished, this id can also be used to undo or redo the transaction. The finish method will schedule a redraw so the modified data is displayed. Multiple transactions may be active at the same time.

After a transaction is finished, the effect can be undone by calling UndoEditing()with the transaction id. Undo also schedules a redraw so the correct data is displayed. Similarly a transaction that was undone can be re-applied by calling RedoEditing()with the transaction id.

Calling SaveEditing()will update the data source associated with this OIV.VolumeViz.Nodes.SoVolumeData node with all edits performed on the volume since the last save. Updating is done using the OIV.LDM.Writers.SoVolumeWriter returned by the current OIV.LDM.Readers.SoVolumeReader. The save method may only be called when no transactions are active, i.e. after finish has been called for all transactions. Note:

  • Until the edits have been saved, memory is required for both the original data and the modified data. This implies both an additional memory requirement and that buffer objects passed to (for example) OIV.VolumeViz.Nodes.SoVolumeData.EditSubVolume(OIV.Inventor.SbBox3i32, OIV.Inventor.Devices.SoBufferObject) must not be modified until after the saveEditing() call.

  • After the edits have been saved, all transaction ids are invalid, so undo and redo can no longer be called with those transaction ids.

  • saveEditing currently only works for data loaded using SoVRLDMFileReader (an LDM format tiled data set) or OIV.VolumeViz.Readers.SoVRMemoryReader (data set completely in memory).

  • VolumeViz applies edition transaction on the fly each time a tile is requested. Thus, loading, data access and picking performance may be impacted. To retrieve initial performances, you may have to call SaveEditing() to flush editing transactions.

VolumeViz provides multiple methods to modify data including:

  • Fill a subvolume with a value or a buffer of values (EditSubVolume())

  • Fill a tile with a specified value or a buffer of values (EditTile())

  • Fill a list of cubic subvolumes with a value (EditBoxes())

  • Fill the voxels inside a closed polygonal solid with a value (EditSolidShape())

  • Fill the voxels intersecting a polygonal surface with a value (EditSurfaceShape())

Supported file formats:

File extension Reader class Description
.am OIV.VolumeViz.Readers.SoVRAmFileReaderAvizo Mesh file format
.dc3, .dic, .dicom OIV.VolumeViz.Readers.SoVRDicomFileReaderDICOM file format
.fld OIV.VolumeViz.Readers.SoVRAvsFileReaderAVS field file format
.lda or .ldm OIV.LDM.Readers.SoVRLdmFileReaderLDM file format
.sgy or .segy OIV.VolumeViz.Readers.SoVRSegyFileReaderSEG Y rev 1 file format
.vol OIV.VolumeViz.Readers.SoVRVolFileReaderVol file format
.vox OIV.VolumeViz.Readers.SoVRVoxFileReaderVox file format
.lst OIV.VolumeViz.Readers.SoVRRasterStackReaderLst file format

File format notes:

  • Avizo mesh Avizo mesh is a general purpose file format that can contain many different kinds of data. The VolumeViz file reader can load Avizo mesh files containing a 3-dimensional "Lattice" data object with uniform coordinates and any data type. See OIV.VolumeViz.Readers.SoVRAmFileReader for limitations. Note: Unlike Amira and Avizo, VolumeViz cannot automatically open Amira/Avizo format data files unless they have the file name extension ".am". To open an Amira/Avizo data file with a different extension, the application must explicitly create an instance of OIV.VolumeViz.Readers.SoVRAmFileReader and use the OIV.LDM.Nodes.SoDataSet.SetReader(OIV.LDM.Readers.SoVolumeReader, System.Boolean) method.

  • AVS field AVS field is a general purpose file format that can contain many different kinds of data. The VolumeViz file reader can load AVS field files containing 3-dimensional, uniform data of type "byte". See OIV.VolumeViz.Readers.SoVRAvsFileReader.

  • DICOM A widely used format for storing medical image data (CT, MRI, etc), defined by the National Electrical Manufacturers Association (NEMA) (medical.nema.org). See OIV.VolumeViz.Readers.SoVRDicomFileReader

  • LDM LDM is a format defined by VSG for storing hierarchical multi-resolution volume data. VolumeViz includes a utility program that can convert any other format supported by VolumeViz into this format (see OIV.VolumeViz.Converters.SoVolumeConverter). Preprocessing volume data into this format provides the maximum benefits from the VolumeViz large data management (LDM) features. See OIV.LDM.Readers.SoVRLdmFileReader.

  • SEGY A widely used format for storing seismic trace data, defined by the Society of Exploration Geophysicists publication "Digital Tape Standards" (www.seg.org). The VolumeViz reader supports all sizes of integer and float data, and can correctly determine the number of samples per trace in many cases. However the reader also has many options to adapt to differences in SEGY file headers. See OIV.VolumeViz.Readers.SoVRSegyFileReader.

  • VOL A simple volume interchange format (see "Introduction to Volume Rendering", Lichtenbelt, Crane, Naqvi, 1998). The VolumeViz reader can load files containing 8- or 16-bit voxels. See OIV.VolumeViz.Readers.SoVRVolFileReader.

  • VOX A volume interchange format defined by TeraRecon Inc. (www.terarecon.com). The VolumeViz reader can load "Vox1999a" files containing 8- or 16-bit voxels (first volume only). See SOVRVoxFileReader.

  • LST (stack of images) A simple format for loading a stack of images. Specify the names of the image files in a .lst file. VolumeViz can load image data in most common image formats including BMP, DDS, GIF, JPEG, JPEG2000, PNG and TIFF. See OIV.VolumeViz.Readers.SoVRRasterStackReader for details and limitations.

Note: '3D TIFF' files (multiple images in one file) are not currently supported.

FILE FORMAT/DEFAULT

VolumeData {
allocateResourceOnRender false
data NODATA 0 0 0 UBYTE 8
dataRGBA false
dataSetId 1
dataTransform NULL
extent -1 -1 -1 1 1 1
fileName ""
texturePrecision 0
undefinedValue NaN
useCompressedTexture true
useExtendedData false
usePalettedTexture true
useSharedPalettedTexture true
}

ACTION BEHAVIOR

OIV.Inventor.Actions.SoCallbackAction, OIV.Inventor.Actions.SoGLRenderAction, OIV.Inventor.Actions.SoGetBoundingBoxAction, OIV.Inventor.Actions.SoPickAction, OIV.Inventor.Actions.SoWriteAction Sets volume data parameters in the traversal state.

See Also