SoVolumeMask Class Reference
[Nodes]

VolumeViz Volume mask. More...

#include <VolumeViz/nodes/SoVolumeMask.h>

Inheritance diagram for SoVolumeMask:
SoVolumeData SoDataSet SoVolumeRendering SoNode SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Member Functions

virtual SoType getTypeId () const
 SoVolumeMask ()
virtual int editSubVolume (const SbBox3i32 &subVolume, SoBufferObject *userData)
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)
bool saveEditing (SbString filename, bool recomputeLowerResolution=TRUE, const std::vector< char * >=std::vector< char * >(), SaveEditingCB callback=NULL)
void setDefaultValue (const bool defValue)
bool getDefaultValue () const

Static Public Member Functions

static SoType getClassTypeId ()

Detailed Description

VolumeViz Volume mask.

This node specifies an arbitrary voxel-based region of a volume data set (SoVolumeData). A volume mask is itself a data volume consisting of binary values. Zero values are "false" and non-zero values are "true". A large number of masks may be defined simultaneously, using an SoVolumeMask node for each one, and mask regions may overlap if desired.

SoVolumeMask is derived from SoVolumeData. Like SoVolumeData it accesses its data through an SoVolumeReader class. I.e. the data may be in a file or in memory (or any data source using a custom volume reader). The mask volume can be any data type, but unsigned byte is currently the most memory efficient representation.

SoVolumeMask nodes must follow these rules:

SoVolumeMask can be used to clip the data volume on a per-voxel basis. But the mask mechanism is much more powerful than that. Each region can have its own transfer function (color map) using SoTransferFunction nodes. Each region can also have its own draw style (volume rendering, isosurface or boundary) using SoVolumeDataDrawStyle nodes. Each region, including the original unmasked volume, is only visible if there exists a transfer function (SoTransferFunction) with the same id value.

Mask regions:

A single SoVolumeMask node effectively defines two regions:

Because intersecting regions are allowed, two SoVolumeMask nodes define (up to) four regions:

Each additional mask defines one additional region (voxels that are true only in that mask).

In addition, if there exists a transfer function with the same id as the original volume (SoVolumeData node), the color value from that transfer function is combined with the color value from the mask region's transfer function.

Transfer functions:

A separate transfer function can be specified for each of these regions using SoTransferFunction nodes. The transfer function nodes may be placed under the SoVolumeMaskGroup node, but this is not required.

NOTE: It is not currently possible to specify a different data range for each mask.

Draw Styles:

A separate draw style can be specified for each mask region and for the intersection voxels (but not for false voxels) using SoVolumeDataDrawStyle nodes:

Data Range:

SoVolumeMask currently does not support separate data ranges for each mask region. The same SoDataRange will be applied on all regions.

FILE FORMAT/DEFAULT

SEE ALSO

SoVolumeDataDrawStyle, SoVolumeRender, SoOrthoSlice, SoObliqueSlice, SoVolumeReader, SoVolumeSkin, SoVolumeMask, SoVolumeMaskGroup, SoMultiDataSeparator

See related examples:

MedicalSimpleVolumeMask, SimpleVolumeMask, VolumeDataDrawStyle, SimpleVolumeMaskEditing


Constructor & Destructor Documentation

SoVolumeMask::SoVolumeMask (  ) 

Constructor.


Member Function Documentation

virtual int SoVolumeMask::editSolidShape ( const SoNode solidShape,
const double &  value 
) [virtual]

Replace all voxels inside the given shape with the specified value.

Returns 0 if successful.

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.
  • Only VolumeMask with data size of 1 (ie. byte or unsigned byte) can be edited.
  • All zero values are set to zero and all non-zero values are set to 1.

Call startEditing() before calling this method.

Reimplemented from SoVolumeData.

virtual int SoVolumeMask::editSubVolume ( const SbBox3i32 subVolume,
const double &  value 
) [virtual]

Replace the contents of a subvolume with the specified value.

Returns 0 if successful.

  • The subvolume is specified in voxel/cell coordinates.
  • Only an SoVolumeMask with data size of 1 (ie. byte or unsigned byte) can be edited.
  • All zero values are set to zero and all non-zero values are set to 1.

Call startEditing() before calling this method.

Reimplemented from SoVolumeData.

virtual int SoVolumeMask::editSubVolume ( const SbBox3i32 subVolume,
SoBufferObject userData 
) [virtual]

Replace the contents of a subvolume with the given data.

Returns 0 if successful.

  • The subvolume is specified in voxel/cell coordinates.
  • The buffer size (in bytes) must match the subvolume size (in bytes) exactly.
  • Only an SoVolumeMask with data size of 1 (ie. byte or unsigned byte) can be edited. This implies that dataType of userData must be byte or unsigned byte.
  • warning : userData must be an SoCpuBufferBitSet.

Call startEditing() before calling this method.

Reimplemented from SoVolumeData.

virtual int SoVolumeMask::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.

Returns 0 if successful.

  • 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.
  • Only an SoVolumeMask with data size of 1 (ie. byte or unsigned byte) can be edited.
  • All zero values are set to zero and all non-zero values are set to 1.

Call startEditing() before calling this method.

Reimplemented from SoVolumeData.

static SoType SoVolumeMask::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoVolumeData.

bool SoVolumeMask::getDefaultValue (  )  const

Returns default value of the volume mask.

Reimplemented from SoVolumeData.

virtual SoType SoVolumeMask::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoVolumeData.

bool SoVolumeMask::saveEditing ( SbString  filename,
bool  recomputeLowerResolution = TRUE,
const std::vector< char * >  = std::vector< char * >(),
SaveEditingCB  callback = NULL 
)

Save editing done on the volume mask data.

Returns true if save was successful.

void SoVolumeMask::setDefaultValue ( const bool  defValue  ) 

Set default value of the volume mask.

Default is 0.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 28 Oct 2019
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/