Volume data property node. More...
#include <VolumeViz/nodes/SoVolumeData.h>
Public Types | |
enum | CoordinateType { COORDINATES_UNIFORM = SoVolumeReader::COORDINATES_UNIFORM, COORDINATES_RECTILINEAR = SoVolumeReader::COORDINATES_RECTILINEAR } |
enum | Axis { X, Y, Z } |
typedef SoLDMDataAccess | LDMDataAccess |
typedef SoLDMMediator::LDMManagerAccess | LDMManagerAccess |
typedef ::LDMResourceParameter | LDMResourceParameter |
Public Member Functions | |
virtual SoType | getTypeId () const |
SoVolumeData () | |
virtual SbBool | getMinMax (int64_t &min, int64_t &max) |
virtual SbBool | getMinMax (double &min, double &max) |
SbBool | getHistogram (int &length, int64_t *&histogram) |
void | updateRegions (const SbBox3i32 *region, int num_regions) |
void | updateTilesInTextureMemory (SoLDMTileID *tiles, int numTiles) |
virtual SbVec3f | voxelToXYZ (const SbVec3f &dataPosition) const |
virtual SbBox3f | voxelToXYZ (const SbBox3f &box) const |
virtual SbVec3f | XYZToVoxel (const SbVec3f &dataPosition) |
virtual SbBox3f | XYZToVoxel (const SbBox3f &xyzBox) |
void | setRGBAData (const bool flag) |
CoordinateType | getCoordinateType () const |
const std::vector< float > & | getRectilinearCoordinates (Axis axis) const |
virtual SbBool | startEditing (int &transactionId) |
virtual int | editTile (const SoLDMTileID &tileId, SoBufferObject *userData) |
virtual int | editSubVolume (const SbBox3i32 &subVolume, SoBufferObject *userData) |
virtual int | editTile (const SoLDMTileID &tileId, const double &value) |
virtual int | editSubVolume (const SbBox3i32 &subVolume, const double &value) |
virtual int | editSurfaceShape (const SoNode *surfaceShape, const float &thickness, const double &newValue) |
virtual int | editSolidShape (const SoNode *solidShape, const double &value) |
virtual int | editBoxes (const std::vector< SbVec3i32 > &boxCenters, const int &boxSize, const double &newValue) |
virtual SbBool | finishEditing (int transactionId) |
virtual SbBool | undoEditing (int transactionId) |
virtual SbBool | redoEditing (int transactionId) |
virtual SbBool | saveEditing (bool recomputeLowerResolution=TRUE, const std::vector< char * > convertionParameters=std::vector< char * >(), SaveEditingCB *callback=NULL) |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoSFBool | usePalettedTexture |
SoSFBool | useSharedPalettedTexture |
SoSFBool | useExtendedData |
SoSFArray3D | data |
SoSFBool | dataRGBA |
Friends | |
class | SoLDMMediator::LDMManagerAccess |
Deprecated | |
| |
enum | StorageHint { AUTO, TEX2D_MULTI, TEX2D = TEX2D_MULTI, TEX3D, MEMORY } |
enum | SubMethod { NEAREST, MAX, AVERAGE } |
enum | OverMethod { NONE, CONSTANT, LINEAR, CUBIC } |
SoDEPRECATED SoSFInt32 | volumeDataId |
SoDEPRECATED SoSFEnum | storageHint |
static SoDEPRECATED int | getMaxNumVolumes () |
SoDEPRECATED SoVolumeData * | subSetting (const SbBox3s ®ion) |
SoDEPRECATED void | updateRegions (const SbBox3s *region, int num_regions) |
SoDEPRECATED void | loadRegions (const SbBox3s *region, int num_regions, SoState *state, SoTransferFunction *transFunc) |
SoDEPRECATED void | setSubSamplingLevel (const SbVec3s &ROISampling, const SbVec3s &secondarySampling) |
SoDEPRECATED void | getSubSamplingLevel (SbVec3s &ROISampling, SbVec3s &secondarySampling) |
SoDEPRECATED void | setPageSize (SbVec3s &size) |
SoDEPRECATED void | setVolumeData (const SbVec3s &dimension, void *data, SoDataSet::DataType type=UNSIGNED_BYTE, int numSignificantBits=0) |
SoDEPRECATED void | setVolumeSize (const SbBox3f &size) |
SoDEPRECATED const SbBox3f & | getVolumeSize () |
SoDEPRECATED void | setVolumeData (const SbVec3i32 &dimension, SoMemoryObject *data, SoDataSet::DataType type=UNSIGNED_BYTE, int numSignificantBits=0) |
SoDEPRECATED void | setVolumeData (const SbVec3i32 &dimension, void *data, SoDataSet::DataType type=UNSIGNED_BYTE, int numSignificantBits=0) |
SoDEPRECATED SbBool | getVolumeData (SbVec3i32 &dimension, void *&data, SoDataSet::DataType &type, int *numSignificantBits=NULL) |
SoDEPRECATED SbBool | getMinMax (int &min, int &max) |
SoDEPRECATED SbBool | getVolumeData (SbVec3s &dimension, void *&data, SoDataSet::DataType &type, int *numSignificantBits=NULL) |
SoDEPRECATED SbBool | getHistogram (int &length, int *&histogram) |
SoDEPRECATED void | setPaging (SbBool) |
SoDEPRECATED SbVec3i32 | getDimension () |
SoDEPRECATED SbVec3i32 | getPageSize () |
SoDEPRECATED void | enableSubSampling (SbBool enable) |
SoDEPRECATED SbBool | isSubSamplingEnabled () |
SoDEPRECATED void | enableAutoSubSampling (SbBool enable) |
SoDEPRECATED SbBool | isAutoSubSamplingEnabled () |
SoDEPRECATED void | enableAutoUnSampling (SbBool enable) |
SoDEPRECATED SbBool | isAutoUnSamplingEnabled () |
SoDEPRECATED void | unSample () |
SoDEPRECATED void | setSubSamplingMethod (SubMethod method) |
SoDEPRECATED void | setSubSamplingLevel (const SbVec3i32 &ROISampling, const SbVec3i32 &secondarySampling) |
SoDEPRECATED void | getSubSamplingLevel (SbVec3i32 &ROISampling, SbVec3i32 &secondarySampling) |
SoDEPRECATED SoVolumeData * | reSampling (const SbVec3i32 &dimension, SoVolumeData::SubMethod subMethod, SoVolumeData::OverMethod=NONE) |
SoDEPRECATED SoVolumeData * | subSetting (const SbBox3i32 ®ion) |
SoDEPRECATED void | setTexMemorySize (int size) |
SoDEPRECATED int | getTexMemorySize () |
SoDEPRECATED void | setPageSize (int size) |
SoDEPRECATED void | setPageSize (SbVec3i32 &size) |
SoDEPRECATED void | loadRegions (const SbBox3i32 *region, int num_regions, SoState *state, SoTransferFunction *transFunc) |
SoDEPRECATED SbBool | isPaging () |
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 (SoVolumeRender, SoOrthoSlice, SoObliqueSlice, etc.) and is the parent class for some specialized data nodes (SoHeightFieldGeometry, SoVolumeMask, etc.).
Note: Since the camera viewpoint is used to determine which part of the volume to load, the behavior of SoVolumeData is not correctly defined when no camera node has been traversed before the SoVolumeData. This can result in console warnings.
The data volume can be specified by:
Volume Properties:
SbVec3i32 voldim = volumeData->data.getSize();
SbBox3f volext = volumeData->extent.getValue();
int bytesPerVoxel = volumeData->getDataSize(); SoDataSet::DataType type = volumeData->getDataType();
double minval, maxval; SbBool ok = volumeData->getMinMax( minval, maxval );
Basic volume visualization tools:
Advanced volume visualization:
Multiple data sets:
Multiple SoVolumeData nodes can be inserted in the same scene graph. If the volumes are independent and rendered separately, use an SoVolumeGroup node to manage and correctly render intersecting regions. More commonly multiple volumes will be combined together in a single rendering using render compositing (SoVolumeShader) or data compositing (SoDataCompositor). In these cases you must use an SoMultiDataSeparator as the parent of the nodes that will be composited.
Render compositing (SoVolumeShader or 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 getMaxNumDataSets function.
Data compositing allows you to combine multiple volume data sets (see SoDataCompositor) or to transform a single data set in memory (see setLDMDataTransformFunction()) 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 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 SoVolumeData nodes when doing render or data compositing.
Some rules must be observed when doing render or data compositing:
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 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 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 SoMultiDataSeparator and 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:
Volume Editing
Volume editing is based on transactions. A transaction is created by calling the following methods:
int transationId; volumeData->startEditing( transationId ); //... editing calls ... volumeData->finishEditing( transationId );
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 SoVolumeData node with all edits performed on the volume since the last save. Updating is done using the SoVolumeWriter returned by the current SoVolumeReader. The save method may only be called when no transactions are active, i.e. after finish has been called for all transactions.
Note:
VolumeViz provides multiple methods to modify data including:
Supported file formats:
File extension | Reader class | Description |
.am | SoVRAmFileReader | Avizo Mesh file format |
.dc3, .dic, .dicom | SoVRDicomFileReader | DICOM file format |
.fld | SoVRAvsFileReader | AVS field file format |
.lda or .ldm | SoVRLdmFileReader | LDM file format |
.sgy or .segy | SoVRSegyFileReader | SEG Y rev 1 file format |
.vol | SoVRVolFileReader | Vol file format |
.vox | SoVRVoxFileReader | Vox file format |
.lst | SoVRRasterStackReader | Lst file format |
File format notes:
Note: '3D TIFF' files (multiple images in one file) are not currently supported.
allocateResourceOnRender | FALSE |
data | NODATA 0 0 0 UBYTE 8 |
dataRGBA | FALSE |
dataSetId | 1 |
extent | -1 -1 -1 1 1 1 |
fileName | "" |
texturePrecision | 0 |
useCompressedTexture | TRUE |
useExtendedData | FALSE |
usePalettedTexture | TRUE |
useSharedPalettedTexture | TRUE |
SoVolumeRender, SoOrthoSlice, SoObliqueSlice, SoVolumeReader, SoVolumeSkin, SoDataCompositor, SoLDMGlobalResourceParameters, SoLDMResourceParameters
MedicalCPUDataCompose, MedicalGetDataBox, MedicalGetDataBox_MultiThread, MedicalGetDataLine, MedicalGetDataPlane, MedicalGetDataPolyLine, MedicalGPUDataCompose, MedicalImageFilterToggle, MedicalImageFilterWipe, MedicalDicomImageViewer, MedicalDicomReader, MedicalMPRViewer, MedicalIntensityAnisotropy, MedicalMultiVolumes, MedicalVolumeTextureCompose, MedicalAmbientOcclusion, MedicalGammaCorrection, MedicalSimpleLightedVolume, Medical4DVolumeRendering, MedicalAnatomicalViews, MedicalDTIViewer, MedicalMIP, MedicalMultiView, MedicalOrthoSlice, MedicalOrthoSliceBorder, MedicalSimpleIsosurface, MedicalVolumeDataDrawStyle, MedicalFreeHandCutting, MedicalImageSegmentationFloodFill, MedicalMarchingCubesSurface, MedicalSegmentation, MedicalSimpleClippingGroup, MedicalSimpleVolumeMask, MedicalVolumeExtract, MedicalVolumeGeometry, MedicalVolumePipeClipping, MedicalBonesMuscles, MedicalMagicGlass, MedicalMagnifier, MedicalRoiManip, MedicalRotateROI, MedicalRuler, MedicalSimpleVolumeAxis, MedicalZoom, MedicalImageViewerService, MedicalMPRViewerService, DataAccessCustomReader, DataTransform, GetDataLine, GetDataPolyLine, GetDataPlane, GetDataBox, AsyncGetDataBox, GetDataBox_multiThread, GetDataTrace, MultiChannel_ex1, MultiChannel_ex2, AmplitudeVelocity, CpuDataCompose, GpuDataCompose, VolumeTextureCompose, MultiVolumes, RoiManip, SegmentedInterpolation, SimpleInteractiveParameters, SimpleLightedVolume, SimpleShader, SimpleSliceRGBA, SimpleVolume, SimpleVolumeAxis, VolumeDataEditing, VolumeGeometry, VolumeProjection, VolumeSkin, VolumeTransform, VolRend
enum SoVolumeData::Axis |
Over sampling method mode.
Storage Hints mode.
Sub sampling method mode.
SoVolumeData::SoVolumeData | ( | ) |
Constructor.
virtual int SoVolumeData::editBoxes | ( | const std::vector< SbVec3i32 > & | boxCenters, | |
const int & | boxSize, | |||
const double & | newValue | |||
) | [virtual] |
Replace all voxels in the region defined by a list of boxes with the specified value. boxCenter and boxSize are defined in ijk (voxel) space.Call startEditing() before calling this method. Returns 0 if successful.
Reimplemented from SoDataSet.
virtual int SoVolumeData::editSolidShape | ( | const SoNode * | solidShape, | |
const double & | value | |||
) | [virtual] |
Replace all voxels intersecting the given shape with the specified value. The geometry defined under solidShape must represent a list of closed surfaces otherwise the result is unpredictable. solidShape must not contain any lines or open polyhedrons (polyhedron with shapes). The result is based on the odd-winding rule, so the result is not necessarily the union or the intersection of the closed surfaces. If you want to voxelize lines or single polygons, see also the editSurfaceShape method.If the goal is to define a shape which is the results of the intersection/union of multiple closed surfaces, see the SoCSGShape node.solidShape is defined in the same 3D space as the dataSet. The solidShape can be deleted after calling this function.Call startEditing() before calling this method. Returns 0 if successful.
Reimplemented from SoDataSet.
Reimplemented in SoVolumeMask.
virtual int SoVolumeData::editSubVolume | ( | const SbBox3i32 & | subVolume, | |
const double & | value | |||
) | [virtual] |
Replace the contents of a subvolume with the specified value.
The subvolume is specified in voxel/cell coordinates. Call startEditing() before calling this method. Returns 0 if successful.
Reimplemented from SoDataSet.
Reimplemented in SoVolumeMask.
virtual int SoVolumeData::editSubVolume | ( | const SbBox3i32 & | subVolume, | |
SoBufferObject * | userData | |||
) | [virtual] |
Replace the contents of a subvolume with the given data.
The buffer size (in bytes) must match the subvolume size (in bytes) exactly. The subvolume is specified in voxel/cell coordinates. Call startEditing() before calling this method. Returns 0 if successful.
Reimplemented from SoDataSet.
Reimplemented in SoVolumeMask.
virtual int SoVolumeData::editSurfaceShape | ( | const SoNode * | surfaceShape, | |
const float & | thickness, | |||
const double & | newValue | |||
) | [virtual] |
Replace all voxels intersecting the polygons or lines defined by the surfaceShape and given thickness with the specified value. surfaceShape is defined in the same 3D space as the dataSet. thickness is defined in voxels. The surfaceShape can be deleted after calling this function.Call startEditing() before calling this method. Returns 0 if successful.
Reimplemented from SoDataSet.
Reimplemented in SoVolumeMask.
virtual int SoVolumeData::editTile | ( | const SoLDMTileID & | tileId, | |
const double & | value | |||
) | [virtual] |
Replace the contents of a tile with the specified value.
Call startEditing() before calling this method. Returns 0 if successful.
Reimplemented from SoDataSet.
virtual int SoVolumeData::editTile | ( | const SoLDMTileID & | tileId, | |
SoBufferObject * | userData | |||
) | [virtual] |
Replace the contents of a tile with the given data.
The buffer size (in bytes) must match the tile size (in bytes) exactly. Call startEditing() before calling this method. Returns 0 if successful.
Reimplemented from SoDataSet.
SoDEPRECATED void SoVolumeData::enableAutoSubSampling | ( | SbBool | enable | ) |
Specifies if automatic subsampling is allowed.
See enableSubSampling(). The default is TRUE.
SoDEPRECATED void SoVolumeData::enableAutoUnSampling | ( | SbBool | enable | ) |
Specifies if automatic unsampling is allowed.
See enableSubSampling(). The default is FALSE.
SoDEPRECATED void SoVolumeData::enableSubSampling | ( | SbBool | enable | ) |
Specifies if automatic subsampling and unsampling is allowed.
If enabled and according to enableAutoSubSampling() and enableAutoUnSampling(), VolumeViz automatically subsamples or unsamples so that all textures fit into the texture memory specified by setTexMemorySize(). The default is TRUE.
virtual SbBool SoVolumeData::finishEditing | ( | int | transactionId | ) | [virtual] |
Terminate an editing transaction.
Returns true if successful. May only be called with a valid transaction id returned by the startEditing() method. On error does nothing. The finish method will schedule a redraw so the correct data is displayed. To commit the edits, in other words to save the edited data back to the data source, call saveEditing().
Reimplemented from SoDataSet.
static SoType SoVolumeData::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoDataSet.
Reimplemented in SoHeightFieldGeometry, SoHeightFieldProperty, SoHeightFieldPropertyMask, and SoVolumeMask.
CoordinateType SoVolumeData::getCoordinateType | ( | ) | const [inline] |
SoDEPRECATED SbVec3i32 SoVolumeData::getDimension | ( | ) | [inline] |
Reimplemented from SoDataSet.
SoDEPRECATED SbBool SoVolumeData::getHistogram | ( | int & | length, | |
int *& | histogram | |||
) |
Returns the histogram of the volume data.
Returns FALSE if the requested data is not available.
NOTE: This method might force VolumeViz to load the entire data set if the volume reader does not respond to the getHistogram query. Normally for an LDM format data set, the histogram values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, VolumeViz will load the entire data set to compute these values. For a large data set this may take a long time.
SbBool SoVolumeData::getHistogram | ( | int & | length, | |
int64_t *& | histogram | |||
) |
Returns the histogram of the volume data.
Returns FALSE if the requested data is not available.
Notes:
Warnings:
static SoDEPRECATED int SoVolumeData::getMaxNumVolumes | ( | ) | [static] |
SoDEPRECATED SbBool SoVolumeData::getMinMax | ( | int & | min, | |
int & | max | |||
) |
Returns min and max values of the volume data.
Returns FALSE if the requested data is not available (for example, if no data volume exists).
NOTE: This method might force VolumeViz to load the entire data set if the volume reader does not respond to the getMinMax query. Normally for an LDM format data set, the min and max values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, VolumeViz will load the entire data set to compute the min and max values. For a large data set this may take a long time.
virtual SbBool SoVolumeData::getMinMax | ( | double & | min, | |
double & | max | |||
) | [virtual] |
Returns min and max values of the data set.
Returns FALSE if the requested data is not available (for example, if no data set exists).
NOTE: This method might force LDM to load the entire data set if the volume reader does not respond to the getMinMax query. Normally for an LDM format data set, the min and max values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, LDM will load the entire data set to compute the min and max values. For a large data set this may take a long time.
Reimplemented from SoDataSet.
virtual SbBool SoVolumeData::getMinMax | ( | int64_t & | min, | |
int64_t & | max | |||
) | [virtual] |
Returns min and max values of the data set data.
Returns FALSE if the requested data is not available (for example, if no data set exists).
NOTE: This method might force LDM to load the entire data set if the volume reader does not respond to the getMinMax query. Normally for an LDM format data set, the min and max values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, LDM will load the entire data set to compute the min and max values. For a large data set this may take a long time.
Reimplemented from SoDataSet.
SoDEPRECATED SbVec3i32 SoVolumeData::getPageSize | ( | ) |
Returns the page size in X, Y, and Z direction.
const std::vector<float>& SoVolumeData::getRectilinearCoordinates | ( | Axis | axis | ) | const |
Returns a vector describing mapping from uniform space to rectilinear space.
You can specify that you want the vector to return the coordinates from the X, Y, or Z axis.
SoDEPRECATED void SoVolumeData::getSubSamplingLevel | ( | SbVec3i32 & | ROISampling, | |
SbVec3i32 & | secondarySampling | |||
) |
Returns values used to subsample at given values even when automatic subsampling is disabled.
SoDEPRECATED void SoVolumeData::getSubSamplingLevel | ( | SbVec3s & | ROISampling, | |
SbVec3s & | secondarySampling | |||
) |
Use getSubSamplingLevel(SbVec3i32 &, SbVec3i32 &).
SoDEPRECATED int SoVolumeData::getTexMemorySize | ( | ) |
Returns the maximum texture memory size to use in mega texels.
virtual SoType SoVolumeData::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoDataSet.
Reimplemented in SoHeightFieldGeometry, SoHeightFieldProperty, SoHeightFieldPropertyMask, and SoVolumeMask.
SoDEPRECATED SbBool SoVolumeData::getVolumeData | ( | SbVec3s & | dimension, | |
void *& | data, | |||
SoDataSet::DataType & | type, | |||
int * | numSignificantBits = NULL | |||
) |
SoDEPRECATED SbBool SoVolumeData::getVolumeData | ( | SbVec3i32 & | dimension, | |
void *& | data, | |||
SoDataSet::DataType & | type, | |||
int * | numSignificantBits = NULL | |||
) |
SoDEPRECATED const SbBox3f& SoVolumeData::getVolumeSize | ( | ) |
SoDEPRECATED SbBool SoVolumeData::isAutoSubSamplingEnabled | ( | ) | [inline] |
Returns TRUE if automatic subsampling is allowed.
SoDEPRECATED SbBool SoVolumeData::isAutoUnSamplingEnabled | ( | ) | [inline] |
Returns TRUE if automatic unsampling is allowed.
SoDEPRECATED SbBool SoVolumeData::isPaging | ( | ) |
Returns TRUE if paging is on, FALSE if off.
SoDEPRECATED SbBool SoVolumeData::isSubSamplingEnabled | ( | ) | [inline] |
Returns TRUE if automatic subsampling is allowed.
SoDEPRECATED void SoVolumeData::loadRegions | ( | const SbBox3i32 * | region, | |
int | num_regions, | |||
SoState * | state, | |||
SoTransferFunction * | transFunc | |||
) |
This function will load all bricks into system memory that are wholly or partially contained within each of the specified regions.
This can be used to pre-load volume data that will be needed for rendering later.
In addition, if state is not NULL, it will create the corresponding textures and load them in texture memory. Likewise this can be used to pre-load textures that will be needed for rendering later. In this case it must only be called when a valid OpenGL context has been made current (generally a context is current if there is an Open Inventor window and at least one render has been done). State is normally obtained by querying the current SoGLRenderAction, for example:
SoState *state = pViewer->getGLRenderAction()->getState();
Normally, VolumeViz will only load bricks that are currently needed for rendering some volume geometry, e.g., a slice or a subvolume. This method allows the application to force other bricks to be loaded, which may be useful to reduce the delay when a new brick is needed to render some volume geometry.
SoDEPRECATED void SoVolumeData::loadRegions | ( | const SbBox3s * | region, | |
int | num_regions, | |||
SoState * | state, | |||
SoTransferFunction * | transFunc | |||
) |
Use loadRegions( const SbBox3i32*, int, SoState*, SoTransferFunction* ).
virtual SbBool SoVolumeData::redoEditing | ( | int | transactionId | ) | [virtual] |
Redo all modifications associated with the specified transaction id. Returns true if successful. On error does nothing. May only be called after the specified transaction has been terminated (see finishEditing() method) and undone (see undoEditing() method). Schedules a redraw so the correct data is displayed.Note: Redo is no longer available after transactions are saved. After calling saveEditing(), the transaction ids are no longer valid and the modified data is the new reference.
Reimplemented from SoDataSet.
SoDEPRECATED SoVolumeData* SoVolumeData::reSampling | ( | const SbVec3i32 & | dimension, | |
SoVolumeData::SubMethod | subMethod, | |||
SoVolumeData::OverMethod | = NONE | |||
) |
Re-samples the volume down to or up to the given dimension using the sub-sampling method SubMethod() and the over-sampling method OverMethod().
If a reader is specified, the original volume data is not loaded.
Over-sampling is not yet implemented. NONE (default) indicates that no over-sampling is performed. For example if the original dimension is 256x256x64 and the reSampling dimension is 128x128x128, the result is a volume of dimension 128x128x64.
virtual SbBool SoVolumeData::saveEditing | ( | bool | recomputeLowerResolution = TRUE , |
|
const std::vector< char * > | convertionParameters = std::vector< char * >() , |
|||
SaveEditingCB * | callback = NULL | |||
) | [virtual] |
Commit all transactions. All modified tiles are written back to the data source using the current reader format. May only be called when no threads are editing, i.e. after all threads that called startEditing have called finishEditing.Returns true if successful. On error does nothing returns false. Returns false if:
Reimplemented from SoDataSet.
SoDEPRECATED void SoVolumeData::setPageSize | ( | SbVec3i32 & | size | ) |
Specifies page size in X, Y, and Z direction.
Must be 2^n for some integer n. The default is 128x128x128.
SoDEPRECATED void SoVolumeData::setPageSize | ( | int | size | ) |
Specifies page size in X, Y, and Z direction (uniform).
Must be 2^n for some integer n. The default is 128x128x128.
SoDEPRECATED void SoVolumeData::setPageSize | ( | SbVec3s & | size | ) |
Specifies page size in X, Y, and Z direction.
Must be 2^n for some integer n. The default is 128x128x128.
SoDEPRECATED void SoVolumeData::setPaging | ( | SbBool | ) |
Turns paging mode on or off.
Default is FALSE.
Since VolumeViz 5, LDM mode is on by default. To be compatible with version 4 you can either turn LDM mode off by calling setPaging(TRUE) or set the IVVR_40_COMPAT variable to 1 in the configuration file (see SoPreferences).
Note: In paging mode, multidata (for example SoDataCompositor) is not supported.
void SoVolumeData::setRGBAData | ( | const bool | flag | ) |
Force data to be considered as RGBA values.
Note that this call should be used only when setting data from memory through the data field and the data format must be UNSIGNED_INT32.
SoDEPRECATED void SoVolumeData::setSubSamplingLevel | ( | const SbVec3i32 & | ROISampling, | |
const SbVec3i32 & | secondarySampling | |||
) |
Forces VolumeViz to subsample at given values even if automatic subsampling is disabled.
See enableAutoSubSampling(). ROISampling corresponds to the sampling values used for the Region Of Interest. secondarySampling corresponds to the sampling values used for the rest of the volume (not yet used). Values are given in powers of two. For example if ROISampling is set to (1,1,0), the ROI will be subsampled using the subsampling factors (2,2,1). In this case the Z axis will not be subsampled.
SoDEPRECATED void SoVolumeData::setSubSamplingLevel | ( | const SbVec3s & | ROISampling, | |
const SbVec3s & | secondarySampling | |||
) |
Use setSubSamplingLevel(const SbVec3i32&, const SbVec3i32&).
SoDEPRECATED void SoVolumeData::setSubSamplingMethod | ( | SubMethod | method | ) |
Specifies the subsampling method used when automatic subsampling is activated.
See enableAutoSubSampling(). Depending on the kind of data, it may be useful to use a specific method. The default is NEAREST.
SoDEPRECATED void SoVolumeData::setTexMemorySize | ( | int | size | ) |
Specifies the maximum texture memory size to use in mega texels.
64 is the default.
SoDEPRECATED void SoVolumeData::setVolumeData | ( | const SbVec3i32 & | dimension, | |
void * | data, | |||
SoDataSet::DataType | type = UNSIGNED_BYTE , |
|||
int | numSignificantBits = 0 | |||
) |
SoDEPRECATED void SoVolumeData::setVolumeData | ( | const SbVec3i32 & | dimension, | |
SoMemoryObject * | data, | |||
SoDataSet::DataType | type = UNSIGNED_BYTE , |
|||
int | numSignificantBits = 0 | |||
) |
Note that by default the contents of the data field will be written into the output file if an SoWriteAction is applied to the scene graph (this was not the case when using setVolumeData).
This may produce an extremely large file, particularly if using the relatively verbose ASCII file format. To avoid writing data into the file see the method SoSFArray3D::setNeverWrite.
SoDEPRECATED void SoVolumeData::setVolumeData | ( | const SbVec3s & | dimension, | |
void * | data, | |||
SoDataSet::DataType | type = UNSIGNED_BYTE , |
|||
int | numSignificantBits = 0 | |||
) |
SoDEPRECATED void SoVolumeData::setVolumeSize | ( | const SbBox3f & | size | ) |
virtual SbBool SoVolumeData::startEditing | ( | int & | transactionId | ) | [virtual] |
Initiate an editing transaction.
Returns true if successful and also returns a unique transaction id. This value is required for finishing the edit transaction (see finishEditing()) and for undo/redo (see undoEditing() and redoEditing()). Multiple transactions may be active at the same time.
Reimplemented from SoDataSet.
SoDEPRECATED SoVolumeData* SoVolumeData::subSetting | ( | const SbBox3i32 & | region | ) |
Extracts the data volume defined by region.
If a reader is specified, the original volume data is not loaded.
SoDEPRECATED SoVolumeData* SoVolumeData::subSetting | ( | const SbBox3s & | region | ) |
Use subSetting( const SbBox3i32& region ).
virtual SbBool SoVolumeData::undoEditing | ( | int | transactionId | ) | [virtual] |
Undo all modifications associated with the specified transaction id. Returns true if successful. On error does nothing. May only be called after the specified transaction has been terminated (see finishEditing() method). Schedules a redraw so the correct data is displayed.Note: Undo is no longer available after transactions are saved. After calling saveEditing(), the transaction ids are no longer valid and the modified data is the new reference.
Reimplemented from SoDataSet.
SoDEPRECATED void SoVolumeData::unSample | ( | ) |
Forces VolumeViz to unsample in order to get the best quality by using the maximum texture memory.
SoDEPRECATED void SoVolumeData::updateRegions | ( | const SbBox3s * | region, | |
int | num_regions | |||
) |
Use updateRegions( const SbBox3i32*, int ).
void SoVolumeData::updateRegions | ( | const SbBox3i32 * | region, | |
int | num_regions | |||
) |
Updates regions of the volume that have been modified.
This method notifies VolumeViz that voxels in the specified regions have been modified by the application and textures may need to be recreated. Only bricks currently needed for rendering some volume geometry, e.g., a slice or subvolume, are immediately updated.
void SoVolumeData::updateTilesInTextureMemory | ( | SoLDMTileID * | tiles, | |
int | numTiles | |||
) |
Reloads textures corresponding to the given tile IDs.
Only supported in LDM mode. Useful for a bottom-up approach (a custom tile manager starts loading full resolution and returns fake data for lower resolution. Once the real low resolution data is in memory, update).
Converts the specified box in voxel coordinates to geometric coordinates.
Correctly converts coordinates that are outside the volume dimensions, but the resulting geometric coordinate is outside the volume extent.
Converts the specified point in voxel coordinates to geometric coordinates.
The left bottom coordinate of the voxel is returned. Correctly converts coordinates that are outside the volume dimensions, but the resulting geometric coordinate is outside the volume extent.
Converts the specified box in geometric coordinates to voxel coordinates.
Correctly converts coordinates that are outside the volume extent, but the resulting voxel coordinate is outside the volume dimensions.
Converts the specified point in geometric coordinates to voxel coordinates.
Correctly converts coordinates that are outside the volume extent, but the resulting voxel coordinate is outside the volume dimensions.
friend class SoLDMMediator::LDMManagerAccess [friend] |
Specifies the volume data, including dimensions, data type and number of significant bits.
Use this field if your volume data is already loaded into memory in a contiguous block of memory. Otherwise use the fileName field or the setReader method.
The numSigBits parameter of SoSFArray3D::setValue indicates the number of bits really used for each value. If it equals 0, that means to use all bits, e.g., 8 bits if type = UNSIGNED_BYTE, 16 bits if type = UNSIGNED_SHORT and so on. This parameter is useful particularly when textures are loaded in paletted mode. Currently most hardware supports only 8 bits, so VolumeViz must discard the least significant bits. For example if type is UNSIGNED_SHORT, by default in paletted mode VolumeViz will discard the lowest 8 bits. If you specify numSigBits = 10, VolumeViz will discard only the lowest 2 bits.
Calling SoSFArray3D::setValue with a CopyPolicy set to NO_COPY is equivalent to calling the deprecated SoVolumeData::setValue method.
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 with a memory reader. Subsequent calls to getReader() will return an SoVRMemoryReader.
NOTE: field available since Open Inventor 7.1Contains TRUE if the volume contains RGBA values rather than scalar values.
Default is FALSE.
This field is set automatically by volume readers. If the application is setting an in-memory volume into the data field, the data field must be set to UNSIGNED_INT32 format and the dataRGBA field must be set to TRUE.
Note that, for compatibility with older versions of Open Inventor, if the data is in-memory the the unsigned int values must contain ABGR values, not RGBA. Use the SbColor getPackedValueEndiannessOrder() method to convert values, not the getPackedValue() method.
NOTE: field available since Open Inventor 9.0SoDEPRECATED SoSFEnum SoVolumeData::storageHint |
Indicates how the data is stored in Open Inventor/OpenGL.
Since OIV 8.6, only 3D textures are supported, other values are ignored. Use enum StorageHint.
If TRUE, VolumeViz stores an additional copy of each loaded tile.
There is an additional memory cost but the performance of SoOrthoSlice roaming will be roughly the same along each axis.
NOTE: field available since Open Inventor 6.0For a volume containing scalar data values, controls whether scalar values (true) or RGBA values (false) are loaded on the GPU (the name is historical).
The default is true, meaning to load scalar values on the GPU. This implies that the GPU will interpolate between data values and the GPU will apply the color map. Using scalar values has several advantages and is the recommended setting in most cases. Loading scalar values (generally) uses less GPU memory per voxel and the color map can be changed interactively because no volume data needs to be reloaded on the GPU. Also note that interpolating between color values (rather than data values) could result in unexpected colors that are not even part of the color map. The size (in bytes) of the scalar values on the GPU is determined by the texturePrecision field.
If this field is false, the color map is applied on the CPU and the resulting RGBA values are loaded on the GPU. This implies that the GPU will interpolate between color values. There are a few cases where this setting is better. For example, interpolating between data values could create values that not actually in the data set. Also, applying the color map on the CPU means that a very large color map can be used because the size is not limited by the maximum texture size on the GPU.
If the volume contains explicit RGBA values, then this field is ignored and RGBA values are sent to the GPU.
Note: On graphics boards that support programmable shaders, this field is ignored (virtually all graphics boards support programmable shaders).
Controls use of the OpenGL shared texture palette extension (if available). FALSE means don't use it. Default is TRUE. On machines that support paletted textures, using a shared palette conserves texture memory because a single palette (color map) can be used for all the textures.
SoDEPRECATED SoSFInt32 SoVolumeData::volumeDataId |