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 | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
vtkMRMLSliceLogic Class Reference

Slicer logic class for slice manipulation. More...

#include <Libs/MRML/Logic/vtkMRMLSliceLogic.h>

Inheritance diagram for vtkMRMLSliceLogic:
Inheritance graph
[legend]
Collaboration diagram for vtkMRMLSliceLogic:
Collaboration graph
[legend]

Public Types

enum  { CompositeModifiedEvent = 18000 }
 CompositeModifiedEvent is generated when slice composite node is modified. More...
 
enum  { LayerNone = -1, LayerBackground = 0, LayerForeground = 1, LayerLabel = 2 }
 
typedef vtkMRMLAbstractLogic Superclass
 
- Public Types inherited from vtkMRMLAbstractLogic
typedef vtkObject Superclass
 
typedef void(vtkMRMLAbstractLogic::* TaskFunctionPointer) (void *clientdata)
 

Public Member Functions

vtkMRMLSliceNodeAddSliceNode (const char *layoutName)
 Convenience function for adding a slice node and setting it in this logic. More...
 
void CreateSliceModel ()
 
Make a slice model with the current configuration More...
 
void DeleteSliceModel ()
 
void EndSliceCompositeNodeInteraction ()
 Indicate an interaction with the slice composite node has been completed. More...
 
void EndSliceNodeInteraction ()
 Indicate an interaction with the slice node has been completed. More...
 
void EndSliceOffsetInteraction ()
 Indicate the slice offset value has completed its change. More...
 
virtual bool EnterMRMLCallback () const
 
void FitFOVToBackground (double fov)
 
void FitSliceToAll (int width=-1, int height=-1)
 
void FitSliceToBackground (int width, int height)
 
adjust the node's field of view to match the extent of current background volume More...
 
void FitSliceToVolume (vtkMRMLVolumeNode *volumeNode, int width, int height)
 
adjust the node's field of view to match the extent of current background volume More...
 
virtual vtkMRMLSliceLayerLogicGetBackgroundLayer ()
 
void GetBackgroundRASBox (double rasDimensions[3], double rasCenter[3])
 
Get the size of the volume, transformed to RAS space More...
 
void GetBackgroundSliceBounds (double sliceBounds[6])
 
void GetBackgroundSliceDimensions (double sliceDimensions[3], double sliceCenter[3])
 
Get the size of the volume, transformed to slice space More...
 
double * GetBackgroundSliceSpacing ()
 
void GetBackgroundWindowLevelAndRange (double &window, double &level, double &rangeLow, double &rangeHigh, bool &autoWindowLevel)
 
void GetBackgroundWindowLevelAndRange (double &window, double &level, double &rangeLow, double &rangeHigh)
 
Helper to get the background layer Window/Level and intensity range More...
 
vtkImageBlend * GetBlend ()
 
vtkImageBlend * GetBlendUVW ()
 
virtual const char * GetClassName ()
 
int GetEditableLayerAtWorldPosition (double worldPos[3], bool backgroundVolumeEditable=true, bool foregroundVolumeEditable=true)
 
virtual vtkImageReslice * GetExtractModelTexture ()
 
virtual vtkMRMLSliceLayerLogicGetForegroundLayer ()
 
void GetForegroundWindowLevelAndRange (double &window, double &level, double &rangeLow, double &rangeHigh, bool &autoWindowLevel)
 
void GetForegroundWindowLevelAndRange (double &window, double &level, double &rangeLow, double &rangeHigh)
 
Helper to get the foreground layer Window/Level and intensity range More...
 
vtkAlgorithmOutput * GetImageDataConnection ()
 
virtual vtkMRMLSliceLayerLogicGetLabelLayer ()
 
vtkMRMLVolumeNodeGetLayerVolumeNode (int layer)
 
void GetLowestVolumeSliceBounds (double sliceBounds[6], bool useVoxelCenter=false)
 
double * GetLowestVolumeSliceSpacing ()
 
std::vector< vtkMRMLDisplayNode * > GetPolyDataDisplayNodes ()
 
Get all slice displaynodes creating PolyData models like glyphs etc. More...
 
void GetSliceBounds (double sliceBounds[6])
 
Get the largest slice bounding box for all volumes in layers More...
 
virtual vtkMRMLSliceCompositeNodeGetSliceCompositeNode ()
 
The MRML slice node for this slice logic More...
 
vtkMRMLSliceDisplayNodeGetSliceDisplayNode ()
 
Slice plane display properties More...
 
int GetSliceIndexFromOffset (double sliceOffset, vtkMRMLVolumeNode *volumeNode)
 
int GetSliceIndexFromOffset (double sliceOffset)
 
virtual vtkMRMLModelDisplayNodeGetSliceModelDisplayNode ()
 
virtual vtkMRMLModelNodeGetSliceModelNode ()
 
Model slice plane More...
 
virtual vtkMRMLLinearTransformNodeGetSliceModelTransformNode ()
 
Model slice plane transform from xy to RAS More...
 
virtual vtkMRMLSliceNodeGetSliceNode ()
 
The MRML slice node for this slice logic More...
 
double GetSliceOffset ()
 
Get/Set the current distance from the origin to the slice plane More...
 
void GetVolumeSliceBounds (vtkMRMLVolumeNode *volumeNode, double sliceBounds[6], bool useVoxelCenter=false)
 
void GetVolumeSliceDimensions (vtkMRMLVolumeNode *volumeNode, double sliceDimensions[3], double sliceCenter[3])
 
Get the size of the volume, transformed to slice space More...
 
double * GetVolumeSliceSpacing (vtkMRMLVolumeNode *volumeNode)
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void ResizeSliceNode (double newWidth, double newHeight)
 
void RotateSliceToLowestVolumeAxes (bool forceSlicePlaneToSingleSlice=true)
 
void SetBackgroundLayer (vtkMRMLSliceLayerLogic *BackgroundLayer)
 
void SetBackgroundWindowLevel (double window, double level)
 
Helper to set the background layer Window/Level More...
 
void SetForegroundLayer (vtkMRMLSliceLayerLogic *ForegroundLayer)
 
void SetForegroundWindowLevel (double window, double level)
 
Helper to set the foreground layer Window/Level More...
 
void SetLabelLayer (vtkMRMLSliceLayerLogic *LabelLayer)
 
void SetSliceCompositeNode (vtkMRMLSliceCompositeNode *SliceCompositeNode)
 
void SetSliceExtentsToSliceNode ()
 
Set slice extents to all layers More...
 
void SetSliceNode (vtkMRMLSliceNode *newSliceNode)
 
void SetSliceOffset (double offset)
 
void SnapSliceOffsetToIJK ()
 
void StartSliceCompositeNodeInteraction (unsigned int parameters)
 
void StartSliceNodeInteraction (unsigned int parameters)
 
void StartSliceOffsetInteraction ()
 Indicate the slice offset value is starting to change. More...
 
void UpdateImageData ()
 Internally used by UpdatePipeline. More...
 
void UpdatePipeline ()
 
update the pipeline to reflect the current state of the nodes More...
 
void UpdateSliceCompositeNode ()
 
Manage and synchronise the SliceCompositeNode More...
 
void UpdateSliceNode ()
 
Manage and synchronise the SliceNode More...
 
void UpdateSliceNodeFromLayout ()
 
Update slicer node given a layout name More...
 
- 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 vtkMRMLSliceCompositeNodeGetSliceCompositeNode (vtkMRMLSliceNode *node)
 Return the associated slicerlayer nodes. More...
 
static vtkMRMLSliceNodeGetSliceNode (vtkMRMLSliceCompositeNode *node)
 Return the associated slice node. More...
 
static void GetVolumeRASBox (vtkMRMLVolumeNode *volumeNode, double rasDimensions[3], double rasCenter[3])
 
Get the size of the volume, transformed to RAS space More...
 
static bool IsSliceModelDisplayNode (vtkMRMLDisplayNode *mrmlDisplayNode)
 
static bool IsSliceModelNode (vtkMRMLNode *mrmlNode)
 
static int IsTypeOf (const char *type)
 
static vtkMRMLSliceLogicNew ()
 The Usual VTK class functions. More...
 
static vtkMRMLSliceLogicSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLAbstractLogic
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractLogicNew ()
 
static vtkMRMLAbstractLogicSafeDownCast (vtkObject *o)
 

Static Public Attributes

static const int SLICE_INDEX_NO_VOLUME
 
static const int SLICE_INDEX_OUT_OF_VOLUME
 
static const int SLICE_INDEX_ROTATED
 
static const std::string SLICE_MODEL_NODE_NAME_SUFFIX
 

Protected Member Functions

bool IsEventInsideVolume (bool background, double worldPos[3])
 
void OnMRMLNodeModified (vtkMRMLNode *node) override
 
void OnMRMLSceneEndImport () override
 
void OnMRMLSceneEndRestore () override
 
void OnMRMLSceneNodeAdded (vtkMRMLNode *node) override
 
void OnMRMLSceneNodeRemoved (vtkMRMLNode *node) override
 
void OnMRMLSceneStartClose () override
 
void ProcessMRMLLogicsEvents (vtkObject *caller, unsigned long event, void *callData) override
 
process logic events More...
 
void ProcessMRMLLogicsEvents ()
 
void SetMRMLSceneInternal (vtkMRMLScene *newScene) override
 
void SetupCrosshairNode ()
 
void SetWindowLevel (double window, double level, int layer)
 
Helper to set Window/Level in any layer More...
 
bool UpdateBlendLayers (vtkImageBlend *blend, const std::deque< SliceLayerInfo > &layers)
 
void UpdateFromMRMLScene () override
 
void UpdateSliceNodes ()
 
bool VolumeWindowLevelEditable (const char *volumeNodeID)
 Returns true if the volume's window/level values are editable on the GUI. More...
 
 vtkMRMLSliceLogic ()
 
 ~vtkMRMLSliceLogic () 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 ObserveMRMLScene ()
 
virtual void OnMRMLSceneEndBatchProcess ()
 
virtual void OnMRMLSceneEndClose ()
 
virtual void OnMRMLSceneNew ()
 
virtual void OnMRMLSceneStartBatchProcess ()
 
virtual void OnMRMLSceneStartImport ()
 
virtual void OnMRMLSceneStartRestore ()
 
virtual void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void RegisterNodes ()
 
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 ()
 
 vtkMRMLAbstractLogic ()
 
 ~vtkMRMLAbstractLogic () override
 

Static Protected Member Functions

static vtkMRMLSliceCompositeNodeGetSliceCompositeNode (vtkMRMLScene *scene, const char *layoutName)
 
static vtkMRMLSliceNodeGetSliceNode (vtkMRMLScene *scene, const char *layoutName)
 
- 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)
 

Protected Attributes

bool AddingSliceModelNodes
 
vtkMRMLSliceLayerLogicBackgroundLayer
 
vtkImageReslice * ExtractModelTexture
 
vtkMRMLSliceLayerLogicForegroundLayer
 
vtkAlgorithmOutput * ImageDataConnection
 
vtkMRMLSliceLayerLogicLabelLayer
 
BlendPipeline * Pipeline
 
BlendPipeline * PipelineUVW
 
vtkMRMLSliceCompositeNodeSliceCompositeNode
 
vtkMRMLModelDisplayNodeSliceModelDisplayNode
 
vtkMRMLModelNodeSliceModelNode
 
vtkMRMLLinearTransformNodeSliceModelTransformNode
 
vtkMRMLSliceNodeSliceNode
 
double SliceSpacing [3]
 

Detailed Description

Slicer logic class for slice manipulation.

This class manages the logic associated with display of slice windows (but not the GUI). Features of the class include: – a back-to-front list of MrmlVolumes to be displayed – a compositing mode for each volume layer (opacity, outline, glyph, checkerboard, etc) – each layer is required to provide an RGBA image in the space defined by the vtkMRMLSliceNode

This class manages internal vtk pipelines that create an output vtkImageData which can be used by the vtkSlicerSliceGUI class to display the resulting composite image or it can be used as a texture map in a vtkSlicerView. This class can also be used for resampling volumes for further computation.

Definition at line 58 of file vtkMRMLSliceLogic.h.

Member Typedef Documentation

◆ Superclass

Definition at line 63 of file vtkMRMLSliceLogic.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

CompositeModifiedEvent is generated when slice composite node is modified.

Enumerator
CompositeModifiedEvent 

Definition at line 67 of file vtkMRMLSliceLogic.h.

◆ anonymous enum

anonymous enum
Enumerator
LayerNone 
LayerBackground 
LayerForeground 
LayerLabel 

Definition at line 72 of file vtkMRMLSliceLogic.h.

Constructor & Destructor Documentation

◆ vtkMRMLSliceLogic()

vtkMRMLSliceLogic::vtkMRMLSliceLogic ( )
protected

◆ ~vtkMRMLSliceLogic()

vtkMRMLSliceLogic::~vtkMRMLSliceLogic ( )
overrideprotected

Member Function Documentation

◆ AddSliceNode()

vtkMRMLSliceNode* vtkMRMLSliceLogic::AddSliceNode ( const char *  layoutName)

Convenience function for adding a slice node and setting it in this logic.

◆ CreateSliceModel()

void vtkMRMLSliceLogic::CreateSliceModel ( )


Make a slice model with the current configuration

◆ DeleteSliceModel()

void vtkMRMLSliceLogic::DeleteSliceModel ( )

◆ EndSliceCompositeNodeInteraction()

void vtkMRMLSliceLogic::EndSliceCompositeNodeInteraction ( )

Indicate an interaction with the slice composite node has been completed.

◆ EndSliceNodeInteraction()

void vtkMRMLSliceLogic::EndSliceNodeInteraction ( )

Indicate an interaction with the slice node has been completed.

◆ EndSliceOffsetInteraction()

void vtkMRMLSliceLogic::EndSliceOffsetInteraction ( )

Indicate the slice offset value has completed its change.

◆ EnterMRMLCallback()

virtual bool vtkMRMLSliceLogic::EnterMRMLCallback ( ) const
virtual

Reimplemented to avoir calling ProcessMRMLSceneEvents when we are added the MRMLModelNode into the scene

◆ FitFOVToBackground()

void vtkMRMLSliceLogic::FitFOVToBackground ( double  fov)

adjust the node's field of view to match the FOV the value fov will be applied to the smallest slice window dimension

◆ FitSliceToAll()

void vtkMRMLSliceLogic::FitSliceToAll ( int  width = -1,
int  height = -1 
)

adjust the node's field of view to match the extent of all volume layers (fits to first non-null layer)

◆ FitSliceToBackground()

void vtkMRMLSliceLogic::FitSliceToBackground ( int  width,
int  height 
)


adjust the node's field of view to match the extent of current background volume

◆ FitSliceToVolume()

void vtkMRMLSliceLogic::FitSliceToVolume ( vtkMRMLVolumeNode volumeNode,
int  width,
int  height 
)


adjust the node's field of view to match the extent of current background volume

◆ GetBackgroundLayer()

virtual vtkMRMLSliceLayerLogic* vtkMRMLSliceLogic::GetBackgroundLayer ( )
virtual

The background slice layer TODO: this will eventually be generalized to a list of layers

◆ GetBackgroundRASBox()

void vtkMRMLSliceLogic::GetBackgroundRASBox ( double  rasDimensions[3],
double  rasCenter[3] 
)


Get the size of the volume, transformed to RAS space

◆ GetBackgroundSliceBounds()

void vtkMRMLSliceLogic::GetBackgroundSliceBounds ( double  sliceBounds[6])

Get the min/max bounds of the volume

  • note these are not translated by the current slice offset so they can be used to calculate the range (e.g. of a slider) that operates in slice space

◆ GetBackgroundSliceDimensions()

void vtkMRMLSliceLogic::GetBackgroundSliceDimensions ( double  sliceDimensions[3],
double  sliceCenter[3] 
)


Get the size of the volume, transformed to slice space

◆ GetBackgroundSliceSpacing()

double* vtkMRMLSliceLogic::GetBackgroundSliceSpacing ( )

Get the spacing of the volume, transformed to slice space

  • to be used, for example, to set the slice increment for stepping a single voxel relative to the current slice view

◆ GetBackgroundWindowLevelAndRange() [1/2]

void vtkMRMLSliceLogic::GetBackgroundWindowLevelAndRange ( double &  window,
double &  level,
double &  rangeLow,
double &  rangeHigh,
bool &  autoWindowLevel 
)

Helper to get the background layer Window/Level, intensity range and status of automatic Window/Level setting

◆ GetBackgroundWindowLevelAndRange() [2/2]

void vtkMRMLSliceLogic::GetBackgroundWindowLevelAndRange ( double &  window,
double &  level,
double &  rangeLow,
double &  rangeHigh 
)


Helper to get the background layer Window/Level and intensity range

◆ GetBlend()

vtkImageBlend* vtkMRMLSliceLogic::GetBlend ( )

The compositing filter TODO: this will eventually be generalized to a per-layer compositing function

◆ GetBlendUVW()

vtkImageBlend* vtkMRMLSliceLogic::GetBlendUVW ( )

◆ GetClassName()

virtual const char* vtkMRMLSliceLogic::GetClassName ( )
virtual

Reimplemented from vtkMRMLAbstractLogic.

◆ GetEditableLayerAtWorldPosition()

int vtkMRMLSliceLogic::GetEditableLayerAtWorldPosition ( double  worldPos[3],
bool  backgroundVolumeEditable = true,
bool  foregroundVolumeEditable = true 
)

Get volume at the specified world position that should be used for interactions, such as window/level adjustments. backgroundVolumeEditable and foregroundVolumeEditable can be used specify that a volume is not editable (even if it is visible at the given position).

◆ GetExtractModelTexture()

virtual vtkImageReslice* vtkMRMLSliceLogic::GetExtractModelTexture ( )
virtual

An image reslice instance to pull a single slice from the volume that represents the filmsheet display output

◆ GetForegroundLayer()

virtual vtkMRMLSliceLayerLogic* vtkMRMLSliceLogic::GetForegroundLayer ( )
virtual

The foreground slice layer TODO: this will eventually be generalized to a list of layers

◆ GetForegroundWindowLevelAndRange() [1/2]

void vtkMRMLSliceLogic::GetForegroundWindowLevelAndRange ( double &  window,
double &  level,
double &  rangeLow,
double &  rangeHigh,
bool &  autoWindowLevel 
)

Helper to get the foreground layer Window/Level, intensity range and status of automatic Window/Level setting

◆ GetForegroundWindowLevelAndRange() [2/2]

void vtkMRMLSliceLogic::GetForegroundWindowLevelAndRange ( double &  window,
double &  level,
double &  rangeLow,
double &  rangeHigh 
)


Helper to get the foreground layer Window/Level and intensity range

◆ GetImageDataConnection()

vtkAlgorithmOutput* vtkMRMLSliceLogic::GetImageDataConnection ( )

the tail of the pipeline – returns nullptr if none of the inputs exist

◆ GetLabelLayer()

virtual vtkMRMLSliceLayerLogic* vtkMRMLSliceLogic::GetLabelLayer ( )
virtual

The Label slice layer TODO: this will eventually be generalized to a list of layers

◆ GetLayerVolumeNode()

vtkMRMLVolumeNode* vtkMRMLSliceLogic::GetLayerVolumeNode ( int  layer)

Get the volume node corresponding to layer (0=background, 1=foreground, 2=label)

◆ GetLowestVolumeSliceBounds()

void vtkMRMLSliceLogic::GetLowestVolumeSliceBounds ( double  sliceBounds[6],
bool  useVoxelCenter = false 
)

Get the min/max bounds of the lowest volume layer (background, foreground, label)

  • note these are not translated by the current slice offset so they can be used to calculate the range (e.g. of a slider) that operates in slice space
  • returns first non-null layer If useVoxelCenter is set to false (default) then bounds of voxel sides are returned (otherwise then bounds of voxels centers are returned).

◆ GetLowestVolumeSliceSpacing()

double* vtkMRMLSliceLogic::GetLowestVolumeSliceSpacing ( )

Get the spacing of the lowest volume layer (background, foreground, label), transformed to slice space

  • to be used, for example, to set the slice increment for stepping a single voxel relative to the current slice view
  • returns first non-null layer

◆ GetPolyDataDisplayNodes()

std::vector< vtkMRMLDisplayNode*> vtkMRMLSliceLogic::GetPolyDataDisplayNodes ( )


Get all slice displaynodes creating PolyData models like glyphs etc.

◆ GetSliceBounds()

void vtkMRMLSliceLogic::GetSliceBounds ( double  sliceBounds[6])


Get the largest slice bounding box for all volumes in layers

◆ GetSliceCompositeNode() [1/3]

virtual vtkMRMLSliceCompositeNode* vtkMRMLSliceLogic::GetSliceCompositeNode ( )
virtual


The MRML slice node for this slice logic

◆ GetSliceCompositeNode() [2/3]

static vtkMRMLSliceCompositeNode* vtkMRMLSliceLogic::GetSliceCompositeNode ( vtkMRMLSliceNode node)
static

Return the associated slicerlayer nodes.

◆ GetSliceCompositeNode() [3/3]

static vtkMRMLSliceCompositeNode* vtkMRMLSliceLogic::GetSliceCompositeNode ( vtkMRMLScene scene,
const char *  layoutName 
)
staticprotected

◆ GetSliceDisplayNode()

vtkMRMLSliceDisplayNode* vtkMRMLSliceLogic::GetSliceDisplayNode ( )


Slice plane display properties

◆ GetSliceIndexFromOffset() [1/2]

int vtkMRMLSliceLogic::GetSliceIndexFromOffset ( double  sliceOffset,
vtkMRMLVolumeNode volumeNode 
)

Get the DICOM slice index (1-based) from slice offset (distance from the origin to the slice plane). If the return value is negative then then no slice index can be determined: SLICE_INDEX_ROTATED=the slice is rotated compared to the volume planes, SLICE_INDEX_OUT_OF_VOLUME=the slice plane is out of the volume SLICE_INDEX_NO_VOLUME=the specified volume is not available

◆ GetSliceIndexFromOffset() [2/2]

int vtkMRMLSliceLogic::GetSliceIndexFromOffset ( double  sliceOffset)

Get the DICOM slice index (1-based) from slice offset (distance from the origin to the slice plane). Slice index is computed for the first available volume (the search order is background, foreground, label volume). If the return value is negative then then no slice index can be determined for the first available volume: SLICE_INDEX_ROTATED=the slice is rotated compared to the volume planes, SLICE_INDEX_OUT_OF_VOLUME=the slice plane is out of the volume SLICE_INDEX_NO_VOLUME=no volume is available

◆ GetSliceModelDisplayNode()

virtual vtkMRMLModelDisplayNode* vtkMRMLSliceLogic::GetSliceModelDisplayNode ( )
virtual

Model slice plane display properties. The method is deprecated, use SliceDisplayNode instead.

◆ GetSliceModelNode()

virtual vtkMRMLModelNode* vtkMRMLSliceLogic::GetSliceModelNode ( )
virtual


Model slice plane

◆ GetSliceModelTransformNode()

virtual vtkMRMLLinearTransformNode* vtkMRMLSliceLogic::GetSliceModelTransformNode ( )
virtual


Model slice plane transform from xy to RAS

◆ GetSliceNode() [1/3]

virtual vtkMRMLSliceNode* vtkMRMLSliceLogic::GetSliceNode ( )
virtual


The MRML slice node for this slice logic

◆ GetSliceNode() [2/3]

static vtkMRMLSliceNode* vtkMRMLSliceLogic::GetSliceNode ( vtkMRMLSliceCompositeNode node)
static

Return the associated slice node.

◆ GetSliceNode() [3/3]

static vtkMRMLSliceNode* vtkMRMLSliceLogic::GetSliceNode ( vtkMRMLScene scene,
const char *  layoutName 
)
staticprotected

◆ GetSliceOffset()

double vtkMRMLSliceLogic::GetSliceOffset ( )


Get/Set the current distance from the origin to the slice plane

◆ GetVolumeRASBox()

static void vtkMRMLSliceLogic::GetVolumeRASBox ( vtkMRMLVolumeNode volumeNode,
double  rasDimensions[3],
double  rasCenter[3] 
)
static


Get the size of the volume, transformed to RAS space

◆ GetVolumeSliceBounds()

void vtkMRMLSliceLogic::GetVolumeSliceBounds ( vtkMRMLVolumeNode volumeNode,
double  sliceBounds[6],
bool  useVoxelCenter = false 
)

Get the min/max bounds of the volume

  • note these are not translated by the current slice offset so they can be used to calculate the range (e.g. of a slider) that operates in slice space If useVoxelCenter is set to false (default) then bounds of voxel sides are returned (otherwise then bounds of voxels centers are returned).

◆ GetVolumeSliceDimensions()

void vtkMRMLSliceLogic::GetVolumeSliceDimensions ( vtkMRMLVolumeNode volumeNode,
double  sliceDimensions[3],
double  sliceCenter[3] 
)


Get the size of the volume, transformed to slice space

◆ GetVolumeSliceSpacing()

double* vtkMRMLSliceLogic::GetVolumeSliceSpacing ( vtkMRMLVolumeNode volumeNode)

Get the spacing of the volume, transformed to slice space

  • to be used, for example, to set the slice increment for stepping a single voxel relative to the current slice view

◆ IsA()

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

Reimplemented from vtkMRMLAbstractLogic.

◆ IsEventInsideVolume()

bool vtkMRMLSliceLogic::IsEventInsideVolume ( bool  background,
double  worldPos[3] 
)
protected

Returns true if position is inside the selected layer volume. Use background flag to choose between foreground/background layer.

◆ IsSliceModelDisplayNode()

static bool vtkMRMLSliceLogic::IsSliceModelDisplayNode ( vtkMRMLDisplayNode mrmlDisplayNode)
static

Return true if the display node is a volume slice node display node by checking the attribute SliceLogic.IsSliceModelDiplayNode Returns false if the attribute is not present, true if the attribute is present and not equal to zero

◆ IsSliceModelNode()

static bool vtkMRMLSliceLogic::IsSliceModelNode ( vtkMRMLNode mrmlNode)
static

Return true if the node is a model node that has the default volume slice node name suffix, false otherwise

See also
SLICE_MODEL_NODE_NAME_SUFFIX

◆ IsTypeOf()

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

◆ New()

static vtkMRMLSliceLogic* vtkMRMLSliceLogic::New ( )
static

The Usual VTK class functions.

◆ OnMRMLNodeModified()

void vtkMRMLSliceLogic::OnMRMLNodeModified ( vtkMRMLNode )
overrideprotectedvirtual

Called after the corresponding MRML event is triggered.

See also
ProcessMRMLNodesEvents

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneEndImport()

void vtkMRMLSliceLogic::OnMRMLSceneEndImport ( )
overrideprotectedvirtual

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

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneStartImport, OnMRMLSceneNew

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneEndRestore()

void vtkMRMLSliceLogic::OnMRMLSceneEndRestore ( )
overrideprotectedvirtual

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

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneStartRestore

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneNodeAdded()

void vtkMRMLSliceLogic::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 vtkMRMLSliceLogic::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.

◆ OnMRMLSceneStartClose()

void vtkMRMLSliceLogic::OnMRMLSceneStartClose ( )
overrideprotectedvirtual

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

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneEndClose

Reimplemented from vtkMRMLAbstractLogic.

◆ PrintSelf()

void vtkMRMLSliceLogic::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

◆ ProcessMRMLLogicsEvents() [1/2]

void vtkMRMLSliceLogic::ProcessMRMLLogicsEvents ( vtkObject *  caller,
unsigned long  event,
void *  callData 
)
overrideprotectedvirtual


process logic events

Reimplemented from vtkMRMLAbstractLogic.

◆ ProcessMRMLLogicsEvents() [2/2]

void vtkMRMLSliceLogic::ProcessMRMLLogicsEvents ( )
protected

◆ ResizeSliceNode()

void vtkMRMLSliceLogic::ResizeSliceNode ( double  newWidth,
double  newHeight 
)

Adjust dimensions and fov based on the new viewport size. The size should be the viewport size (typically vtkRenderWindow), not the size of the renderers (important if it's in a lightbox mode). It must be called each time the renderwindow size is modified and each time the lightbox configuration is changed.

◆ RotateSliceToLowestVolumeAxes()

void vtkMRMLSliceLogic::RotateSliceToLowestVolumeAxes ( bool  forceSlicePlaneToSingleSlice = true)

Rotate slice view to match axes of the lowest volume layer (background, foreground, label).

Parameters
forceSlicePlaneToSingleSliceIf the volume is single-slice and forceSlicePlaneToSingleSlice is enabled then slice view will be aligned with the volume's slice plane. If the flag is disabled of the volume has more than one slice then the slice view will be rotated to the closest orthogonal axis.

◆ SafeDownCast()

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

◆ SetBackgroundLayer()

void vtkMRMLSliceLogic::SetBackgroundLayer ( vtkMRMLSliceLayerLogic BackgroundLayer)

◆ SetBackgroundWindowLevel()

void vtkMRMLSliceLogic::SetBackgroundWindowLevel ( double  window,
double  level 
)


Helper to set the background layer Window/Level

◆ SetForegroundLayer()

void vtkMRMLSliceLogic::SetForegroundLayer ( vtkMRMLSliceLayerLogic ForegroundLayer)

◆ SetForegroundWindowLevel()

void vtkMRMLSliceLogic::SetForegroundWindowLevel ( double  window,
double  level 
)


Helper to set the foreground layer Window/Level

◆ SetLabelLayer()

void vtkMRMLSliceLogic::SetLabelLayer ( vtkMRMLSliceLayerLogic LabelLayer)

◆ SetMRMLSceneInternal()

void vtkMRMLSliceLogic::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.

◆ SetSliceCompositeNode()

void vtkMRMLSliceLogic::SetSliceCompositeNode ( vtkMRMLSliceCompositeNode SliceCompositeNode)

◆ SetSliceExtentsToSliceNode()

void vtkMRMLSliceLogic::SetSliceExtentsToSliceNode ( )


Set slice extents to all layers

◆ SetSliceNode()

void vtkMRMLSliceLogic::SetSliceNode ( vtkMRMLSliceNode newSliceNode)

◆ SetSliceOffset()

void vtkMRMLSliceLogic::SetSliceOffset ( double  offset)

◆ SetupCrosshairNode()

void vtkMRMLSliceLogic::SetupCrosshairNode ( )
protected

◆ SetWindowLevel()

void vtkMRMLSliceLogic::SetWindowLevel ( double  window,
double  level,
int  layer 
)
protected


Helper to set Window/Level in any layer

◆ SnapSliceOffsetToIJK()

void vtkMRMLSliceLogic::SnapSliceOffsetToIJK ( )

Set the current distance so that it corresponds to the closest center of a voxel in IJK space (integer value)

◆ StartSliceCompositeNodeInteraction()

void vtkMRMLSliceLogic::StartSliceCompositeNodeInteraction ( unsigned int  parameters)

Indicate an interaction with the slice composite node is beginning. The parameters of the slice node being manipulated are passed as a bitmask. See vtkMRMLSliceNode::InteractionFlagType.

◆ StartSliceNodeInteraction()

void vtkMRMLSliceLogic::StartSliceNodeInteraction ( unsigned int  parameters)

Indicate an interaction with the slice node is beginning. The parameters of the slice node being manipulated are passed as a bitmask. See vtkMRMLSliceNode::InteractionFlagType.

◆ StartSliceOffsetInteraction()

void vtkMRMLSliceLogic::StartSliceOffsetInteraction ( )

Indicate the slice offset value is starting to change.

◆ UpdateBlendLayers()

bool vtkMRMLSliceLogic::UpdateBlendLayers ( vtkImageBlend *  blend,
const std::deque< SliceLayerInfo > &  layers 
)
protected

Helper to update input of blend filter from a set of layers. It minimizes changes to the imaging pipeline (does not remove and re-add an input if it is not changed) because rebuilding of the pipeline is a relatively expensive operation.

◆ UpdateFromMRMLScene()

void vtkMRMLSliceLogic::UpdateFromMRMLScene ( )
overrideprotectedvirtual

Called every time the scene has been significantly changed. If the scene BatchProcessState events are observed (in SetMRMLSceneInternal() ), UpdateFromMRMLScene is called after each batch process (Close, Import, Restore...). It is also being called by default when a new scene is set (SetMRMLScene).

See also
SetMRMLSceneInternal, UnobserveMRMLScene, ObserveMRMLScene

Reimplemented from vtkMRMLAbstractLogic.

◆ UpdateImageData()

void vtkMRMLSliceLogic::UpdateImageData ( )

Internally used by UpdatePipeline.

◆ UpdatePipeline()

void vtkMRMLSliceLogic::UpdatePipeline ( )


update the pipeline to reflect the current state of the nodes

◆ UpdateSliceCompositeNode()

void vtkMRMLSliceLogic::UpdateSliceCompositeNode ( )


Manage and synchronise the SliceCompositeNode

◆ UpdateSliceNode()

void vtkMRMLSliceLogic::UpdateSliceNode ( )


Manage and synchronise the SliceNode

◆ UpdateSliceNodeFromLayout()

void vtkMRMLSliceLogic::UpdateSliceNodeFromLayout ( )


Update slicer node given a layout name

◆ UpdateSliceNodes()

void vtkMRMLSliceLogic::UpdateSliceNodes ( )
protected

◆ VolumeWindowLevelEditable()

bool vtkMRMLSliceLogic::VolumeWindowLevelEditable ( const char *  volumeNodeID)
protected

Returns true if the volume's window/level values are editable on the GUI.

Member Data Documentation

◆ AddingSliceModelNodes

bool vtkMRMLSliceLogic::AddingSliceModelNodes
protected

Definition at line 432 of file vtkMRMLSliceLogic.h.

◆ BackgroundLayer

vtkMRMLSliceLayerLogic* vtkMRMLSliceLogic::BackgroundLayer
protected

Definition at line 436 of file vtkMRMLSliceLogic.h.

◆ ExtractModelTexture

vtkImageReslice* vtkMRMLSliceLogic::ExtractModelTexture
protected

Definition at line 442 of file vtkMRMLSliceLogic.h.

◆ ForegroundLayer

vtkMRMLSliceLayerLogic* vtkMRMLSliceLogic::ForegroundLayer
protected

Definition at line 437 of file vtkMRMLSliceLogic.h.

◆ ImageDataConnection

vtkAlgorithmOutput* vtkMRMLSliceLogic::ImageDataConnection
protected

Definition at line 443 of file vtkMRMLSliceLogic.h.

◆ LabelLayer

vtkMRMLSliceLayerLogic* vtkMRMLSliceLogic::LabelLayer
protected

Definition at line 438 of file vtkMRMLSliceLogic.h.

◆ Pipeline

BlendPipeline* vtkMRMLSliceLogic::Pipeline
protected

Definition at line 440 of file vtkMRMLSliceLogic.h.

◆ PipelineUVW

BlendPipeline* vtkMRMLSliceLogic::PipelineUVW
protected

Definition at line 441 of file vtkMRMLSliceLogic.h.

◆ SLICE_INDEX_NO_VOLUME

const int vtkMRMLSliceLogic::SLICE_INDEX_NO_VOLUME
static

Definition at line 332 of file vtkMRMLSliceLogic.h.

◆ SLICE_INDEX_OUT_OF_VOLUME

const int vtkMRMLSliceLogic::SLICE_INDEX_OUT_OF_VOLUME
static

Definition at line 331 of file vtkMRMLSliceLogic.h.

◆ SLICE_INDEX_ROTATED

const int vtkMRMLSliceLogic::SLICE_INDEX_ROTATED
static

Definition at line 330 of file vtkMRMLSliceLogic.h.

◆ SLICE_MODEL_NODE_NAME_SUFFIX

const std::string vtkMRMLSliceLogic::SLICE_MODEL_NODE_NAME_SUFFIX
static

Default node name suffix for use with volume slice models to distinguish them as built in models rather than user accessible.

See also
IsSliceModelNode

Definition at line 367 of file vtkMRMLSliceLogic.h.

◆ SliceCompositeNode

vtkMRMLSliceCompositeNode* vtkMRMLSliceLogic::SliceCompositeNode
protected

Definition at line 435 of file vtkMRMLSliceLogic.h.

◆ SliceModelDisplayNode

vtkMRMLModelDisplayNode* vtkMRMLSliceLogic::SliceModelDisplayNode
protected

Definition at line 446 of file vtkMRMLSliceLogic.h.

◆ SliceModelNode

vtkMRMLModelNode* vtkMRMLSliceLogic::SliceModelNode
protected

Definition at line 445 of file vtkMRMLSliceLogic.h.

◆ SliceModelTransformNode

vtkMRMLLinearTransformNode* vtkMRMLSliceLogic::SliceModelTransformNode
protected

Definition at line 447 of file vtkMRMLSliceLogic.h.

◆ SliceNode

vtkMRMLSliceNode* vtkMRMLSliceLogic::SliceNode
protected

Definition at line 434 of file vtkMRMLSliceLogic.h.

◆ SliceSpacing

double vtkMRMLSliceLogic::SliceSpacing[3]
protected

Definition at line 448 of file vtkMRMLSliceLogic.h.


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