Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
vtkSlicerVolumeRenderingLogic Class Reference

#include <Modules/Loadable/VolumeRendering/Logic/vtkSlicerVolumeRenderingLogic.h>

Inheritance diagram for vtkSlicerVolumeRenderingLogic:
Inheritance graph
Collaboration diagram for vtkSlicerVolumeRenderingLogic:
Collaboration graph

Public Types

typedef vtkSlicerModuleLogic Superclass
- Public Types inherited from vtkSlicerModuleLogic
typedef vtkMRMLAbstractLogic Superclass
- Public Types inherited from vtkMRMLAbstractLogic
typedef vtkObject Superclass
typedef void(vtkMRMLAbstractLogic::* TaskFunctionPointer) (void *clientdata)

Public Member Functions

void AddAllVolumeRenderingDisplayNodes ()
void AddPreset (vtkMRMLVolumePropertyNode *preset, vtkImageData *icon=NULL)
vtkMRMLVolumePropertyNodeAddVolumePropertyFromFile (const char *filename)
void AddVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *node)
void ChangeVolumeRenderingMethod (const char *displayNodeClassName=0)
void CopyDisplayToVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *node, vtkMRMLVolumeDisplayNode *displayNode=0)
void CopyLabelMapDisplayToVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *volumeRenderingDisplayNode, vtkMRMLLabelMapVolumeDisplayNode *labelMapDisplayNode=0)
void CopyScalarDisplayToVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *volumeRenderingDisplayNode, vtkMRMLScalarVolumeDisplayNode *scalarDisplayNode=0)
vtkMRMLVolumeRenderingDisplayNodeCreateDefaultVolumeRenderingNodes (vtkMRMLVolumeNode *volumeNode)
vtkMRMLVolumeRenderingDisplayNodeCreateVolumeRenderingDisplayNode (const char *renderingClassName=0)
void FitROIToVolume (vtkMRMLVolumeRenderingDisplayNode *vspNode)
virtual const char * GetClassName ()
virtual char * GetDefaultRenderingMethod ()
vtkMRMLVolumeRenderingDisplayNodeGetFirstVolumeRenderingDisplayNode (vtkMRMLVolumeNode *volumeNode)
 Find first volume rendering display node. More...
vtkMRMLVolumeRenderingDisplayNodeGetFirstVolumeRenderingDisplayNodeByROINode (vtkMRMLAnnotationROINode *roiNode)
 Find the first volume rendering display node that uses the ROI. More...
vtkMRMLVolumePropertyNodeGetPresetByName (const char *presetName)
vtkMRMLSceneGetPresetsScene ()
std::map< std::string, std::string > GetRenderingMethods ()
virtual bool GetUseLinearRamp ()
vtkMRMLVolumeRenderingDisplayNodeGetVolumeRenderingDisplayNodeByID (vtkMRMLVolumeNode *volumeNode, char *displayNodeID)
 Find volume rendering display node reference in the volume. More...
vtkMRMLVolumeRenderingDisplayNodeGetVolumeRenderingDisplayNodeForViewNode (vtkMRMLVolumeNode *volumeNode, vtkMRMLViewNode *viewNode)
 Find volume rendering display node referencing the view node and volume node. More...
vtkMRMLVolumeRenderingDisplayNodeGetVolumeRenderingDisplayNodeForViewNode (vtkMRMLViewNode *viewNode)
 Find volume rendering display node referencing the view node in the scene. More...
virtual int IsA (const char *type)
bool IsDifferentFunction (vtkPiecewiseFunction *function1, vtkPiecewiseFunction *function2) const
bool IsDifferentFunction (vtkColorTransferFunction *function1, vtkColorTransferFunction *function2) const
int LoadCustomPresetsScene (const char *sceneFilePath)
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
void RegisterRenderingMethod (const char *methodName, const char *displayNodeClassName)
void RemoveAllVolumeRenderingDisplayNodes ()
void RemovePreset (vtkMRMLVolumePropertyNode *preset)
void RemoveViewFromVolumeDisplayNodes (vtkMRMLVolumeNode *volumeNode, vtkMRMLViewNode *viewNode)
 Remove ViewNode from VolumeRenderingDisplayNode for a VolumeNode,. More...
void RemoveVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *node)
virtual void SetDefaultRenderingMethod (const char *)
void SetGradientOpacityToVolumeProp (double scalarRange[2], vtkVolumeProperty *node)
void SetLabelMapToVolumeProp (vtkScalarsToColors *lut, vtkVolumeProperty *node)
void SetThresholdToVolumeProp (double scalarRange[2], double threshold[2], vtkVolumeProperty *node, bool linearRamp=false, bool stayUpAtUpperLimit=false)
virtual void SetUseLinearRamp (bool)
void SetWindowLevelToVolumeProp (double scalarRange[2], double windowLevel[2], vtkLookupTable *lut, vtkVolumeProperty *node)
void UpdateDisplayNodeFromVolumeNode (vtkMRMLVolumeRenderingDisplayNode *displayNode, vtkMRMLVolumeNode *volumeNode, vtkMRMLVolumePropertyNode *propNode=NULL, vtkMRMLAnnotationROINode *roiNode=NULL)
void UpdateTranferFunctionRangeFromImage (vtkMRMLVolumeRenderingDisplayNode *vspNode)
- Public Member Functions inherited from vtkSlicerModuleLogic
virtual vtkSlicerApplicationLogicGetApplicationLogic ()
 Get access to overall application state. More...
std::string GetModuleShareDirectory () const
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
void SetModuleShareDirectory (const std::string &shareDirectory)
- Public Member Functions inherited from vtkMRMLAbstractLogic
virtual vtkMRMLApplicationLogicGetMRMLApplicationLogic () const
 Get access to overall application state. More...
vtkMRMLSceneGetMRMLScene () const
 Return a reference to the current MRML scene. More...
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual void SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic)
void SetMRMLScene (vtkMRMLScene *newScene)
 Set and observe the MRMLScene. More...

Static Public Member Functions

static const char * GetIconVolumeReferenceRole ()
static int IsTypeOf (const char *type)
static vtkSlicerVolumeRenderingLogicNew ()
static vtkSlicerVolumeRenderingLogicSafeDownCast (vtkObject *o)
- Static Public Member Functions inherited from vtkSlicerModuleLogic
static int IsTypeOf (const char *type)
static vtkSlicerModuleLogicNew ()
 The Usual vtk class functions. More...
static vtkSlicerModuleLogicSafeDownCast (vtkObject *o)
- Static Public Member Functions inherited from vtkMRMLAbstractLogic
static int IsTypeOf (const char *type)
static vtkMRMLAbstractLogicNew ()
static vtkMRMLAbstractLogicSafeDownCast (vtkObject *o)

Protected Types

typedef std::vector< vtkMRMLNode * > DisplayNodesType

Protected Member Functions

bool LoadPresets (vtkMRMLScene *scene)
void ObserveMRMLScene () VTK_OVERRIDE
 Reimplemented to initialize display nodes in the scene. More...
void OnMRMLNodeModified (vtkMRMLNode *node) VTK_OVERRIDE
void OnMRMLSceneNodeAdded (vtkMRMLNode *node) VTK_OVERRIDE
void OnMRMLSceneNodeRemoved (vtkMRMLNode *node) VTK_OVERRIDE
virtual void RegisterNodes () VTK_OVERRIDE
virtual void SetMRMLSceneInternal (vtkMRMLScene *scene) VTK_OVERRIDE
void UpdateVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *node)
 vtkSlicerVolumeRenderingLogic ()
virtual ~vtkSlicerVolumeRenderingLogic ()
- Protected Member Functions inherited from vtkSlicerModuleLogic
 vtkSlicerModuleLogic ()
virtual ~vtkSlicerModuleLogic ()
- Protected Member Functions inherited from vtkMRMLAbstractLogic
int EndModify (bool wasModifying)
virtual bool EnterMRMLLogicsCallback () const
virtual bool EnterMRMLNodesCallback () const
virtual bool EnterMRMLSceneCallback () const
bool GetDisableModifiedEvent () const
int GetInMRMLLogicsCallbackFlag () const
int GetInMRMLNodesCallbackFlag () const
int GetInMRMLSceneCallbackFlag () const
vtkCallbackCommand * GetMRMLLogicsCallbackCommand ()
vtkObserverManagerGetMRMLLogicsObserverManager () const
vtkCallbackCommand * GetMRMLNodesCallbackCommand ()
vtkObserverManagerGetMRMLNodesObserverManager () const
vtkCallbackCommand * GetMRMLSceneCallbackCommand ()
vtkObserverManagerGetMRMLSceneObserverManager () const
int GetPendingModifiedEventCount () const
int GetProcessingMRMLSceneEvent () const
 Return the event id currently processed or 0 if any. More...
int InvokePendingModifiedEvent ()
virtual void Modified () VTK_OVERRIDE
virtual void OnMRMLSceneEndBatchProcess ()
virtual void OnMRMLSceneEndClose ()
virtual void OnMRMLSceneEndImport ()
virtual void OnMRMLSceneEndRestore ()
virtual void OnMRMLSceneNew ()
virtual void OnMRMLSceneStartBatchProcess ()
virtual void OnMRMLSceneStartClose ()
virtual void OnMRMLSceneStartImport ()
virtual void OnMRMLSceneStartRestore ()
virtual void ProcessMRMLLogicsEvents (vtkObject *caller, unsigned long event, void *callData)
virtual void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData)
virtual void ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData)
void SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=0)
void SetDisableModifiedEvent (bool onOff)
void SetInMRMLLogicsCallbackFlag (int flag)
void SetInMRMLNodesCallbackFlag (int flag)
void SetInMRMLSceneCallbackFlag (int flag)
void SetProcessingMRMLSceneEvent (int event)
bool StartModify ()
virtual void UnobserveMRMLScene ()
virtual void UpdateFromMRMLScene ()
 vtkMRMLAbstractLogic ()
virtual ~vtkMRMLAbstractLogic ()

Protected Attributes

char * DefaultRenderingMethod
DisplayNodesType DisplayNodes
std::map< std::string, std::string > RenderingMethods
bool UseLinearRamp

Additional Inherited Members

- Static Protected Member Functions inherited from vtkMRMLAbstractLogic
static void MRMLLogicsCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLLogicCallback is a static function to relay modified events from the logics. More...
static void MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLNodesCallback is a static function to relay modified events from the nodes. More...
static void MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)

Detailed Description

Collection of utility methods to control the Volume Rendering nodes. The fastest to volume render of vtkMRMLVolumeNode is to use CreateVolumeRenderingDisplayNode() and UpdateDisplayNodeFromVolumeNode():

logic->UpdateDisplayNodeFromVolumeNode(displayNode, volumeNode);

Definition at line 57 of file vtkSlicerVolumeRenderingLogic.h.

Member Typedef Documentation

◆ DisplayNodesType

Definition at line 341 of file vtkSlicerVolumeRenderingLogic.h.

◆ Superclass

Definition at line 63 of file vtkSlicerVolumeRenderingLogic.h.

Constructor & Destructor Documentation

◆ vtkSlicerVolumeRenderingLogic()

vtkSlicerVolumeRenderingLogic::vtkSlicerVolumeRenderingLogic ( )

◆ ~vtkSlicerVolumeRenderingLogic()

virtual vtkSlicerVolumeRenderingLogic::~vtkSlicerVolumeRenderingLogic ( )

Member Function Documentation

◆ AddAllVolumeRenderingDisplayNodes()

void vtkSlicerVolumeRenderingLogic::AddAllVolumeRenderingDisplayNodes ( )

Observe all the volume rendering display nodes of the scene.

See also

◆ AddPreset()

void vtkSlicerVolumeRenderingLogic::AddPreset ( vtkMRMLVolumePropertyNode preset,
vtkImageData *  icon = NULL 

Add a preset to the preset scene. If the optional icon image is specified then that will be used to in preset selector widgets. The icon is stored as a volume node in the preset scene.

See also
GetPresetsScene(), GetIconVolumeReferenceRole()

◆ AddVolumePropertyFromFile()

vtkMRMLVolumePropertyNode* vtkSlicerVolumeRenderingLogic::AddVolumePropertyFromFile ( const char *  filename)

Load from file and add into the scene a transfer function.

See also

◆ AddVolumeRenderingDisplayNode()

void vtkSlicerVolumeRenderingLogic::AddVolumeRenderingDisplayNode ( vtkMRMLVolumeRenderingDisplayNode node)

Observe the volume rendering display node to copy the volume display node if needed. This function is called automatically when a display node is added into the scene. You shouldn't have to call it.

See also

◆ ChangeVolumeRenderingMethod()

void vtkSlicerVolumeRenderingLogic::ChangeVolumeRenderingMethod ( const char *  displayNodeClassName = 0)

Re-create all volume rendering display nodes of the requested type. Common properties of the display nodes are propagated.

◆ CopyDisplayToVolumeRenderingDisplayNode()

void vtkSlicerVolumeRenderingLogic::CopyDisplayToVolumeRenderingDisplayNode ( vtkMRMLVolumeRenderingDisplayNode node,
vtkMRMLVolumeDisplayNode displayNode = 0 

Applies the properties (window level, threshold and color function) of a volume display node to the volume rendering display node. If displayNode is 0, it uses the first display node. It's a utility method that internally calls CopyScalarDisplayToVolumeRenderingDisplayNode() or CopyLabelMapDisplayToVolumeRenderingDisplayNode() based on the type of displayNode.

See also

◆ CopyLabelMapDisplayToVolumeRenderingDisplayNode()

void vtkSlicerVolumeRenderingLogic::CopyLabelMapDisplayToVolumeRenderingDisplayNode ( vtkMRMLVolumeRenderingDisplayNode volumeRenderingDisplayNode,
vtkMRMLLabelMapVolumeDisplayNode labelMapDisplayNode = 0 

Applies the properties (threshold ) of the labelmap display node to the volume rendering displaynode. If labelMapDisplayNode is 0, it uses the first displaynode.

See also

◆ CopyScalarDisplayToVolumeRenderingDisplayNode()

void vtkSlicerVolumeRenderingLogic::CopyScalarDisplayToVolumeRenderingDisplayNode ( vtkMRMLVolumeRenderingDisplayNode volumeRenderingDisplayNode,
vtkMRMLScalarVolumeDisplayNode scalarDisplayNode = 0 

Applies the properties (window level, threshold and color function) of the scalar display node to the volume rendering displaynode. If scalarDisplayNode is 0, it uses the first display node.

See also

◆ CreateDefaultVolumeRenderingNodes()

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::CreateDefaultVolumeRenderingNodes ( vtkMRMLVolumeNode volumeNode)

Create and set up all nodes needed for volume rendering for a given volume node:

  • Display node according to the selected rendering method
  • Volume property node for display options
  • ROI node for cropping When dealing with a volume node that may not have been shown in volume rendering before, it's enough to call this function to prepare them for that. After this, only SetVisibility needs to be called on its display node for showing it. Does not create new nodes if they exist already.
    Volume rendering display node for the given volume

◆ CreateVolumeRenderingDisplayNode()

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::CreateVolumeRenderingDisplayNode ( const char *  renderingClassName = 0)

Create a volume rendering display node. The node to instantiate will be of type renderingType if not null, DefaultRenderingMethod if not null or vtkMRMLCPURayCastVolumeRenderingDisplayNode in that order. Return the created node or 0 if there is no scene or the class name doesn't exist. If renderingClassName is 0, the returned node has a name generated using "VolumeRendering" as base name. You are responsible for deleting the node (read more about it in the section Get, New, Create, CreateAndAdd).

See also

◆ FitROIToVolume()

void vtkSlicerVolumeRenderingLogic::FitROIToVolume ( vtkMRMLVolumeRenderingDisplayNode vspNode)

Utility function that modifies the ROI node of the display node to fit the boundaries of the volume node

See also

◆ GetClassName()

virtual const char* vtkSlicerVolumeRenderingLogic::GetClassName ( )

Reimplemented from vtkSlicerModuleLogic.

◆ GetDefaultRenderingMethod()

virtual char* vtkSlicerVolumeRenderingLogic::GetDefaultRenderingMethod ( )

◆ GetFirstVolumeRenderingDisplayNode()

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::GetFirstVolumeRenderingDisplayNode ( vtkMRMLVolumeNode volumeNode)

Find first volume rendering display node.

◆ GetFirstVolumeRenderingDisplayNodeByROINode()

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::GetFirstVolumeRenderingDisplayNodeByROINode ( vtkMRMLAnnotationROINode roiNode)

Find the first volume rendering display node that uses the ROI.

◆ GetIconVolumeReferenceRole()

static const char* vtkSlicerVolumeRenderingLogic::GetIconVolumeReferenceRole ( )

This node reference role name allows linking from a preset node to a volume node that contains an icon for the preset node. For example, the icon is used for representing the node in qSlicerPresetComboBox.

Definition at line 294 of file vtkSlicerVolumeRenderingLogic.h.

◆ GetPresetByName()

vtkMRMLVolumePropertyNode* vtkSlicerVolumeRenderingLogic::GetPresetByName ( const char *  presetName)

Return the preset presetName contained in the presets scene loaded using GetPresetsScene(). If no presets are found, return 0. If multiple presets are found, the first one is returned.

See also
GetPresetsScene(), vtkMRMLVolumePropertyNode

◆ GetPresetsScene()

vtkMRMLScene* vtkSlicerVolumeRenderingLogic::GetPresetsScene ( )

Return the scene containing the volume rendering presets. If there is no presets scene, a scene is created and presets are loaded into. The presets scene is loaded from a file (presets.xml) located in the module share directory

See also
vtkMRMLVolumePropertyNode, GetModuleShareDirectory()

◆ GetRenderingMethods()

std::map<std::string, std::string> vtkSlicerVolumeRenderingLogic::GetRenderingMethods ( )

◆ GetUseLinearRamp()

virtual bool vtkSlicerVolumeRenderingLogic::GetUseLinearRamp ( )

◆ GetVolumeRenderingDisplayNodeByID()

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::GetVolumeRenderingDisplayNodeByID ( vtkMRMLVolumeNode volumeNode,
char *  displayNodeID 

Find volume rendering display node reference in the volume.

◆ GetVolumeRenderingDisplayNodeForViewNode() [1/2]

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::GetVolumeRenderingDisplayNodeForViewNode ( vtkMRMLVolumeNode volumeNode,
vtkMRMLViewNode viewNode 

Find volume rendering display node referencing the view node and volume node.

◆ GetVolumeRenderingDisplayNodeForViewNode() [2/2]

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::GetVolumeRenderingDisplayNodeForViewNode ( vtkMRMLViewNode viewNode)

Find volume rendering display node referencing the view node in the scene.

◆ IsA()

virtual int vtkSlicerVolumeRenderingLogic::IsA ( const char *  type)

Reimplemented from vtkSlicerModuleLogic.

◆ IsDifferentFunction() [1/2]

bool vtkSlicerVolumeRenderingLogic::IsDifferentFunction ( vtkPiecewiseFunction *  function1,
vtkPiecewiseFunction *  function2 
) const

Utility function that checks if the piecewise functions are equal Returns true if different

◆ IsDifferentFunction() [2/2]

bool vtkSlicerVolumeRenderingLogic::IsDifferentFunction ( vtkColorTransferFunction *  function1,
vtkColorTransferFunction *  function2 
) const

Utility function that checks if the color transfer functions are equal Returns true if different

◆ IsTypeOf()

static int vtkSlicerVolumeRenderingLogic::IsTypeOf ( const char *  type)

◆ LoadCustomPresetsScene()

int vtkSlicerVolumeRenderingLogic::LoadCustomPresetsScene ( const char *  sceneFilePath)

Use custom presets scene

Nonzero if successfully loaded

◆ LoadPresets()

bool vtkSlicerVolumeRenderingLogic::LoadPresets ( vtkMRMLScene scene)

◆ New()

static vtkSlicerVolumeRenderingLogic* vtkSlicerVolumeRenderingLogic::New ( )

◆ ObserveMRMLScene()

void vtkSlicerVolumeRenderingLogic::ObserveMRMLScene ( )

Reimplemented to initialize display nodes in the scene.

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLNodeModified()

void vtkSlicerVolumeRenderingLogic::OnMRMLNodeModified ( vtkMRMLNode )

Called after the corresponding MRML event is triggered.

See also

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneNodeAdded()

void vtkSlicerVolumeRenderingLogic::OnMRMLSceneNodeAdded ( vtkMRMLNode )

If vtkMRMLScene::NodeAddedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneNodeRemoved, vtkMRMLScene::NodeAboutToBeAdded

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneNodeRemoved()

void vtkSlicerVolumeRenderingLogic::OnMRMLSceneNodeRemoved ( vtkMRMLNode )

If vtkMRMLScene::NodeRemovedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneNodeAdded, vtkMRMLScene::NodeAboutToBeRemoved

Reimplemented from vtkMRMLAbstractLogic.

◆ PrintSelf()

void vtkSlicerVolumeRenderingLogic::PrintSelf ( ostream &  os,
vtkIndent  indent 

◆ RegisterNodes()

virtual void vtkSlicerVolumeRenderingLogic::RegisterNodes ( )

Register node classes into the MRML scene. Called each time a new scene is set. Do nothing by default. Can be reimplemented in derivated classes.

Reimplemented from vtkMRMLAbstractLogic.

◆ RegisterRenderingMethod()

void vtkSlicerVolumeRenderingLogic::RegisterRenderingMethod ( const char *  methodName,
const char *  displayNodeClassName 

Inform the logic and observers that a rendering method (class deriving from vtkMRMLVolumeRenderingDisplayNode) is available. The event ModifiedEvent gets fired.

See also

◆ RemoveAllVolumeRenderingDisplayNodes()

void vtkSlicerVolumeRenderingLogic::RemoveAllVolumeRenderingDisplayNodes ( )

Unobserve all the volume rendering display nodes of the scene.

See also
AddVolumeRenderingDisplayNode, AddAllVolumeRenderingDisplayNodes

◆ RemovePreset()

void vtkSlicerVolumeRenderingLogic::RemovePreset ( vtkMRMLVolumePropertyNode preset)

Removes a preset and its associated icon (if specified) from the preset scene.

See also
GetPresetsScene(), GetIconVolumeReferenceRole()

◆ RemoveViewFromVolumeDisplayNodes()

void vtkSlicerVolumeRenderingLogic::RemoveViewFromVolumeDisplayNodes ( vtkMRMLVolumeNode volumeNode,
vtkMRMLViewNode viewNode 

Remove ViewNode from VolumeRenderingDisplayNode for a VolumeNode,.

◆ RemoveVolumeRenderingDisplayNode()

void vtkSlicerVolumeRenderingLogic::RemoveVolumeRenderingDisplayNode ( vtkMRMLVolumeRenderingDisplayNode node)

Unobserve the volume rendering display node.

See also

◆ SafeDownCast()

static vtkSlicerVolumeRenderingLogic* vtkSlicerVolumeRenderingLogic::SafeDownCast ( vtkObject *  o)

◆ SetDefaultRenderingMethod()

virtual void vtkSlicerVolumeRenderingLogic::SetDefaultRenderingMethod ( const char *  )

The default rendering method is set to display nodes created in CreateVolumeRenderingDisplayNode(). If no rendering method is given the VTKCPURayCast is instantiated.

See also

◆ SetGradientOpacityToVolumeProp()

void vtkSlicerVolumeRenderingLogic::SetGradientOpacityToVolumeProp ( double  scalarRange[2],
vtkVolumeProperty *  node 

Create an opacity transfer function for gradient opacity. It ranges from 0 to scalarRange[1] - scalarRange[0].

See also
SetThresholdToVolumeProp, SetWindowLevelToVolumeProp

◆ SetLabelMapToVolumeProp()

void vtkSlicerVolumeRenderingLogic::SetLabelMapToVolumeProp ( vtkScalarsToColors *  lut,
vtkVolumeProperty *  node 

Generate and set to the volume property node an opacity and color transfer function from the labelmap LUT colors.

See also
SetWindowLevelToVolumeProp, SetThresholdToVolumeProp

◆ SetMRMLSceneInternal()

virtual void vtkSlicerVolumeRenderingLogic::SetMRMLSceneInternal ( vtkMRMLScene newScene)

Called each time a new scene is set. Can be reimplemented in derivated classes. Doesn't observe the scene by default, that means that UpdateFromMRMLScene() won't be called by default when a scene is imported, closed or restored, only when a new scene is set.

See also
SetAndObserveMRMLSceneInternal() SetAndObserveMRMLSceneEventsInternal()

Reimplemented from vtkMRMLAbstractLogic.

◆ SetThresholdToVolumeProp()

void vtkSlicerVolumeRenderingLogic::SetThresholdToVolumeProp ( double  scalarRange[2],
double  threshold[2],
vtkVolumeProperty *  node,
bool  linearRamp = false,
bool  stayUpAtUpperLimit = false 

Applies a threshold to a volume property

  • scalarRange is the entire range of the transfer function
  • threshold is the range where the threshold is applied
  • node is the container of the transfer function to save
  • linearRamp controls the shape of the threshold:
    ///  true:            false:    _
    ///        __/|__            __| |__
  • stayUpAtUpperLimit controls whether the threshold not maxed out:
    ///  true:    ______  false:
    ///        __/               __/|_____
    See also

◆ SetUseLinearRamp()

virtual void vtkSlicerVolumeRenderingLogic::SetUseLinearRamp ( bool  )

Use a linear ramp (true) or a sharp ramp (false) when copying the volume display node threshold values into the volume rendering display node. True by default.

See also

◆ SetWindowLevelToVolumeProp()

void vtkSlicerVolumeRenderingLogic::SetWindowLevelToVolumeProp ( double  scalarRange[2],
double  windowLevel[2],
vtkLookupTable *  lut,
vtkVolumeProperty *  node 

Create a color transfer function that ranges from scalarRange[0] to scalarRange[1] and containing a windowLevel[0] wide ramp centered on level:

///                         max = level + window/2      scalarRange[1]
///                         .___________________________.
///  .____________________./
///  scalarRange[0]       min = level - window/2

The generated transfer function contains at least 4 points located in:

  • scalarRange[0]
  • min = level - window/2
  • max = level + window/2
  • scalarRange[1]

If lut is 0, the colors go from black (0, 0, 0) to white (1, 1, 1) If lut contains only 1 value, that color is used for all the generated points. If lut contains more than 1 value, each color is used in the ramp. The generated transfer function will be made of lut->size() + 2 points. The function is then applied to the volume property node.

See also

◆ UpdateDisplayNodeFromVolumeNode()

void vtkSlicerVolumeRenderingLogic::UpdateDisplayNodeFromVolumeNode ( vtkMRMLVolumeRenderingDisplayNode displayNode,
vtkMRMLVolumeNode volumeNode,
vtkMRMLVolumePropertyNode propNode = NULL,
vtkMRMLAnnotationROINode roiNode = NULL 

Update DisplayNode from VolumeNode, Can pass a VolumePropertyNode and a AnnotationROINode to be the display node. If they are NULL and the display node does not already have any, new ones will be created then set and observed to the display node.

◆ UpdateTranferFunctionRangeFromImage()

void vtkSlicerVolumeRenderingLogic::UpdateTranferFunctionRangeFromImage ( vtkMRMLVolumeRenderingDisplayNode vspNode)

◆ UpdateVolumeRenderingDisplayNode()

void vtkSlicerVolumeRenderingLogic::UpdateVolumeRenderingDisplayNode ( vtkMRMLVolumeRenderingDisplayNode node)

Member Data Documentation

◆ DefaultRenderingMethod

char* vtkSlicerVolumeRenderingLogic::DefaultRenderingMethod

This property holds the default rendering method to instantiate in CreateVolumeRenderingDisplayNode(). If no rendering method is given, the VTKCPURayCast technique is instantiated.

See also
SetDefaultRenderingMethod(), GetDefaultRenderingMethod(), CreateVolumeRenderingDisplayNode()

Definition at line 337 of file vtkSlicerVolumeRenderingLogic.h.

◆ DisplayNodes

DisplayNodesType vtkSlicerVolumeRenderingLogic::DisplayNodes

Definition at line 342 of file vtkSlicerVolumeRenderingLogic.h.

◆ PresetsScene

vtkMRMLScene* vtkSlicerVolumeRenderingLogic::PresetsScene

Definition at line 345 of file vtkSlicerVolumeRenderingLogic.h.

◆ RenderingMethods

std::map<std::string, std::string> vtkSlicerVolumeRenderingLogic::RenderingMethods

Definition at line 330 of file vtkSlicerVolumeRenderingLogic.h.

◆ UseLinearRamp

bool vtkSlicerVolumeRenderingLogic::UseLinearRamp

Definition at line 339 of file vtkSlicerVolumeRenderingLogic.h.

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