NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
niftk::SingleViewerWidget Class Reference

A widget to wrap a single MultiWindowWidget, providing methods for switching the render window layout, remembering the last slice, magnification and cursor position. More...

Inheritance diagram for niftk::SingleViewerWidget:
Inheritance graph
[legend]
Collaboration diagram for niftk::SingleViewerWidget:
Collaboration graph
[legend]

Public Slots

virtual void OnNodesDropped (QmitkRenderWindow *renderWindow, std::vector< mitk::DataNode * > nodes)
 Called when nodes are dropped on the contained render windows. More...
 

Signals

void NodesDropped (std::vector< mitk::DataNode * > nodes)
 Emitted when nodes are dropped on the SingleViewer widget. More...
 
void SelectedPositionChanged (const mitk::Point3D &selectedPosition)
 Emitted when the selected slice has changed in a render window of this viewer. More...
 
void TimeStepChanged (int timeStep)
 Emitted when the selected time step has changed in this viewer. More...
 
void CursorPositionChanged (WindowOrientation orientation, const mitk::Vector2D &cursorPosition)
 Emitted when the cursor position has changed in this viewer. More...
 
void ScaleFactorChanged (WindowOrientation orientation, double scaleFactor)
 Emitted when the scale factor has changed in this viewer. More...
 
void CursorPositionBindingChanged (bool bound)
 Emitted when the cursor position binding has changed in this viewer. More...
 
void ScaleFactorBindingChanged (bool bound)
 Emitted when the scale factor binding has changed in this viewer. More...
 
void WindowLayoutChanged (WindowLayout windowLayout)
 Emitted when the window layout has changed in this viewer. More...
 
void TimeGeometryChanged (const mitk::TimeGeometry *timeGeometry)
 Emitted when the geometry of this viewer has changed. More...
 
void CursorVisibilityChanged (bool visible)
 Emitted when the visibility of the cursor (aka. crosshair) has changed. More...
 
void DirectionAnnotationsVisibilityChanged (bool visible)
 Emitted when the visibility of the direction annotations has changed. More...
 
void IntensityAnnotationVisibilityChanged (bool visible)
 Emitted when the visibility of the intensity annotation has changed. More...
 

Public Member Functions

 SingleViewerWidget (QWidget *parent=0, mitk::RenderingManager *renderingManager=0, const QString &name="DnD-Viewer")
 Constructs a SingleViewerWidget object. More...
 
virtual ~SingleViewerWidget ()
 
bool IsEnabled () const
 Returns the enabled flag. More...
 
void SetEnabled (bool enabled)
 Sets the window to be enabled, where if enabled==true, it's listening to events, and fully turned on. More...
 
bool IsFocused () const
 Tells if the selected render window has the focus. More...
 
void SetFocused ()
 Sets the focus to the selected render window. More...
 
QmitkRenderWindow * GetSelectedRenderWindow () const
 Returns the selected window. If a window has the focus (and it has a coloured border) then it is returned. Otherwise, the first visible window is returned. More...
 
void SetSelectedRenderWindow (QmitkRenderWindow *renderWindow)
 Selects the render window and puts put a coloured border round it. More...
 
std::vector< QmitkRenderWindow * > GetVisibleRenderWindows () const
 Returns the specifically selected sub-pane. More...
 
const std::vector
< QmitkRenderWindow * > & 
GetRenderWindows () const
 Returns the list of all QmitkRenderWindow contained herein. More...
 
QmitkRenderWindow * GetAxialWindow () const
 Returns the Axial Window. More...
 
QmitkRenderWindow * GetCoronalWindow () const
 Returns the Coronal Window. More...
 
QmitkRenderWindow * GetSagittalWindow () const
 Returns the Sagittal Window. More...
 
QmitkRenderWindow * Get3DWindow () const
 Returns the 3D Window. More...
 
WindowOrientation GetOrientation () const
 Returns the orientation for the selected window, returning WINDOW_ORIENTATION_UNKNOWN if not axial, sagittal or coronal. More...
 
bool IsCursorVisible () const
 Get the flag controlling 2D cursors on/off. More...
 
void SetCursorVisible (bool visible)
 Turn the 2D cursors on/off. More...
 
bool AreDirectionAnnotationsVisible () const
 Tells if the direction annotations are visible. More...
 
void SetDirectionAnnotationsVisible (bool visible)
 Sets the visibility of the direction annotations. More...
 
bool IsIntensityAnnotationVisible () const
 Tells if the intensity annotation is visible. More...
 
void SetIntensityAnnotationVisible (bool visible)
 Sets the visibility of the intensity annotation. More...
 
bool GetShow3DWindowIn2x2WindowLayout () const
 Returns the flag indicating if nodes will be visible in the 3D window in 2x2 window layout. In 3D window layout, always visible. More...
 
void SetShow3DWindowIn2x2WindowLayout (bool enabled)
 If true, then nodes will be visible in the 3D window when in 2x2 window layout. In 3D window layout, always visible. More...
 
void SetRememberSettingsPerWindowLayout (bool remember)
 Sets a flag to determine if we remember the image positions (slice, time step, scale factor) when we switch the render window layout. More...
 
bool GetRememberSettingsPerWindowLayout () const
 Sets a flag to determine if we remember the image positions (slice, time step, scale factor) when we switch the render window layout. More...
 
void SetBackgroundColour (QColor colour)
 Sets the background colour. More...
 
QColor GetBackgroundColour () const
 Gets the background colour. More...
 
int GetMaxSlice (WindowOrientation orientation) const
 Returns the maximum allowed slice index for a given orientation. More...
 
int GetMaxTimeStep () const
 Gets the maximum time step. More...
 
bool ContainsRenderWindow (QmitkRenderWindow *renderWindow) const
 Returns true if the widget is fully created and contains the given render window, and false otherwise. More...
 
void SetVisibility (std::vector< mitk::DataNode * > nodes, bool visible)
 Sets the visible flag for all the nodes, and all the renderers. More...
 
double GetMinMagnification () const
 Returns the minimum allowed magnification. More...
 
double GetMaxMagnification () const
 Returns the maximum allowed magnification. More...
 
void RequestUpdate ()
 As each widget has its own rendering manager, we have to manually ask each widget to re-render. More...
 
const mitk::TimeGeometry * GetTimeGeometry () const
 Gets the world geometry. More...
 
void SetTimeGeometry (const mitk::TimeGeometry *timeGeometry)
 Sets the world geometry that we are sampling and sends a TimeGeometryChanged signal. More...
 
void SetBoundTimeGeometry (const mitk::TimeGeometry *timeGeometry)
 Sets the world geometry that we are sampling when we are in bound mode. More...
 
void SetBoundTimeGeometryActive (bool isBound)
 Sets the geometry binding 'on' or 'off'. If 'on' then the geometry of this viewer will be bound to other viewers in the same multi viewer widget. More...
 
bool IsBoundTimeGeometryActive ()
 Returns true if the geometry of the viewer is bound to other viewers, otherwise false. More...
 
int GetSelectedSlice (WindowOrientation orientation) const
 Gets the index of the selected slice for a given orientation. More...
 
void SetSelectedSlice (WindowOrientation orientation, int slice)
 Sets the index of the selected slice for a given orientation. More...
 
int GetTimeStep () const
 Get the current time step. More...
 
void SetTimeStep (int timeStep)
 Set the current time step. More...
 
WindowLayout GetWindowLayout () const
 Gets the render window layout. More...
 
void SetWindowLayout (WindowLayout windowLayout)
 Sets the render window layout to either axial, sagittal or coronal, 3D or ortho (2x2) etc, effectively causing a view reset. More...
 
const mitk::Point3D & GetSelectedPosition () const
 Get the currently selected position in world coordinates (mm) More...
 
void SetSelectedPosition (const mitk::Point3D &selectedPosition)
 Set the currently selected position in world coordinates (mm) More...
 
mitk::Vector2D GetCursorPosition (WindowOrientation orientation) const
 Get the current cursor position of the render window in pixels, normalised with the size of the render windows. More...
 
void SetCursorPosition (WindowOrientation orientation, const mitk::Vector2D &cursorPosition)
 Set the current cursor position of the render window in pixels, normalised with the size of the render windows. More...
 
const std::vector
< mitk::Vector2D > & 
GetCursorPositions () const
 Gets the current cursor position of each render window in pixels, normalised with the size of the render windows. More...
 
void SetCursorPositions (const std::vector< mitk::Vector2D > &cursorPositions)
 Sets the current cursor position of each render window in pixels, normalised with the size of the render windows. More...
 
double GetScaleFactor (WindowOrientation orientation) const
 Get the current scale factor. More...
 
void SetScaleFactor (WindowOrientation orientation, double scaleFactor)
 Set the current scale factor. More...
 
const std::vector< double > & GetScaleFactors () const
 Gets the current scale factor of each render window. More...
 
void SetScaleFactors (const std::vector< double > &scaleFactors)
 Sets the current scale factor for each render window. More...
 
double GetMagnification (WindowOrientation orientation) const
 Get the current magnification. More...
 
void SetMagnification (WindowOrientation orientation, double magnification)
 Set the current magnification. More...
 
bool IsLinkedNavigationEnabled () const
 Gets the flag that controls whether we are listening to the navigation controller events. More...
 
void SetLinkedNavigationEnabled (bool linkedNavigationEnabled)
 Sets the flag that controls whether we are listening to the navigation controller events. More...
 
void SetDisplayInteractionsEnabled (bool enabled)
 Sets the flag that controls whether the display interactions are enabled for the render windows. More...
 
bool AreDisplayInteractionsEnabled () const
 Gets the flag that controls whether the display interactions are enabled for the render windows. More...
 
bool GetCursorPositionBinding () const
 Gets the flag that controls whether the cursor position is bound across the render windows. More...
 
void SetCursorPositionBinding (bool bound)
 Sets the flag that controls whether the cursor position is bound across the render windows. More...
 
bool GetScaleFactorBinding () const
 Gets the flag that controls whether the scale factors are bound across the render windows. More...
 
void SetScaleFactorBinding (bool bound)
 Sets the flag that controls whether the scale factors are bound across the render windows. More...
 
void FitToDisplay (double scaleFactor=0.0)
 Moves the displayed regions to the centre of the 2D render windows and scales them, optionally. If no scale factor is given or the specified value is 0.0 then the maximal zooming is applied, using which each region fits into their window, also considering whether the scale factors are bound across the windows. If a positive scale factor is given then the scale factor of each render window is set to the specified value. If the specified scale factor is -1.0 then no scaling is applied. The regions are moved to the middle of the render windows in each cases. More...
 
std::vector< mitk::DataNode * > GetWidgetPlanes ()
 Returns pointers to the widget planes. More...
 
int GetSliceUpDirection (WindowOrientation orientation) const
 According to the currently set geometry will return +1, or -1 for the direction to increment the slice index to move "up". More...
 
void SetDefaultSingleWindowLayout (WindowLayout windowLayout)
 Sets the default single window layout (axial, coronal etc.), which only takes effect when a node is next dropped into a given window. More...
 
void SetDefaultMultiWindowLayout (WindowLayout windowLayout)
 Sets the default multiple window layout (2x2, 3H, 3V etc.), which only takes effect when a node is next dropped into a given window. More...
 
void MoveSlice (WindowOrientation orientation, int delta, bool restart=false)
 Selects the nth slice before or after the currently selected slice. Slices are ordered: coronal: anterior to posterior, sagittal: right to left, axial: inferior to superior. More...
 
void ToggleMultiWindowLayout ()
 Switch the from single window to multiple windows or back. More...
 
void ToggleCursorVisibility ()
 Shows or hides the cursor. More...
 
void ToggleDirectionAnnotations ()
 Shows or hides the direction annotations. More...
 
void ToggleIntensityAnnotation ()
 Shows or hides the intensity annotation. More...
 
bool BlockUpdate (bool blocked)
 Blocks the update of the viewer. More...
 

Protected Slots

virtual void OnWindowLayoutChanged (WindowLayout windowLayout)
 Called when the window layout has changed. More...
 
virtual void OnSelectedPositionChanged (const mitk::Point3D &selectedPosition)
 Called when the selected position has changed. More...
 
virtual void OnCursorPositionChanged (int orientation, const mitk::Vector2D &cursorPosition)
 Called when the cursor position has changed. More...
 
virtual void OnScaleFactorChanged (int orientation, double scaleFactor)
 Called when the scale factor has changed. More...
 
virtual void OnCursorPositionBindingChanged ()
 Called when the cursor position binding has changed. More...
 
virtual void OnScaleFactorBindingChanged ()
 Called when the scale factor binding has changed. More...
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *event) override
 Re-renders the visible render windows on a paint event, e.g. when the widget is resized. More...
 

Detailed Description

A widget to wrap a single MultiWindowWidget, providing methods for switching the render window layout, remembering the last slice, magnification and cursor position.

IMPORTANT: This class acts as a wrapper for MultiWindowWidget. Do not expose MultiWindowWidget, or any member variables, or any dependency from MultiWindowWidget to the rest of the application.

Additionally, this widget contains its own mitk::RenderingManager which is passed to the MultiWindowWidget, which is itself a sub-class of QmitkStdMultiWidget. This means the MultiWindowWidget will update and render independently of the rest of the application, and care must be taken to manage this. The reason is that each of these viewers in a multi-viewer could have it's own geometry, and sometimes a very different geometry from other windows, and then when the "Bind Slices" button is clicked, they must all align to a specific (the currently selected window) geometry. So it became necessary to manage this independent from the rest of the MITK application.

Note: The requirements specification for MIDAS style zoom basically says.
magnification   : actual pixels per voxel.
on MIDAS widget :
2               : 3
1               : 2
0               : 1 (i.e. no magnification).
-1              : 0.5 (i.e. 1 pixel covers 2 voxels).
-2              : 0.33 (i.e. 1 pixel covers 3 voxels).
etc.
See also
QmitkRenderWindow
MultiWindowWidget

Constructor & Destructor Documentation

niftk::SingleViewerWidget::SingleViewerWidget ( QWidget *  parent = 0,
mitk::RenderingManager *  renderingManager = 0,
const QString &  name = "DnD-Viewer" 
)

Constructs a SingleViewerWidget object.

Parameters
parentThe parent object.
renderingManagerThe rendering manager.
Thename of the viewer. The name is used to construct the name of the renderers and must therefore be unique.
niftk::SingleViewerWidget::~SingleViewerWidget ( )
virtual

Member Function Documentation

bool niftk::SingleViewerWidget::AreDirectionAnnotationsVisible ( ) const

Tells if the direction annotations are visible.

bool niftk::SingleViewerWidget::AreDisplayInteractionsEnabled ( ) const

Gets the flag that controls whether the display interactions are enabled for the render windows.

bool niftk::SingleViewerWidget::BlockUpdate ( bool  blocked)

Blocks the update of the viewer.

Returns true if the update was already blocked, otherwise false. While the update is blocked, the state changes are recorded but the render windows are not updated and no signals are sent out. The render windows are updated and the "pending" signals are sent out when the update is unblocked. The purpose of this function is to avoid unnecessary updates and signals when a serious of operations needs to be performed on the viewer as a single atomic unit, e.g. changing layout and setting positions. After the required state of the viewer is set, the previous blocking state should be restored.

Pattern of usage:

bool updateWasBlocked = viewer->BlockUpdate(true);
... set the required state ...
viewer->BlockUpdate(updateWasBlocked);
bool niftk::SingleViewerWidget::ContainsRenderWindow ( QmitkRenderWindow *  renderWindow) const

Returns true if the widget is fully created and contains the given render window, and false otherwise.

void niftk::SingleViewerWidget::CursorPositionBindingChanged ( bool  bound)
signal

Emitted when the cursor position binding has changed in this viewer.

void niftk::SingleViewerWidget::CursorPositionChanged ( WindowOrientation  orientation,
const mitk::Vector2D &  cursorPosition 
)
signal

Emitted when the cursor position has changed in this viewer.

void niftk::SingleViewerWidget::CursorVisibilityChanged ( bool  visible)
signal

Emitted when the visibility of the cursor (aka. crosshair) has changed.

void niftk::SingleViewerWidget::DirectionAnnotationsVisibilityChanged ( bool  visible)
signal

Emitted when the visibility of the direction annotations has changed.

void niftk::SingleViewerWidget::FitToDisplay ( double  scaleFactor = 0.0)

Moves the displayed regions to the centre of the 2D render windows and scales them, optionally. If no scale factor is given or the specified value is 0.0 then the maximal zooming is applied, using which each region fits into their window, also considering whether the scale factors are bound across the windows. If a positive scale factor is given then the scale factor of each render window is set to the specified value. If the specified scale factor is -1.0 then no scaling is applied. The regions are moved to the middle of the render windows in each cases.

QmitkRenderWindow * niftk::SingleViewerWidget::Get3DWindow ( ) const

Returns the 3D Window.

QmitkRenderWindow * niftk::SingleViewerWidget::GetAxialWindow ( ) const

Returns the Axial Window.

QColor niftk::SingleViewerWidget::GetBackgroundColour ( ) const

Gets the background colour.

QmitkRenderWindow * niftk::SingleViewerWidget::GetCoronalWindow ( ) const

Returns the Coronal Window.

mitk::Vector2D niftk::SingleViewerWidget::GetCursorPosition ( WindowOrientation  orientation) const

Get the current cursor position of the render window in pixels, normalised with the size of the render windows.

bool niftk::SingleViewerWidget::GetCursorPositionBinding ( ) const

Gets the flag that controls whether the cursor position is bound across the render windows.

const std::vector< mitk::Vector2D > & niftk::SingleViewerWidget::GetCursorPositions ( ) const

Gets the current cursor position of each render window in pixels, normalised with the size of the render windows.

double niftk::SingleViewerWidget::GetMagnification ( WindowOrientation  orientation) const

Get the current magnification.

double niftk::SingleViewerWidget::GetMaxMagnification ( ) const

Returns the maximum allowed magnification.

int niftk::SingleViewerWidget::GetMaxSlice ( WindowOrientation  orientation) const

Returns the maximum allowed slice index for a given orientation.

int niftk::SingleViewerWidget::GetMaxTimeStep ( ) const

Gets the maximum time step.

double niftk::SingleViewerWidget::GetMinMagnification ( ) const

Returns the minimum allowed magnification.

WindowOrientation niftk::SingleViewerWidget::GetOrientation ( ) const

Returns the orientation for the selected window, returning WINDOW_ORIENTATION_UNKNOWN if not axial, sagittal or coronal.

Note: This line exploits that the order of orientations are the same and THREE_D equals to WINDOW_ORIENTATION_UNKNOWN.

bool niftk::SingleViewerWidget::GetRememberSettingsPerWindowLayout ( ) const

Sets a flag to determine if we remember the image positions (slice, time step, scale factor) when we switch the render window layout.

const std::vector< QmitkRenderWindow * > & niftk::SingleViewerWidget::GetRenderWindows ( ) const

Returns the list of all QmitkRenderWindow contained herein.

QmitkRenderWindow * niftk::SingleViewerWidget::GetSagittalWindow ( ) const

Returns the Sagittal Window.

double niftk::SingleViewerWidget::GetScaleFactor ( WindowOrientation  orientation) const

Get the current scale factor.

bool niftk::SingleViewerWidget::GetScaleFactorBinding ( ) const

Gets the flag that controls whether the scale factors are bound across the render windows.

const std::vector< double > & niftk::SingleViewerWidget::GetScaleFactors ( ) const

Gets the current scale factor of each render window.

const mitk::Point3D & niftk::SingleViewerWidget::GetSelectedPosition ( ) const

Get the currently selected position in world coordinates (mm)

QmitkRenderWindow * niftk::SingleViewerWidget::GetSelectedRenderWindow ( ) const

Returns the selected window. If a window has the focus (and it has a coloured border) then it is returned. Otherwise, the first visible window is returned.

int niftk::SingleViewerWidget::GetSelectedSlice ( WindowOrientation  orientation) const

Gets the index of the selected slice for a given orientation.

bool niftk::SingleViewerWidget::GetShow3DWindowIn2x2WindowLayout ( ) const

Returns the flag indicating if nodes will be visible in the 3D window in 2x2 window layout. In 3D window layout, always visible.

int niftk::SingleViewerWidget::GetSliceUpDirection ( WindowOrientation  orientation) const

According to the currently set geometry will return +1, or -1 for the direction to increment the slice index to move "up".

const mitk::TimeGeometry * niftk::SingleViewerWidget::GetTimeGeometry ( ) const

Gets the world geometry.

int niftk::SingleViewerWidget::GetTimeStep ( ) const

Get the current time step.

std::vector< QmitkRenderWindow * > niftk::SingleViewerWidget::GetVisibleRenderWindows ( ) const

Returns the specifically selected sub-pane.

std::vector< mitk::DataNode * > niftk::SingleViewerWidget::GetWidgetPlanes ( )

Returns pointers to the widget planes.

WindowLayout niftk::SingleViewerWidget::GetWindowLayout ( ) const

Gets the render window layout.

void niftk::SingleViewerWidget::IntensityAnnotationVisibilityChanged ( bool  visible)
signal

Emitted when the visibility of the intensity annotation has changed.

bool niftk::SingleViewerWidget::IsBoundTimeGeometryActive ( )

Returns true if the geometry of the viewer is bound to other viewers, otherwise false.

bool niftk::SingleViewerWidget::IsCursorVisible ( ) const

Get the flag controlling 2D cursors on/off.

bool niftk::SingleViewerWidget::IsEnabled ( ) const

Returns the enabled flag.

bool niftk::SingleViewerWidget::IsFocused ( ) const

Tells if the selected render window has the focus.

bool niftk::SingleViewerWidget::IsIntensityAnnotationVisible ( ) const

Tells if the intensity annotation is visible.

bool niftk::SingleViewerWidget::IsLinkedNavigationEnabled ( ) const

Gets the flag that controls whether we are listening to the navigation controller events.

void niftk::SingleViewerWidget::MoveSlice ( WindowOrientation  orientation,
int  delta,
bool  restart = false 
)

Selects the nth slice before or after the currently selected slice. Slices are ordered: coronal: anterior to posterior, sagittal: right to left, axial: inferior to superior.

void niftk::SingleViewerWidget::NodesDropped ( std::vector< mitk::DataNode * >  nodes)
signal

Emitted when nodes are dropped on the SingleViewer widget.

void niftk::SingleViewerWidget::OnCursorPositionBindingChanged ( )
protectedvirtualslot

Called when the cursor position binding has changed.

void niftk::SingleViewerWidget::OnCursorPositionChanged ( int  orientation,
const mitk::Vector2D &  cursorPosition 
)
protectedvirtualslot

Called when the cursor position has changed.

A double click can result in up to three CursorPositionChanged events, depending on how many coordinates of the selected position have changed, if any. A SelectedPositionChanged event can cause two or three CursorPositionChanged events. Therefore, we need to keep the last four cursor positions, including the current one.

void niftk::SingleViewerWidget::OnNodesDropped ( QmitkRenderWindow *  renderWindow,
std::vector< mitk::DataNode * >  nodes 
)
virtualslot

Called when nodes are dropped on the contained render windows.

void niftk::SingleViewerWidget::OnScaleFactorBindingChanged ( )
protectedvirtualslot

Called when the scale factor binding has changed.

void niftk::SingleViewerWidget::OnScaleFactorChanged ( int  orientation,
double  scaleFactor 
)
protectedvirtualslot

Called when the scale factor has changed.

void niftk::SingleViewerWidget::OnSelectedPositionChanged ( const mitk::Point3D &  selectedPosition)
protectedvirtualslot

Called when the selected position has changed.

A double click can result in 0 or 1 SelectedPositionChanged event, depending on if you double click exactly where the cursor is or not. Therefore, we need to keep the last two selected positions, including the current one.

void niftk::SingleViewerWidget::OnWindowLayoutChanged ( WindowLayout  windowLayout)
protectedvirtualslot

Called when the window layout has changed.

void niftk::SingleViewerWidget::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Re-renders the visible render windows on a paint event, e.g. when the widget is resized.

void niftk::SingleViewerWidget::RequestUpdate ( )

As each widget has its own rendering manager, we have to manually ask each widget to re-render.

void niftk::SingleViewerWidget::ScaleFactorBindingChanged ( bool  bound)
signal

Emitted when the scale factor binding has changed in this viewer.

void niftk::SingleViewerWidget::ScaleFactorChanged ( WindowOrientation  orientation,
double  scaleFactor 
)
signal

Emitted when the scale factor has changed in this viewer.

void niftk::SingleViewerWidget::SelectedPositionChanged ( const mitk::Point3D &  selectedPosition)
signal

Emitted when the selected slice has changed in a render window of this viewer.

void niftk::SingleViewerWidget::SetBackgroundColour ( QColor  colour)

Sets the background colour.

void niftk::SingleViewerWidget::SetBoundTimeGeometry ( const mitk::TimeGeometry *  timeGeometry)

Sets the world geometry that we are sampling when we are in bound mode.

void niftk::SingleViewerWidget::SetBoundTimeGeometryActive ( bool  isBound)

Sets the geometry binding 'on' or 'off'. If 'on' then the geometry of this viewer will be bound to other viewers in the same multi viewer widget.

void niftk::SingleViewerWidget::SetCursorPosition ( WindowOrientation  orientation,
const mitk::Vector2D &  cursorPosition 
)

Set the current cursor position of the render window in pixels, normalised with the size of the render windows.

void niftk::SingleViewerWidget::SetCursorPositionBinding ( bool  bound)

Sets the flag that controls whether the cursor position is bound across the render windows.

void niftk::SingleViewerWidget::SetCursorPositions ( const std::vector< mitk::Vector2D > &  cursorPositions)

Sets the current cursor position of each render window in pixels, normalised with the size of the render windows.

void niftk::SingleViewerWidget::SetCursorVisible ( bool  visible)

Turn the 2D cursors on/off.

void niftk::SingleViewerWidget::SetDefaultMultiWindowLayout ( WindowLayout  windowLayout)

Sets the default multiple window layout (2x2, 3H, 3V etc.), which only takes effect when a node is next dropped into a given window.

void niftk::SingleViewerWidget::SetDefaultSingleWindowLayout ( WindowLayout  windowLayout)

Sets the default single window layout (axial, coronal etc.), which only takes effect when a node is next dropped into a given window.

void niftk::SingleViewerWidget::SetDirectionAnnotationsVisible ( bool  visible)

Sets the visibility of the direction annotations.

void niftk::SingleViewerWidget::SetDisplayInteractionsEnabled ( bool  enabled)

Sets the flag that controls whether the display interactions are enabled for the render windows.

void niftk::SingleViewerWidget::SetEnabled ( bool  enabled)

Sets the window to be enabled, where if enabled==true, it's listening to events, and fully turned on.

void niftk::SingleViewerWidget::SetFocused ( )

Sets the focus to the selected render window.

void niftk::SingleViewerWidget::SetIntensityAnnotationVisible ( bool  visible)

Sets the visibility of the intensity annotation.

void niftk::SingleViewerWidget::SetLinkedNavigationEnabled ( bool  linkedNavigationEnabled)

Sets the flag that controls whether we are listening to the navigation controller events.

void niftk::SingleViewerWidget::SetMagnification ( WindowOrientation  orientation,
double  magnification 
)

Set the current magnification.

void niftk::SingleViewerWidget::SetRememberSettingsPerWindowLayout ( bool  remember)

Sets a flag to determine if we remember the image positions (slice, time step, scale factor) when we switch the render window layout.

void niftk::SingleViewerWidget::SetScaleFactor ( WindowOrientation  orientation,
double  scaleFactor 
)

Set the current scale factor.

void niftk::SingleViewerWidget::SetScaleFactorBinding ( bool  bound)

Sets the flag that controls whether the scale factors are bound across the render windows.

void niftk::SingleViewerWidget::SetScaleFactors ( const std::vector< double > &  scaleFactors)

Sets the current scale factor for each render window.

void niftk::SingleViewerWidget::SetSelectedPosition ( const mitk::Point3D &  selectedPosition)

Set the currently selected position in world coordinates (mm)

void niftk::SingleViewerWidget::SetSelectedRenderWindow ( QmitkRenderWindow *  renderWindow)

Selects the render window and puts put a coloured border round it.

void niftk::SingleViewerWidget::SetSelectedSlice ( WindowOrientation  orientation,
int  slice 
)

Sets the index of the selected slice for a given orientation.

void niftk::SingleViewerWidget::SetShow3DWindowIn2x2WindowLayout ( bool  enabled)

If true, then nodes will be visible in the 3D window when in 2x2 window layout. In 3D window layout, always visible.

void niftk::SingleViewerWidget::SetTimeGeometry ( const mitk::TimeGeometry *  timeGeometry)

Sets the world geometry that we are sampling and sends a TimeGeometryChanged signal.

void niftk::SingleViewerWidget::SetTimeStep ( int  timeStep)

Set the current time step.

void niftk::SingleViewerWidget::SetVisibility ( std::vector< mitk::DataNode * >  nodes,
bool  visible 
)

Sets the visible flag for all the nodes, and all the renderers.

void niftk::SingleViewerWidget::SetWindowLayout ( WindowLayout  windowLayout)

Sets the render window layout to either axial, sagittal or coronal, 3D or ortho (2x2) etc, effectively causing a view reset.

Note: We set the scale factors first because the cursor position calculation relies on it.

If the positions are not remembered for each window layout, we reset them. This moves the displayed region to the middle of the render window and the sets the scale factor so that the image fits the render window.

void niftk::SingleViewerWidget::TimeGeometryChanged ( const mitk::TimeGeometry *  timeGeometry)
signal

Emitted when the geometry of this viewer has changed.

void niftk::SingleViewerWidget::TimeStepChanged ( int  timeStep)
signal

Emitted when the selected time step has changed in this viewer.

void niftk::SingleViewerWidget::ToggleCursorVisibility ( )

Shows or hides the cursor.

void niftk::SingleViewerWidget::ToggleDirectionAnnotations ( )

Shows or hides the direction annotations.

void niftk::SingleViewerWidget::ToggleIntensityAnnotation ( )

Shows or hides the intensity annotation.

void niftk::SingleViewerWidget::ToggleMultiWindowLayout ( )

Switch the from single window to multiple windows or back.

We have to discard the selected position changes during the double clicking.

We also discard the cursor position changes since the double click.

Restore the selected position and cursor positions from before the double clicking.

void niftk::SingleViewerWidget::WindowLayoutChanged ( WindowLayout  windowLayout)
signal

Emitted when the window layout has changed in this viewer.


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