public abstract class SoVolumeTransform extends SoNode
SoVolumeTransformnode 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
SoLDMDataTransformclass for example (see the dataTransform field of
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.
SoVolumeTransformcan 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
SoVolumeTransform, allows storing the computed tiles for later reuse. The size of this cache (number of tiles to cache) can be specified using the
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.
SoVolumeTransform works on tiles (not slices or volumes). If a compute function needs data from other tiles, the application may use the
SoLDMDataAccess API to get that data. (This is another difference from
SoLDMDataTransform, which does not allow using the LDM data access API.)
SoVolumeTransform nodes may be applied to the same
SoDataSet. The transforms are applied in the order of their appearance in the scene graph.
SoVolumeTransform nodes may also be applied only to a specific
SoDataSet using the
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.
SoVolumeTransform is based on the Open Inventor computing framework and uses the
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,
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
SoDataSetId nodes to specify a different data set id for each instance of the data set node. If an
SoDataSetId node is in the traversal state when a data set node is traversed, the dataSetId field is ignored and the id from the
SoDataSetId node is used.
To implement a computation, the application must derive a new class from
SoVolumeTransform and (at least) implement the apply() 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 isValid() and
getTransformedMinMax() methods. The isValid() method will be called for each tile immediately before the apply() method. If this method returns false, then the apply() 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
getTransformedMinMax() method so VolumeViz does not do unnecessary work to compute these values.
|Modifier and Type||Field and Description|
Size of the computed tile cache for this transform.
Allows the transform to be applied to all or one specific data set.
|Modifier and Type||Method and Description|
Add the transformed data for a specific tile to the cache.
Returns the previously transformed data for a specific tile.
Based on min max of the input data, this function should return the expected data range of the result (transformed) data.
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public final SoSFShort volumeTransformId
public final SoSFInt32 cacheSize
public void addInCache(SoLDMTileID tileID, SoBufferObject bufferObject)
public double getTransformedMinMax()
public SoBufferObject getFromCache(SoLDMTileID tileID)
Generated on January 29, 2020, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com