Click or drag to resize
SoVolumeTransform Class

Transform data before texture creation.

Inheritance Hierarchy

Namespace: OIV.VolumeViz.Nodes
Assembly: OIV.VolumeViz (in OIV.VolumeViz.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public abstract class SoVolumeTransform : SoNode

The SoVolumeTransform type exposes the following members.

Methods
  NameDescription
Public methodAddInCache

Add the transformed data for a specific tile to the cache.

Public methodAffectsState

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

(Inherited from SoNode.)
Public methodApply

Apply in-place transformation to the specified dataset tile.

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

Returns the previously transformed data for a specific tile.

Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetPrimitiveCount
(Inherited from SoNode.)
Public methodGetRenderEngineMode

Returns the supported Render engine mode.

(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetTransformedMinMax

Based on min max of the input data, this function should return the expected data range of the result (transformed) data.

Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
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 SoNode.)
Public methodHasDefaultValues

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

(Inherited from SoFieldContainer.)
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 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 methodIsValid

Should return true if the given parameters are valid for this compute function.

Public methodPick
Public methodRayPick
(Inherited from SoNode.)
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 methodSetName (Inherited from SoBase.)
Public methodSetOverride

Turns the override flag on or off.

(Inherited from SoNode.)
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 SoNode.)
Public methodWrite
Top
Properties
  NameDescription
Public propertycacheSize

Size of the computed tile cache for this transform.

Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Public propertyvolumeTransformId

Allows the transform to be applied to all or one specific data set.

Top
Remarks

The OIV.VolumeViz.Nodes.SoVolumeTransform node allows an application to apply a defined computation on LDM data tiles just before they are sent to the GPU. There are several other ways to apply a computation to LDM tiles, that are applied at different stages of the pipeline. The OIV.LDM.Nodes.SoLDMDataTransform class for example (see the dataTransform field of OIV.LDM.Nodes.SoDataSet) applies a computation to each LDM tile requested from the volume reader before the tile is stored in system memory. This can be used to create multiple data sets from a single input (e.g. on disk) data set, but has the drawback that each resulting data set must be stored in system memory. OIV.VolumeViz.Nodes.SoVolumeTransform can be used to create multiple data sets from a single data set in system memory and does not require storing the created data sets in system memory (only on the GPU).

A cache mechanism, local to each instance of OIV.VolumeViz.Nodes.SoVolumeTransform, allows storing the computed tiles for later reuse. The size of this cache (number of tiles to cache) can be specified using the OIV.VolumeViz.Nodes.SoVolumeTransform.cacheSize field. We recommend setting the cacheSize to the number of tiles needed to display the biggest expected slice. As an example, for a dataset of size 128x512x1024 with a tile size equal to 128, the biggest slice size is 512x1024. So 4x8 = 32 LDM tiles are needed for rendering and therefore a cacheSize of 32 (tiles) is needed to avoid computing the same tile multiple times. The apply method can retrieve the transformed data for other tiles from the cache and can explicitly add the transformed data for other tiles to the cache.

OIV.VolumeViz.Nodes.SoVolumeTransform works on tiles (not slices or volumes). If a compute function needs data from other tiles, the application may use the OIV.LDM.SoLDMDataAccess API to get that data. (This is another difference from OIV.LDM.Nodes.SoLDMDataTransform, which does not allow using the LDM data access API.)

Multiple OIV.VolumeViz.Nodes.SoVolumeTransform nodes may be applied to the same OIV.LDM.Nodes.SoDataSet. The transforms are applied in the order of their appearance in the scene graph. OIV.VolumeViz.Nodes.SoVolumeTransform nodes may also be applied only to a specific OIV.LDM.Nodes.SoDataSet using the OIV.VolumeViz.Nodes.SoVolumeTransform.volumeTransformId field. If this field is zero (the default), the transform is applied to all subsequent data set nodes. Else the transform is only applied to data sets whose dataSetId field contains the same value as the volumeTransformId.

OIV.VolumeViz.Nodes.SoVolumeTransform is based on the Open Inventor computing framework and uses the OIV.Inventor.Devices.SoBufferObject classes to abstract and manage blocks of memory. The application can use different devices to implement the computation, and manage input tiles and output tiles stored on different devices.

As mentioned previously, OIV.VolumeViz.Nodes.SoVolumeTransform can be used to create multiple data sets on-the-fly from a single data set in system memory. In this case the same data set node will be instanced multiple times in the scene graph (although its data will only be loaded in system memory once), but we still need to assign each data texture a unique id so the shader program can access them uniquely. This is done using OIV.LDM.Nodes.SoDataSetId nodes to specify a different data set id for each instance of the data set node. If an OIV.LDM.Nodes.SoDataSetId node is in the traversal state when a data set node is traversed, the dataSetId field is ignored and the id from the OIV.LDM.Nodes.SoDataSetId node is used.

To implement a computation, the application must derive a new class from OIV.VolumeViz.Nodes.SoVolumeTransform and (at least) implement the OIV.VolumeViz.Nodes.SoVolumeTransform.Apply(OIV.Inventor.Misc.SoState, OIV.Inventor.Generic.SbPair{{OIV.LDM.Nodes.SoDataSet,System.Int32}}, OIV.Inventor.Devices.SoBufferObject, OIV.LDM.SoLDMTileID) method, which performs the actual computation. This method is called with parameters that give access to information about the data set and the specific tile being computed. In a simple case you might only need to access the buffer object.

It may also be useful to implement the OIV.VolumeViz.Nodes.SoVolumeTransform.IsValid(OIV.Inventor.Misc.SoState, OIV.Inventor.Generic.SbPair{{OIV.LDM.Nodes.SoDataSet,System.Int32}}, OIV.Inventor.Devices.SoBufferObject, OIV.LDM.SoLDMTileID) and OIV.VolumeViz.Nodes.SoVolumeTransform.GetTransformedMinMax(System.Double@, System.Double@) methods. The OIV.VolumeViz.Nodes.SoVolumeTransform.IsValid(OIV.Inventor.Misc.SoState, OIV.Inventor.Generic.SbPair{{OIV.LDM.Nodes.SoDataSet,System.Int32}}, OIV.Inventor.Devices.SoBufferObject, OIV.LDM.SoLDMTileID) method will be called for each tile immediately before the OIV.VolumeViz.Nodes.SoVolumeTransform.Apply(OIV.Inventor.Misc.SoState, OIV.Inventor.Generic.SbPair{{OIV.LDM.Nodes.SoDataSet,System.Int32}}, OIV.Inventor.Devices.SoBufferObject, OIV.LDM.SoLDMTileID) method. If this method returns false, then the OIV.VolumeViz.Nodes.SoVolumeTransform.Apply(OIV.Inventor.Misc.SoState, OIV.Inventor.Generic.SbPair{{OIV.LDM.Nodes.SoDataSet,System.Int32}}, OIV.Inventor.Devices.SoBufferObject, OIV.LDM.SoLDMTileID) method will not be called for that tile. If the application can compute or estimate the min and max values of the computed data set, then it should implement the OIV.VolumeViz.Nodes.SoVolumeTransform.GetTransformedMinMax(System.Double@, System.Double@) method so VolumeViz does not do unnecessary work to compute these values.

FILE FORMAT/DEFAULT

VolumeTransform {
volumeTransformId 0
cacheSize 1
}

ACTION BEHAVIOR

OIV.Inventor.Actions.SoCallbackAction, OIV.Inventor.Actions.SoGLRenderAction Sets volume transform parameters in the traversal state.

See Also