Slicer  5.3
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
[legend]
Collaboration diagram for vtkSlicerVolumeRenderingLogic:
Collaboration graph
[legend]

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=nullptr, bool appendToEnd=false)
 
vtkMRMLShaderPropertyNodeAddShaderPropertyFromFile (const char *filename)
 
vtkMRMLVolumePropertyNodeAddVolumePropertyFromFile (const char *filename)
 
void AddVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *node)
 
void ChangeVolumeRenderingMethod (const char *displayNodeClassName=nullptr)
 
void CopyDisplayToVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *node, vtkMRMLVolumeDisplayNode *displayNode=nullptr)
 
void CopyLabelMapDisplayToVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *volumeRenderingDisplayNode, vtkMRMLLabelMapVolumeDisplayNode *labelMapDisplayNode=nullptr)
 
void CopyScalarDisplayToVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *volumeRenderingDisplayNode, vtkMRMLScalarVolumeDisplayNode *scalarDisplayNode=nullptr)
 
vtkMRMLVolumeRenderingDisplayNodeCreateDefaultVolumeRenderingNodes (vtkMRMLVolumeNode *volumeNode)
 
vtkMRMLDisplayableNodeCreateROINode (vtkMRMLVolumeRenderingDisplayNode *displayNode)
 Create cropping ROI node, if does not exist yet. More...
 
vtkMRMLVolumeRenderingDisplayNodeCreateVolumeRenderingDisplayNode (const char *renderingClassName=nullptr)
 
void FitROIToVolume (vtkMRMLVolumeRenderingDisplayNode *vspNode)
 
virtual const char * GetClassName ()
 
virtual char * GetDefaultRenderingMethod ()
 
virtual std::string GetDefaultROIClassName ()
 
vtkMRMLVolumeRenderingDisplayNodeGetFirstVolumeRenderingDisplayNode (vtkMRMLVolumeNode *volumeNode)
 Find first volume rendering display node. More...
 
vtkMRMLVolumeRenderingDisplayNodeGetFirstVolumeRenderingDisplayNodeByROINode (vtkMRMLNode *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) 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 *)
 
virtual void SetDefaultROIClassName (std::string)
 
void SetGradientOpacityToVolumeProp (double scalarRange[2], vtkVolumeProperty *node)
 
void SetLabelMapToVolumeProp (vtkScalarsToColors *lut, vtkVolumeProperty *node)
 
bool SetRecommendedVolumeRenderingProperties (vtkMRMLVolumeRenderingDisplayNode *vrDisplayNode)
 
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=nullptr, vtkMRMLNode *roiNode=nullptr, bool createROI=true)
 
void UpdateTranferFunctionRangeFromImage (vtkMRMLVolumeRenderingDisplayNode *vspNode)
 
- Public Member Functions inherited from vtkSlicerModuleLogic
virtual vtkSlicerApplicationLogicGetApplicationLogic ()
 Get access to overall application state. More...
 
virtual vtkMRMLAbstractLogicGetModuleLogic (const char *moduleName)
 Convenience method for getting another module's logic from the application logic. More...
 
std::string GetModuleShareDirectory () const
 
void PrintSelf (ostream &os, vtkIndent indent) 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) 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 () override
 Reimplemented to initialize display nodes in the scene. More...
 
void OnMRMLNodeModified (vtkMRMLNode *node) override
 
void OnMRMLSceneNodeAdded (vtkMRMLNode *node) override
 
void OnMRMLSceneNodeRemoved (vtkMRMLNode *node) override
 
void RegisterNodes () override
 
void SetMRMLSceneInternal (vtkMRMLScene *scene) override
 
void UpdateVolumeRenderingDisplayNode (vtkMRMLVolumeRenderingDisplayNode *node)
 
 vtkSlicerVolumeRenderingLogic ()
 
 ~vtkSlicerVolumeRenderingLogic () override
 
- Protected Member Functions inherited from vtkSlicerModuleLogic
 vtkSlicerModuleLogic ()
 
 ~vtkSlicerModuleLogic () override
 
- 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 ()
 
void Modified () 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=nullptr)
 
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 ()
 
 ~vtkMRMLAbstractLogic () override
 

Protected Attributes

char * DefaultRenderingMethod
 
std::string DefaultROIClassName
 
DisplayNodesType DisplayNodes
 
vtkMRMLScenePresetsScene
 
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->CreateVolumeRenderingDisplayNode();
logic->UpdateDisplayNodeFromVolumeNode(displayNode, volumeNode);

Definition at line 58 of file vtkSlicerVolumeRenderingLogic.h.

Member Typedef Documentation

◆ DisplayNodesType

Definition at line 362 of file vtkSlicerVolumeRenderingLogic.h.

◆ Superclass

Definition at line 64 of file vtkSlicerVolumeRenderingLogic.h.

Constructor & Destructor Documentation

◆ vtkSlicerVolumeRenderingLogic()

vtkSlicerVolumeRenderingLogic::vtkSlicerVolumeRenderingLogic ( )
protected

◆ ~vtkSlicerVolumeRenderingLogic()

vtkSlicerVolumeRenderingLogic::~vtkSlicerVolumeRenderingLogic ( )
overrideprotected

Member Function Documentation

◆ AddAllVolumeRenderingDisplayNodes()

void vtkSlicerVolumeRenderingLogic::AddAllVolumeRenderingDisplayNodes ( )

Observe all the volume rendering display nodes of the scene.

See also
AddVolumeRenderingDisplayNode

◆ AddPreset()

void vtkSlicerVolumeRenderingLogic::AddPreset ( vtkMRMLVolumePropertyNode preset,
vtkImageData *  icon = nullptr,
bool  appendToEnd = false 
)

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.

Parameters
appendToEndcontrols if the preset is added before or after existing presets.
See also
GetPresetsScene(), GetIconVolumeReferenceRole()

◆ AddShaderPropertyFromFile()

vtkMRMLShaderPropertyNode* vtkSlicerVolumeRenderingLogic::AddShaderPropertyFromFile ( const char *  filename)

Load from file and add into the scene a shader property.

See also
vtkMRMLShaderPropertyStorageNode

◆ AddVolumePropertyFromFile()

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

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

See also
vtkMRMLVolumePropertyStorageNode

◆ 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
vtkMRMLVolumeRenderingDisplayNode::FollowVolumeDisplayNode
RemoveVolumeRenderingDisplayNode

◆ ChangeVolumeRenderingMethod()

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

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 = nullptr 
)

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
CopyScalarDisplayToVolumeRenderingDisplayNode()
CopyLabelMapDisplayToVolumeRenderingDisplayNode()

◆ CopyLabelMapDisplayToVolumeRenderingDisplayNode()

void vtkSlicerVolumeRenderingLogic::CopyLabelMapDisplayToVolumeRenderingDisplayNode ( vtkMRMLVolumeRenderingDisplayNode volumeRenderingDisplayNode,
vtkMRMLLabelMapVolumeDisplayNode labelMapDisplayNode = nullptr 
)

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
CopyDisplayToVolumeRenderingDisplayNode()
CopyScalarDisplayToVolumeRenderingDisplayNode()

◆ CopyScalarDisplayToVolumeRenderingDisplayNode()

void vtkSlicerVolumeRenderingLogic::CopyScalarDisplayToVolumeRenderingDisplayNode ( vtkMRMLVolumeRenderingDisplayNode volumeRenderingDisplayNode,
vtkMRMLScalarVolumeDisplayNode scalarDisplayNode = nullptr 
)

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
CopyDisplayToVolumeRenderingDisplayNode()
CopyLabelMapDisplayToVolumeRenderingDisplayNode()

◆ 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 can be created by calling CreateROINode() method.

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.

Returns
Volume rendering display node for the given volume

◆ CreateROINode()

vtkMRMLDisplayableNode* vtkSlicerVolumeRenderingLogic::CreateROINode ( vtkMRMLVolumeRenderingDisplayNode displayNode)

Create cropping ROI node, if does not exist yet.

◆ CreateVolumeRenderingDisplayNode()

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

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
DefaultRenderingMethod

◆ 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
vtkMRMLVolumeRenderingDisplayNode::GetROINode

◆ GetClassName()

virtual const char* vtkSlicerVolumeRenderingLogic::GetClassName ( )
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ GetDefaultRenderingMethod()

virtual char* vtkSlicerVolumeRenderingLogic::GetDefaultRenderingMethod ( )
virtual

◆ GetDefaultROIClassName()

virtual std::string vtkSlicerVolumeRenderingLogic::GetDefaultROIClassName ( )
virtual

◆ GetFirstVolumeRenderingDisplayNode()

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::GetFirstVolumeRenderingDisplayNode ( vtkMRMLVolumeNode volumeNode)

Find first volume rendering display node.

◆ GetFirstVolumeRenderingDisplayNodeByROINode()

vtkMRMLVolumeRenderingDisplayNode* vtkSlicerVolumeRenderingLogic::GetFirstVolumeRenderingDisplayNodeByROINode ( vtkMRMLNode roiNode)

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

◆ GetIconVolumeReferenceRole()

static const char* vtkSlicerVolumeRenderingLogic::GetIconVolumeReferenceRole ( )
inlinestatic

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 312 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 ( )
virtual

◆ 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)
virtual

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)
static

◆ LoadCustomPresetsScene()

int vtkSlicerVolumeRenderingLogic::LoadCustomPresetsScene ( const char *  sceneFilePath)

Use custom presets scene

Returns
Nonzero if successfully loaded

◆ LoadPresets()

bool vtkSlicerVolumeRenderingLogic::LoadPresets ( vtkMRMLScene scene)
protected

◆ New()

static vtkSlicerVolumeRenderingLogic* vtkSlicerVolumeRenderingLogic::New ( )
static

◆ ObserveMRMLScene()

void vtkSlicerVolumeRenderingLogic::ObserveMRMLScene ( )
overrideprotectedvirtual

Reimplemented to initialize display nodes in the scene.

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLNodeModified()

void vtkSlicerVolumeRenderingLogic::OnMRMLNodeModified ( vtkMRMLNode )
overrideprotectedvirtual

Called after the corresponding MRML event is triggered.

See also
ProcessMRMLNodesEvents

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneNodeAdded()

void vtkSlicerVolumeRenderingLogic::OnMRMLSceneNodeAdded ( vtkMRMLNode )
overrideprotectedvirtual

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 )
overrideprotectedvirtual

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 
)
override

◆ RegisterNodes()

void vtkSlicerVolumeRenderingLogic::RegisterNodes ( )
overrideprotectedvirtual

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
GetRenderingMethods

◆ 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
AddVolumeRenderingDisplayNode

◆ SafeDownCast()

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

◆ SetDefaultRenderingMethod()

virtual void vtkSlicerVolumeRenderingLogic::SetDefaultRenderingMethod ( const char *  )
virtual

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

See also
CreateVolumeRenderingDisplayNode()

◆ SetDefaultROIClassName()

virtual void vtkSlicerVolumeRenderingLogic::SetDefaultROIClassName ( std::string  )
virtual

◆ 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()

void vtkSlicerVolumeRenderingLogic::SetMRMLSceneInternal ( vtkMRMLScene newScene)
overrideprotectedvirtual

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()
UpdateFromMRMLScene()

Reimplemented from vtkMRMLAbstractLogic.

◆ SetRecommendedVolumeRenderingProperties()

bool vtkSlicerVolumeRenderingLogic::SetRecommendedVolumeRenderingProperties ( vtkMRMLVolumeRenderingDisplayNode vrDisplayNode)

Set volume rendering properties that seems well suited for the volume. The function uses heuristics to detect what kind of volume it is (CT, MRI, other), based on its intensity range and choses preset accordingly. Returns false is volume type could not be detected and so properties are not changed.

◆ 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
    SetWindowLevelToVolumeProp()

◆ SetUseLinearRamp()

virtual void vtkSlicerVolumeRenderingLogic::SetUseLinearRamp ( bool  )
virtual

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
CopyScalarDisplayToVolumeRenderingDisplayNode()

◆ 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
SetThresholdToVolumeProp

◆ UpdateDisplayNodeFromVolumeNode()

void vtkSlicerVolumeRenderingLogic::UpdateDisplayNodeFromVolumeNode ( vtkMRMLVolumeRenderingDisplayNode displayNode,
vtkMRMLVolumeNode volumeNode,
vtkMRMLVolumePropertyNode propNode = nullptr,
vtkMRMLNode roiNode = nullptr,
bool  createROI = true 
)

Update DisplayNode from VolumeNode, Can pass a VolumePropertyNode and an ROI node to be the display node. If they are nullptr 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)
protected

Member Data Documentation

◆ DefaultRenderingMethod

char* vtkSlicerVolumeRenderingLogic::DefaultRenderingMethod
protected

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 358 of file vtkSlicerVolumeRenderingLogic.h.

◆ DefaultROIClassName

std::string vtkSlicerVolumeRenderingLogic::DefaultROIClassName
protected

Definition at line 368 of file vtkSlicerVolumeRenderingLogic.h.

◆ DisplayNodes

DisplayNodesType vtkSlicerVolumeRenderingLogic::DisplayNodes
protected

Definition at line 363 of file vtkSlicerVolumeRenderingLogic.h.

◆ PresetsScene

vtkMRMLScene* vtkSlicerVolumeRenderingLogic::PresetsScene
protected

Definition at line 366 of file vtkSlicerVolumeRenderingLogic.h.

◆ RenderingMethods

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

Definition at line 351 of file vtkSlicerVolumeRenderingLogic.h.

◆ UseLinearRamp

bool vtkSlicerVolumeRenderingLogic::UseLinearRamp
protected

Definition at line 360 of file vtkSlicerVolumeRenderingLogic.h.


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