Slicer  4.10
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 Member Functions | Protected Attributes
vtkSliceViewInteractorStyle Class Reference

Provides customizable interaction routines. More...

#include <Libs/MRML/DisplayableManager/vtkSliceViewInteractorStyle.h>

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

Public Types

enum  {
  None = 0, Translate = 1, Zoom = 2, Rotate = 4,
  Blend = 8, AdjustWindowLevelBackground = 16, AdjustWindowLevelForeground = 32, BrowseSlice = 64,
  ShowSlice = 128, AdjustLightbox = 256, SelectVolume = 512, SetCursorPosition = 1024,
  AllActionsMask
}
 Internal state management for multi-event sequences (like click-drag-release) More...
 
typedef vtkInteractorStyleUser Superclass
 

Public Member Functions

void CycleVolumeLayer (int layer, int direction)
 
void DecrementSlice ()
 
void EndAdjustWindowLevel ()
 
void EndBlend ()
 
void EndTranslate ()
 
bool GetActionEnabled (int actionsMask)
 
virtual int GetActionState ()
 
virtual const char * GetClassName ()
 
void GetEventXYZ (double xyz[4])
 
double GetLabelOpacity ()
 
virtual vtkMRMLSliceLogicGetSliceLogic ()
 
double GetSliceSpacing ()
 Helper routines. More...
 
vtkMRMLSegmentationDisplayNodeGetVisibleSegmentationDisplayNode ()
 
void IncrementSlice ()
 Adjust the slice position with respect to current slice node offset. More...
 
virtual int IsA (const char *type)
 
void MoveSlice (double delta)
 
virtual void OnChar () VTK_OVERRIDE
 
Keyboard functions More...
 
virtual void OnConfigure () VTK_OVERRIDE
 
virtual void OnEnter () VTK_OVERRIDE
 
virtual void OnExpose () VTK_OVERRIDE
 
These are more esoteric events, but are useful in some cases. More...
 
virtual void OnKeyPress () VTK_OVERRIDE
 
virtual void OnKeyRelease () VTK_OVERRIDE
 
virtual void OnLeave () VTK_OVERRIDE
 
virtual void OnLeftButtonDown () VTK_OVERRIDE
 
virtual void OnLeftButtonUp () VTK_OVERRIDE
 
virtual void OnMiddleButtonDown () VTK_OVERRIDE
 
virtual void OnMiddleButtonUp () VTK_OVERRIDE
 
virtual void OnMouseMove () VTK_OVERRIDE
 
virtual void OnMouseWheelBackward () VTK_OVERRIDE
 
virtual void OnMouseWheelForward () VTK_OVERRIDE
 MouseWheel callbacks added for slicer. More...
 
virtual void OnRightButtonDown () VTK_OVERRIDE
 
virtual void OnRightButtonUp () VTK_OVERRIDE
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
void ScaleZoom (double zoomScaleFactor)
 
void SetActionEnabled (int actionsMask, bool enable=true)
 
virtual void SetActionState (int)
 
void SetLabelOpacity (double opacity)
 Get/Set labelmap or segmentation opacity. More...
 
void SetSliceLogic (vtkMRMLSliceLogic *SliceLogic)
 
Get/Set the SliceLogic More...
 
void StartAdjustWindowLevel ()
 
void StartBlend ()
 
void StartTranslate ()
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkSliceViewInteractorStyleNew ()
 
static vtkSliceViewInteractorStyleSafeDownCast (vtkObject *o)
 

Protected Member Functions

int GetMouseInteractionMode ()
 
bool IsMouseInsideVolume (bool background)
 
bool VolumeWindowLevelEditable (const char *volumeNodeID)
 
 vtkSliceViewInteractorStyle ()
 
 ~vtkSliceViewInteractorStyle ()
 

Protected Attributes

int ActionsEnabled
 
int ActionState
 
int LastEventPosition [2]
 
double LastForegroundOpacity
 
double LastLabelOpacity
 
double LastVolumeWindowLevel [2]
 
bool ShiftKeyUsedForPreviousAction
 
vtkMRMLSliceLogicSliceLogic
 
int StartActionEventPosition [2]
 
double StartActionFOV [3]
 
vtkMRMLSegmentationDisplayNodeStartActionSegmentationDisplayNode
 
double VolumeScalarRange [2]
 

Detailed Description

Provides customizable interaction routines.

Relies on vtkInteractorStyleUser, but with MouseWheelEvents. and mapping to control the slicer slice logic (manipulates the vtkMRMLSliceNode and vtkMRMLSliceCompositeNode. TODO:

Definition at line 38 of file vtkSliceViewInteractorStyle.h.

Member Typedef Documentation

◆ Superclass

typedef vtkInteractorStyleUser vtkSliceViewInteractorStyle::Superclass

Definition at line 42 of file vtkSliceViewInteractorStyle.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Internal state management for multi-event sequences (like click-drag-release)

Action State values and management

Enumerator
None 
Translate 
Zoom 
Rotate 
Blend 
AdjustWindowLevelBackground 
AdjustWindowLevelForeground 
BrowseSlice 
ShowSlice 
AdjustLightbox 
SelectVolume 
SetCursorPosition 
AllActionsMask 

Definition at line 77 of file vtkSliceViewInteractorStyle.h.

Constructor & Destructor Documentation

◆ vtkSliceViewInteractorStyle()

vtkSliceViewInteractorStyle::vtkSliceViewInteractorStyle ( )
protected

◆ ~vtkSliceViewInteractorStyle()

vtkSliceViewInteractorStyle::~vtkSliceViewInteractorStyle ( )
protected

Member Function Documentation

◆ CycleVolumeLayer()

void vtkSliceViewInteractorStyle::CycleVolumeLayer ( int  layer,
int  direction 
)

Change the displayed volume in the selected layer by moving in a loop trough the volumes available in the scene.

  • layer: are 0,1,2 for bg, fg, lb
  • direction: positive or negative (wraps through volumes in scene)

◆ DecrementSlice()

void vtkSliceViewInteractorStyle::DecrementSlice ( )

◆ EndAdjustWindowLevel()

void vtkSliceViewInteractorStyle::EndAdjustWindowLevel ( )

◆ EndBlend()

void vtkSliceViewInteractorStyle::EndBlend ( )

◆ EndTranslate()

void vtkSliceViewInteractorStyle::EndTranslate ( )

◆ GetActionEnabled()

bool vtkSliceViewInteractorStyle::GetActionEnabled ( int  actionsMask)

Returns true if the specified action is allowed. If multiple actions are specified, the return value is true if all actions are enabled.

◆ GetActionState()

virtual int vtkSliceViewInteractorStyle::GetActionState ( )
virtual

◆ GetClassName()

virtual const char* vtkSliceViewInteractorStyle::GetClassName ( )
virtual

◆ GetEventXYZ()

void vtkSliceViewInteractorStyle::GetEventXYZ ( double  xyz[4])

Convert event coordinates (with respect to viewport) into xyz coordinates, where z is the slice number of the lightbox and xy is the offset within the lightbox view. The xyz coordinates can be used to map to RAS with the slice node's XYToRAS matrix. The 4th component is 1 so it can be used with a homogenous transform.

◆ GetLabelOpacity()

double vtkSliceViewInteractorStyle::GetLabelOpacity ( )

◆ GetMouseInteractionMode()

int vtkSliceViewInteractorStyle::GetMouseInteractionMode ( )
protected

◆ GetSliceLogic()

virtual vtkMRMLSliceLogic* vtkSliceViewInteractorStyle::GetSliceLogic ( )
virtual

◆ GetSliceSpacing()

double vtkSliceViewInteractorStyle::GetSliceSpacing ( )

Helper routines.

check for prescribed spacing, otherwise return best spacing amount for current layer setup (use logic to look for spacing of first non-null layer)

◆ GetVisibleSegmentationDisplayNode()

vtkMRMLSegmentationDisplayNode* vtkSliceViewInteractorStyle::GetVisibleSegmentationDisplayNode ( )

◆ IncrementSlice()

void vtkSliceViewInteractorStyle::IncrementSlice ( )

Adjust the slice position with respect to current slice node offset.

◆ IsA()

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

◆ IsMouseInsideVolume()

bool vtkSliceViewInteractorStyle::IsMouseInsideVolume ( bool  background)
protected

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

◆ IsTypeOf()

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

◆ MoveSlice()

void vtkSliceViewInteractorStyle::MoveSlice ( double  delta)

◆ New()

static vtkSliceViewInteractorStyle* vtkSliceViewInteractorStyle::New ( )
static

◆ OnChar()

virtual void vtkSliceViewInteractorStyle::OnChar ( )
virtual


Keyboard functions

◆ OnConfigure()

virtual void vtkSliceViewInteractorStyle::OnConfigure ( )
virtual

◆ OnEnter()

virtual void vtkSliceViewInteractorStyle::OnEnter ( )
virtual

◆ OnExpose()

virtual void vtkSliceViewInteractorStyle::OnExpose ( )
virtual


These are more esoteric events, but are useful in some cases.

◆ OnKeyPress()

virtual void vtkSliceViewInteractorStyle::OnKeyPress ( )
virtual

◆ OnKeyRelease()

virtual void vtkSliceViewInteractorStyle::OnKeyRelease ( )
virtual

◆ OnLeave()

virtual void vtkSliceViewInteractorStyle::OnLeave ( )
virtual

◆ OnLeftButtonDown()

virtual void vtkSliceViewInteractorStyle::OnLeftButtonDown ( )
virtual

◆ OnLeftButtonUp()

virtual void vtkSliceViewInteractorStyle::OnLeftButtonUp ( )
virtual

◆ OnMiddleButtonDown()

virtual void vtkSliceViewInteractorStyle::OnMiddleButtonDown ( )
virtual

◆ OnMiddleButtonUp()

virtual void vtkSliceViewInteractorStyle::OnMiddleButtonUp ( )
virtual

◆ OnMouseMove()

virtual void vtkSliceViewInteractorStyle::OnMouseMove ( )
virtual

Events are either handled here by changing the slice node and composite node (sometimes using the logic's methods) or they are passed to the vtkInteractorStyleUser, which conditionally passes them to observers if there are any.

Generic event bindings

◆ OnMouseWheelBackward()

virtual void vtkSliceViewInteractorStyle::OnMouseWheelBackward ( )
virtual

◆ OnMouseWheelForward()

virtual void vtkSliceViewInteractorStyle::OnMouseWheelForward ( )
virtual

MouseWheel callbacks added for slicer.

◆ OnRightButtonDown()

virtual void vtkSliceViewInteractorStyle::OnRightButtonDown ( )
virtual

◆ OnRightButtonUp()

virtual void vtkSliceViewInteractorStyle::OnRightButtonUp ( )
virtual

◆ PrintSelf()

void vtkSliceViewInteractorStyle::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

◆ SafeDownCast()

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

◆ ScaleZoom()

void vtkSliceViewInteractorStyle::ScaleZoom ( double  zoomScaleFactor)

Adjust zoom factor. If zoomScaleFactor>1 then view is zoomed in, if 0<zoomScaleFactor<1 then view is zoomed out.

◆ SetActionEnabled()

void vtkSliceViewInteractorStyle::SetActionEnabled ( int  actionsMask,
bool  enable = true 
)

Enable/disable the specified action (Translate, Zoom, Blend, etc.). Multiple actions can be specified by providing the sum of action ids. Set the value to AllActionsMask to enable/disable all actions. All actions are enabled by default.

◆ SetActionState()

virtual void vtkSliceViewInteractorStyle::SetActionState ( int  )
virtual

◆ SetLabelOpacity()

void vtkSliceViewInteractorStyle::SetLabelOpacity ( double  opacity)

Get/Set labelmap or segmentation opacity.

◆ SetSliceLogic()

void vtkSliceViewInteractorStyle::SetSliceLogic ( vtkMRMLSliceLogic SliceLogic)


Get/Set the SliceLogic

◆ StartAdjustWindowLevel()

void vtkSliceViewInteractorStyle::StartAdjustWindowLevel ( )

Enter a mode where the mouse moves are used to change the window/level setting.

◆ StartBlend()

void vtkSliceViewInteractorStyle::StartBlend ( )

Enter a mode where the mouse moves are used to change the foreground or labelmap opacity.

◆ StartTranslate()

void vtkSliceViewInteractorStyle::StartTranslate ( )

Collect some boilerplate management steps so they can be used in more than one place

◆ VolumeWindowLevelEditable()

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

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

Member Data Documentation

◆ ActionsEnabled

int vtkSliceViewInteractorStyle::ActionsEnabled
protected

Definition at line 176 of file vtkSliceViewInteractorStyle.h.

◆ ActionState

int vtkSliceViewInteractorStyle::ActionState
protected

Definition at line 175 of file vtkSliceViewInteractorStyle.h.

◆ LastEventPosition

int vtkSliceViewInteractorStyle::LastEventPosition[2]
protected

Definition at line 187 of file vtkSliceViewInteractorStyle.h.

◆ LastForegroundOpacity

double vtkSliceViewInteractorStyle::LastForegroundOpacity
protected

Definition at line 188 of file vtkSliceViewInteractorStyle.h.

◆ LastLabelOpacity

double vtkSliceViewInteractorStyle::LastLabelOpacity
protected

Definition at line 189 of file vtkSliceViewInteractorStyle.h.

◆ LastVolumeWindowLevel

double vtkSliceViewInteractorStyle::LastVolumeWindowLevel[2]
protected

Definition at line 190 of file vtkSliceViewInteractorStyle.h.

◆ ShiftKeyUsedForPreviousAction

bool vtkSliceViewInteractorStyle::ShiftKeyUsedForPreviousAction
protected

Indicates whether the shift key was used during the previous action. This is used to require shift-up before returning to default mode.

Definition at line 180 of file vtkSliceViewInteractorStyle.h.

◆ SliceLogic

vtkMRMLSliceLogic* vtkSliceViewInteractorStyle::SliceLogic
protected

Definition at line 192 of file vtkSliceViewInteractorStyle.h.

◆ StartActionEventPosition

int vtkSliceViewInteractorStyle::StartActionEventPosition[2]
protected

Definition at line 182 of file vtkSliceViewInteractorStyle.h.

◆ StartActionFOV

double vtkSliceViewInteractorStyle::StartActionFOV[3]
protected

Definition at line 183 of file vtkSliceViewInteractorStyle.h.

◆ StartActionSegmentationDisplayNode

vtkMRMLSegmentationDisplayNode* vtkSliceViewInteractorStyle::StartActionSegmentationDisplayNode
protected

Definition at line 185 of file vtkSliceViewInteractorStyle.h.

◆ VolumeScalarRange

double vtkSliceViewInteractorStyle::VolumeScalarRange[2]
protected

Definition at line 184 of file vtkSliceViewInteractorStyle.h.


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