Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit

Controls the selection of the slice the associated BaseRenderer will display. More...

#include <mitkSliceNavigationController.h>

Inheritance diagram for mitk::SliceNavigationController:
Collaboration diagram for mitk::SliceNavigationController:

Classes

class  GeometrySendEvent
 
class  GeometrySliceEvent
 
class  GeometryUpdateEvent
 
class  TimeGeometryEvent
 

Public Member Functions

 mitkClassMacro (SliceNavigationController, BaseController)
 
void SetInputWorldTimeGeometry (const TimeGeometry *geometry)
 Set the input world time geometry out of which the geometries for slicing will be created. More...
 
virtual const TimeGeometry * GetInputWorldTimeGeometry ()
 
virtual const TimeGeometry * GetCreatedWorldGeometry ()
 Access the created geometry. More...
 
virtual TimeGeometry * GetCreatedWorldGeometry ()
 
 itkSetEnumMacro (ViewDirection, AnatomicalPlane)
 Set the desired view directions. More...
 
 itkGetEnumMacro (ViewDirection, AnatomicalPlane)
 
 itkSetEnumMacro (DefaultViewDirection, AnatomicalPlane)
 Set the default view direction. More...
 
 itkGetEnumMacro (DefaultViewDirection, AnatomicalPlane)
 
const char * GetViewDirectionAsString () const
 Get the current view direction as a human-readable string. More...
 
virtual void SetViewDirectionToDefault ()
 Reset the view direction to the default view direction. More...
 
virtual void Update ()
 Do the actual creation and send it to the connected observers (renderers) More...
 
virtual void Update (AnatomicalPlane viewDirection, bool top=true, bool frontside=true, bool rotated=false)
 Extended version of Update, additionally allowing to specify the direction/orientation of the created geometry. More...
 
virtual void SendCreatedWorldGeometry ()
 Send the created geometry to the connected observers (renderers) More...
 
virtual void SendCreatedWorldGeometryUpdate ()
 Tell observers to re-read the currently selected 2D geometry. More...
 
virtual void SendSlice ()
 Send the currently selected slice to the connected observers (renderers) More...
 
template<typename T >
void ConnectGeometrySendEvent (T *receiver)
 
template<typename T >
void ConnectGeometryUpdateEvent (T *receiver)
 
template<typename T >
void ConnectGeometrySliceEvent (T *receiver)
 
template<typename T >
void Disconnect (T *receiver)
 
void SelectSliceByPoint (const Point3D &point)
 Select the slice closest to the given 3D point. More...
 
const BaseGeometry * GetCurrentGeometry3D ()
 Returns the BaseGeometry of the currently selected time step. More...
 
const PlaneGeometry * GetCurrentPlaneGeometry ()
 Returns the currently selected Plane in the current BaseGeometry (if existent). More...
 
virtual void SetRenderer (BaseRenderer *_arg)
 Sets / gets the BaseRenderer associated with this SNC (if any). While the BaseRenderer is not directly used by SNC, this is a convenience method to enable BaseRenderer access via the SNC. More...
 
virtual BaseRenderer * GetRenderer ()
 
void ReorientSlices (const Point3D &point, const Vector3D &normal)
 Re-orient the slice stack using a normal vector. More...
 
void ReorientSlices (const Point3D &point, const Vector3D &axisVec0, const Vector3D &axisVec1)
 Re-orient the slice stack using two explicit axis vectors. More...
 
void ExecuteOperation (Operation *operation) override
 Execute an operation (e.g. OpMOVE, OpRESTOREPLANEPOSITION, OpAPPLYTRANSFORMMATRIX). More...
 
virtual void SetSliceLocked (bool _arg)
 Feature option to lock planes during mouse interaction. This option flag disables the mouse event which causes the center cross to move near by. More...
 
virtual bool GetSliceLocked ()
 
virtual void SliceLockedOn ()
 
virtual void SliceLockedOff ()
 
virtual void SetSliceRotationLocked (bool _arg)
 Feature option to lock slice rotation. More...
 
virtual bool GetSliceRotationLocked ()
 
virtual void SliceRotationLockedOn ()
 
virtual void SliceRotationLockedOff ()
 
void AdjustSliceStepperRange ()
 Adjusts the numerical range of the slice stepper according to the current geometry orientation of this SNC's SlicedGeometry. More...
 
- Public Member Functions inherited from mitk::BaseController
 mitkClassMacroItkParent (BaseController, OperationActor)
 
Stepper * GetStepper ()
 Get the stepper for stepping through the controlled dimension. More...
 
const Stepper * GetStepper () const
 Get the stepper for stepping through the controlled dimension (const). More...
 
- Public Member Functions inherited from mitk::OperationActor
 itkTypeMacroNoParent (OperationActor) virtual ~OperationActor()
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::BaseController
static Pointer New ()
 

Public Attributes

Message1< const Point3D & > SetCrosshairEvent
 Signal emitted when the crosshair position changes. The parameter is the new position in world coordinates. More...
 

Protected Types

typedef std::map< void *, std::list< unsigned long > > ObserverTagsMapType
 

Protected Member Functions

 SliceNavigationController ()
 
 ~SliceNavigationController () override
 
void CreateWorldGeometry (bool top, bool frontside, bool rotated)
 
- Protected Member Functions inherited from mitk::BaseController
 BaseController ()
 Default constructor. More...
 
 ~BaseController () override
 Destructor. More...
 

Protected Attributes

TimeGeometry::ConstPointer m_InputWorldTimeGeometry
 
TimeGeometry::Pointer m_CreatedWorldGeometry
 
AnatomicalPlane m_ViewDirection
 
AnatomicalPlane m_DefaultViewDirection
 
RenderingManager::Pointer m_RenderingManager
 
BaseRenderer * m_Renderer
 
bool m_BlockUpdate
 
bool m_SliceLocked
 
bool m_SliceRotationLocked
 
ObserverTagsMapType m_ReceiverToObserverTagsMap
 
- Protected Attributes inherited from mitk::BaseController
Stepper::Pointer m_Stepper
 Stepper through the controlled dimension. More...
 
unsigned long m_LastUpdateTime
 Timestamp of the last update. More...
 

Detailed Description

Controls the selection of the slice the associated BaseRenderer will display.

A SliceNavigationController takes a TimeGeometry as input world time geometry and generates a different TimeGeometry as output, depending on the current view direction and the current time step. The TimeGeometry holds a number of SlicedGeometry3Ds and these in turn hold a series of PlaneGeometries. One of these PlaneGeometries is selected as world geometry for the BaseRenderers associated to 2D views.

The SliceNavigationController holds a Stepper, which controls the slice-selection of a single PlaneGeometry from the TimeGeometry. SliceNavigationController generates ITK events to tell observers, like a BaseRenderer, when the selected slice changes.

Example:

// Initialization
// Tell the navigation controller the geometry to be sliced
// (with geometry a BaseGeometry::ConstPointer)
sliceCtrl->SetInputWorldTimeGeometry(geometry.GetPointer());
// Tell the navigation controller in which direction it shall slice the data
sliceCtrl->SetViewDirection(mitk::AnatomicalPlane::Axial);
// Connect one or more BaseRenderer to this navigation controller, i.e.:
// events sent by the navigation controller when stepping through the slices
// (e.g. by sliceCtrl->GetStepper()->Next()) will be received by the BaseRenderer
// (in this example only slice-changes, see also ConnectGeometryEvents.)
sliceCtrl->ConnectGeometrySliceEvent(renderer.GetPointer());
//create a world geometry and send the information to the connected renderer(s)
sliceCtrl->Update();
@ Axial
Transverse plane (top-down view, perpendicular to body's long axis).

You can connect visible navigation widgets to a SliceNavigationController, e.g., a QmitkSliceNavigationWidget (for Qt):

// Create the visible navigation widget (a slider with a spin-box)
QmitkSliceNavigationWidget* navigationWidget =
// Connect the navigation widget to the slice-stepper of the
// SliceNavigationController. For initialization (position, minimal and
// maximal values) the values of the SliceNavigationController are used.
// Thus, accessing methods of a navigation widget is normally not necessary,
// since everything can be set via the (Qt-independent) SliceNavigationController.
// The QmitkStepperAdapter converts the Qt-signals to Qt-independent
// itk-events.
new QmitkStepperAdapter(navigationWidget, sliceCtrl->GetStepper());
Helper class to connect Qt-based navigators to instances of Stepper.

If you do not want that all renderwindows are updated when a new slice is selected, you can use a specific RenderingManager, which updates only those renderwindows that should be updated. This is sometimes useful when a 3D view does not need to be updated when the slices in some 2D views are changed.

// create a specific RenderingManager
mitk::RenderingManager::Pointer myManager = mitk::RenderingManager::New();
// tell the RenderingManager to update only renderwindow1 and renderwindow2
myManager->AddRenderWindow(renderwindow1);
myManager->AddRenderWindow(renderwindow2);
// tell the SliceNavigationController of renderwindow1 and renderwindow2
// to use the specific RenderingManager instead of the global one
renderwindow1->GetSliceNavigationController()->SetRenderingManager(myManager);
renderwindow2->GetSliceNavigationController()->SetRenderingManager(myManager);
static Pointer New()
Create a new RenderingManager instance via the registered factory.

Definition at line 134 of file mitkSliceNavigationController.h.

Member Typedef Documentation

◆ ObserverTagsMapType

typedef std::map<void*, std::list<unsigned long> > mitk::SliceNavigationController::ObserverTagsMapType
protected

Definition at line 407 of file mitkSliceNavigationController.h.

Constructor & Destructor Documentation

◆ SliceNavigationController()

mitk::SliceNavigationController::SliceNavigationController ( )
protected

◆ ~SliceNavigationController()

mitk::SliceNavigationController::~SliceNavigationController ( )
overrideprotected

Member Function Documentation

◆ AdjustSliceStepperRange()

void mitk::SliceNavigationController::AdjustSliceStepperRange ( )

Adjusts the numerical range of the slice stepper according to the current geometry orientation of this SNC's SlicedGeometry.

◆ ConnectGeometrySendEvent()

template<typename T >
void mitk::SliceNavigationController::ConnectGeometrySendEvent ( T *  receiver)
inline

Definition at line 259 of file mitkSliceNavigationController.h.

◆ ConnectGeometrySliceEvent()

template<typename T >
void mitk::SliceNavigationController::ConnectGeometrySliceEvent ( T *  receiver)
inline

Definition at line 277 of file mitkSliceNavigationController.h.

◆ ConnectGeometryUpdateEvent()

template<typename T >
void mitk::SliceNavigationController::ConnectGeometryUpdateEvent ( T *  receiver)
inline

Definition at line 268 of file mitkSliceNavigationController.h.

◆ CreateWorldGeometry()

void mitk::SliceNavigationController::CreateWorldGeometry ( bool  top,
bool  frontside,
bool  rotated 
)
protected

◆ Disconnect()

template<typename T >
void mitk::SliceNavigationController::Disconnect ( T *  receiver)
inline

Definition at line 287 of file mitkSliceNavigationController.h.

◆ ExecuteOperation()

void mitk::SliceNavigationController::ExecuteOperation ( Operation *  operation)
overridevirtual

Execute an operation (e.g. OpMOVE, OpRESTOREPLANEPOSITION, OpAPPLYTRANSFORMMATRIX).

Parameters
[in]operationThe operation to execute. Nullptr is safely ignored.

Reimplemented from mitk::BaseController.

◆ GetCreatedWorldGeometry() [1/2]

virtual const TimeGeometry* mitk::SliceNavigationController::GetCreatedWorldGeometry ( )
virtual

Access the created geometry.

◆ GetCreatedWorldGeometry() [2/2]

virtual TimeGeometry* mitk::SliceNavigationController::GetCreatedWorldGeometry ( )
virtual

◆ GetCurrentGeometry3D()

const BaseGeometry* mitk::SliceNavigationController::GetCurrentGeometry3D ( )

Returns the BaseGeometry of the currently selected time step.

◆ GetCurrentPlaneGeometry()

const PlaneGeometry* mitk::SliceNavigationController::GetCurrentPlaneGeometry ( )

Returns the currently selected Plane in the current BaseGeometry (if existent).

◆ GetInputWorldTimeGeometry()

virtual const TimeGeometry* mitk::SliceNavigationController::GetInputWorldTimeGeometry ( )
virtual

◆ GetRenderer()

virtual BaseRenderer* mitk::SliceNavigationController::GetRenderer ( )
virtual

◆ GetSliceLocked()

virtual bool mitk::SliceNavigationController::GetSliceLocked ( )
virtual

◆ GetSliceRotationLocked()

virtual bool mitk::SliceNavigationController::GetSliceRotationLocked ( )
virtual

◆ GetViewDirectionAsString()

const char* mitk::SliceNavigationController::GetViewDirectionAsString ( ) const

Get the current view direction as a human-readable string.

Returns
A string such as "Axial", "Sagittal", "Coronal", or "Original".

◆ itkGetEnumMacro() [1/2]

mitk::SliceNavigationController::itkGetEnumMacro ( DefaultViewDirection  ,
AnatomicalPlane   
)

◆ itkGetEnumMacro() [2/2]

mitk::SliceNavigationController::itkGetEnumMacro ( ViewDirection  ,
AnatomicalPlane   
)

◆ itkSetEnumMacro() [1/2]

mitk::SliceNavigationController::itkSetEnumMacro ( DefaultViewDirection  ,
AnatomicalPlane   
)

Set the default view direction.

This is used to re-initialize the view direction of the SNC to the default value with SetViewDirectionToDefault()

See also
ViewDirection
Update(AnatomicalPlane viewDirection, bool top = true, bool frontside = true, bool rotated = false)

◆ itkSetEnumMacro() [2/2]

mitk::SliceNavigationController::itkSetEnumMacro ( ViewDirection  ,
AnatomicalPlane   
)

Set the desired view directions.

See also
ViewDirection
Update(AnatomicalPlane viewDirection, bool top = true, bool frontside = true, bool rotated = false)

◆ mitkClassMacro()

mitk::SliceNavigationController::mitkClassMacro ( SliceNavigationController  ,
BaseController   
)

◆ New()

static Pointer mitk::SliceNavigationController::New ( )
static

◆ ReorientSlices() [1/2]

void mitk::SliceNavigationController::ReorientSlices ( const Point3D &  point,
const Vector3D &  axisVec0,
const Vector3D &  axisVec1 
)

Re-orient the slice stack using two explicit axis vectors.

All planes are oriented according to the given axis vectors. The given point defines which slice is selected.

Parameters
[in]pointA 3D world coordinate defining the selected slice.
[in]axisVec0The first in-plane axis vector.
[in]axisVec1The second in-plane axis vector.

◆ ReorientSlices() [2/2]

void mitk::SliceNavigationController::ReorientSlices ( const Point3D &  point,
const Vector3D &  normal 
)

Re-orient the slice stack using a normal vector.

All slices will be oriented perpendicular to the given normal vector. The given point (world coordinates) defines which slice is selected.

Parameters
[in]pointA 3D world coordinate defining the selected slice.
[in]normalThe desired normal vector of the slice planes.
Note
The resulting in-plane axis vectors are not clearly defined. Use the two-axis overload for full control.

◆ SelectSliceByPoint()

void mitk::SliceNavigationController::SelectSliceByPoint ( const Point3D &  point)

Select the slice closest to the given 3D point.

Updates the stepper position, sends a geometry update event, and fires the SetCrosshairEvent.

Parameters
[in]pointThe 3D world coordinate to select the closest slice for.

◆ SendCreatedWorldGeometry()

virtual void mitk::SliceNavigationController::SendCreatedWorldGeometry ( )
virtual

Send the created geometry to the connected observers (renderers)

Called by Update().

◆ SendCreatedWorldGeometryUpdate()

virtual void mitk::SliceNavigationController::SendCreatedWorldGeometryUpdate ( )
virtual

Tell observers to re-read the currently selected 2D geometry.

◆ SendSlice()

virtual void mitk::SliceNavigationController::SendSlice ( )
virtual

Send the currently selected slice to the connected observers (renderers)

Called by Update().

◆ SetInputWorldTimeGeometry()

void mitk::SliceNavigationController::SetInputWorldTimeGeometry ( const TimeGeometry *  geometry)

Set the input world time geometry out of which the geometries for slicing will be created.

Any previous set input geometry (3D or Time) will be ignored in the future.

◆ SetRenderer()

virtual void mitk::SliceNavigationController::SetRenderer ( BaseRenderer *  _arg)
virtual

Sets / gets the BaseRenderer associated with this SNC (if any). While the BaseRenderer is not directly used by SNC, this is a convenience method to enable BaseRenderer access via the SNC.

◆ SetSliceLocked()

virtual void mitk::SliceNavigationController::SetSliceLocked ( bool  _arg)
virtual

Feature option to lock planes during mouse interaction. This option flag disables the mouse event which causes the center cross to move near by.

◆ SetSliceRotationLocked()

virtual void mitk::SliceNavigationController::SetSliceRotationLocked ( bool  _arg)
virtual

Feature option to lock slice rotation.

This option flag disables separately the rotation of a slice which is implemented in mitkSliceRotator.

◆ SetViewDirectionToDefault()

virtual void mitk::SliceNavigationController::SetViewDirectionToDefault ( )
virtual

Reset the view direction to the default view direction.

See also
SetDefaultViewDirection

◆ SliceLockedOff()

virtual void mitk::SliceNavigationController::SliceLockedOff ( )
virtual

◆ SliceLockedOn()

virtual void mitk::SliceNavigationController::SliceLockedOn ( )
virtual

◆ SliceRotationLockedOff()

virtual void mitk::SliceNavigationController::SliceRotationLockedOff ( )
virtual

◆ SliceRotationLockedOn()

virtual void mitk::SliceNavigationController::SliceRotationLockedOn ( )
virtual

◆ Update() [1/2]

virtual void mitk::SliceNavigationController::Update ( )
virtual

Do the actual creation and send it to the connected observers (renderers)

◆ Update() [2/2]

virtual void mitk::SliceNavigationController::Update ( AnatomicalPlane  viewDirection,
bool  top = true,
bool  frontside = true,
bool  rotated = false 
)
virtual

Extended version of Update, additionally allowing to specify the direction/orientation of the created geometry.

Parameters
[in]viewDirectionThe anatomical plane direction for slicing.
[in]topIf true, the geometry is oriented from the top.
[in]frontsideIf true, the geometry faces the front side.
[in]rotatedIf true, the geometry is rotated.

Member Data Documentation

◆ m_BlockUpdate

bool mitk::SliceNavigationController::m_BlockUpdate
protected

Definition at line 402 of file mitkSliceNavigationController.h.

◆ m_CreatedWorldGeometry

TimeGeometry::Pointer mitk::SliceNavigationController::m_CreatedWorldGeometry
protected

Definition at line 393 of file mitkSliceNavigationController.h.

◆ m_DefaultViewDirection

AnatomicalPlane mitk::SliceNavigationController::m_DefaultViewDirection
protected

Definition at line 396 of file mitkSliceNavigationController.h.

◆ m_InputWorldTimeGeometry

TimeGeometry::ConstPointer mitk::SliceNavigationController::m_InputWorldTimeGeometry
protected

Definition at line 392 of file mitkSliceNavigationController.h.

◆ m_ReceiverToObserverTagsMap

ObserverTagsMapType mitk::SliceNavigationController::m_ReceiverToObserverTagsMap
protected

Definition at line 408 of file mitkSliceNavigationController.h.

◆ m_Renderer

BaseRenderer* mitk::SliceNavigationController::m_Renderer
protected

Definition at line 400 of file mitkSliceNavigationController.h.

◆ m_RenderingManager

RenderingManager::Pointer mitk::SliceNavigationController::m_RenderingManager
protected

Definition at line 398 of file mitkSliceNavigationController.h.

◆ m_SliceLocked

bool mitk::SliceNavigationController::m_SliceLocked
protected

Definition at line 404 of file mitkSliceNavigationController.h.

◆ m_SliceRotationLocked

bool mitk::SliceNavigationController::m_SliceRotationLocked
protected

Definition at line 405 of file mitkSliceNavigationController.h.

◆ m_ViewDirection

AnatomicalPlane mitk::SliceNavigationController::m_ViewDirection
protected

Definition at line 395 of file mitkSliceNavigationController.h.

◆ SetCrosshairEvent

Message1<const Point3D&> mitk::SliceNavigationController::SetCrosshairEvent

Signal emitted when the crosshair position changes. The parameter is the new position in world coordinates.

Definition at line 301 of file mitkSliceNavigationController.h.


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