Ortho slice shape node. More...
#include <VolumeViz/nodes/SoOrthoSlice.h>
Public Types | |
enum | Axis { X, Y, Z } |
enum | ClippingSide { FRONT, BACK } |
Public Member Functions | |
virtual SoType | getTypeId () const |
SoOrthoSlice () | |
virtual SbBool | affectsState () const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoSFInt32 | dataSetId |
SoSFUInt32 | sliceNumber |
SoSFEnum | axis |
SoSFEnum | clippingSide |
SoSFBool | clipping |
SoSFBool | enableBorder |
SoSFColor | borderColor |
SoSFFloat | borderWidth |
SoSFBool | enableImage |
This node defines an ortho (axis aligned) slice along the X, Y, or Z axis of the volume data defined by an SoVolumeData node. The slice orientation and position are defined by the axis and sliceNumber fields.
The SoVolumeData node can be specified with dataSetId. When this field is set to 0, the last SoVolumeData node on state is used.
For a non-RGBA (scalar valued) volume, each voxel's RGBA value is determined by the current SoDataRange and SoTransferFunction. The current diffuse color and transparency (set, for example, with an SoMaterial node) modifies the appearance of the slice. This means that, for example, the current transparency can be used as an global alpha value to modulate the overall opacity of the slice. For an RGBA volume each voxel's RGBA value comes directly from the volume data.
The interpolation field controls how the texture is interpolated.
The alphaUse field (SoSlice) controls how the voxel's alpha component is used when drawing the slice.
Optionally a bump mapping effect may be applied. Normal vectors are automatically computed from the data value gradient. The enableBumpMapping and bumpScale fields (SoSlice) control whether bump mapping is active and the intensity of the effect.
Notes:
vec3 VVizTextureToTextureVec(in VVizDataSetId datasetSrc, in VVizDataSetId datasetDst, in vec3 texCoord);
Note that some of the property nodes (data, material, color map, etc) will typically be shared by multiple rendering nodes. In other words the volume usually only needs to be loaded once, using a single SoVolumeData node, then multiple slices and/or regions can be rendered using that data node.
Also note that this example is for a data volume, where each voxel can be considered a discrete sample from a continuous data field and interpolation should be used to compute values between voxel centers. If you are rendering a label volume, then each voxel is an "id" assigning that voxel to a specific material, object, etc. In this case, set the interpolation field to NEAREST to disable interpolation.
// Default setting can be a performance bottleneck SoPreferences::setValue( "LDM_USE_IN_MEM_COMPRESSION", "0" ); // Keeps volume viz separate from geometry SoSeparator* volSep = new SoSeparator(); root->addChild( volSep ); // Loads volume data SoVolumeData* volData = new SoVolumeData(); volData->fileName = "$OIVHOME/examples/data/VolumeViz/3DHead.vol"; volSep->addChild( volData ); // Sets range of data values to visualize. // Not required for 8-bit voxels, critical for larger data types. // The getMinMax() call may be expensive for non-LDM file formats. SoDataRange* volRange = new SoDataRange(); if (volData->getDatumSize() > 1) { double minVal, maxVal; volData->getMinMax( minVal, maxVal ); volRange->min = minVal; volRange->max = maxVal; } volSep->addChild( volRange ); // Loads opaque intensity ramp SoTransferFunction* volTF = new SoTransferFunction(); volTF->predefColorMap = SoTransferFunction::INTENSITY; volSep->addChild( volTF ); // Displays slice at full intensity SoMaterial* volMat = new SoMaterial(); volMat->diffuseColor.setValue( 1, 1, 1 ); volSep->addChild( volMat ); // Removes tile boundary artifacts while moving. SoVolumeShader* volShader = new SoVolumeShader(); volShader->interpolateOnMove = TRUE; volSep->addChild( volShader ); // Displays a Z axis slice at center of volume SoOrthoSlice* slice = new SoOrthoSlice(); SbVec3i32 voldim = volData->data.getSize(); slice->axis = SoOrthoSlice::Z; slice->sliceNumber = voldim[2] / 2; slice->interpolation = SoOrthoSlice::MULTISAMPLE_12; volSep->addChild( slice );
dataSetId | 0 |
sliceNumber | 0 |
axis | Z |
interpolation | LINEAR |
alphaUse | ALPHA_BINARY |
useRGBA | FALSE |
clipping | FALSE |
clippingSide | BACK |
alternateRep | NULL |
enableBumpMapping | FALSE |
bumpScale | 1.0 |
enableBorder | FALSE |
borderColor | 0.84 0.43 0.02 |
borderWidth | 2.0 |
enableImage | TRUE |
SoGetBoundingBoxAction
Computes the bounding box that encloses the slice.
SoDataRange, SoObliqueSlice, SoOrthoSliceDragger, SoROI, SoSlice, SoTransferFunction, SoVolumeData
MedicalImageFilterToggle, MedicalImageFilterWipe, MedicalDicomImageViewer, MedicalMPRViewer, MedicalIntensityAnisotropy, MedicalVolumeTextureCompose, MedicalGammaCorrection, MedicalOrthoSlice, MedicalOrthoSliceBorder, MedicalImageSegmentationFloodFill, MedicalMagicGlass, MedicalMagnifier, MedicalRuler, MedicalZoom, MedicalImageViewerRemote, MedicalMPRViewerRemote, LargeSliceSupport, AmplitudeVelocity, SimpleSliceRGBA, UndefinedVoxel, VolRend, VolumeTransform, VVIZ-Template-SG
enum SoOrthoSlice::Axis |
SoOrthoSlice::SoOrthoSlice | ( | ) |
Constructor.
virtual SbBool SoOrthoSlice::affectsState | ( | ) | const [virtual] |
static SoType SoOrthoSlice::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoSlice.
Reimplemented in OrthoSliceBorder.
virtual SoType SoOrthoSlice::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoSlice.
Reimplemented in OrthoSliceBorder.
Slice axis (X, Y, or Z).
Use enum Axis. Default is Z.
Border color.
Default is [0.84, 0.43, 0.02] (orange luminance 55%).
NOTE: field available since Open Inventor 10.10Border width in pixels.
Default is 2. For more information about borderWidth units: see SoDrawStyle::lineWidth
NOTE: field available since Open Inventor 10.10Activate/deactivate a clipping plane on a per-slice basis.
Optionally, this node also defines a clipping plane. Similar to SoClipPlane, this clipping plane affects all subsequent geometry, including SoVolumeRender, but does not of course affect the ortho slice itself. The clippingSide field controls which half-space is clipped.
Specifies the clipping side.
Use enum ClippingSide. Default is BACK. Clipping side FRONT means that the clip plane (removes) clips away geometry in the positive direction on the slice axis. BACK means that the clip plane clips away geometry in the negative direction on the slice axis.
These figures show an ortho slice clipping a data volume.
Right:
Bottom left:
Bottom right:
| |
| |
Specifies the SoVolumeData node to use.
This is useful when datasets of different dimensions are present in the scene graph. Please see SoMultiDataSeparator for more details.
When set to 0, the last SoVolumeData node on state is used. Default is 0.
NOTE: field available since Open Inventor 10.11.0Enables drawing the slice image.
Default is true. Note that setting this field to false makes the slice image invisible, but the slice is still detectable by picking if the border is enabled.
Example of a typical use case : The folling code shows how to use a boolean engine to disable the image rendering while dragging.
SoRef<SoBoolOperation> engine = new SoBoolOperation; engine->a.connectFrom(&dragger->isActive); orthoslice->enableImage.connectFrom(&engine->inverse);
Another typical usecase is if you want to display the slice image in a 2D view and also show only the slice position in a 3D view (without the slice image).
NOTE: field available since Open Inventor 10.10Slice number.