NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Qt Widget to provide a single SingleViewerWidget, and some associated buttons controlling 2/3 view, vertical/horizontal and axial/coronal/sagittal/ortho. More...
Public Member Functions | |
SideViewerWidget (BaseView *view, QWidget *parent, mitk::RenderingManager *renderingManager) | |
Constructs a SideViewerWidget object. More... | |
virtual | ~SideViewerWidget () |
Destructs the SideViewerWidget object. More... | |
void | SetFocused () |
void | SetGeometry (const itk::EventObject &geometrySendEvent) |
Called when the world geometry of main window changes and updates the viewer accordingly. More... | |
void | OnMainWindowChanged (mitk::IRenderWindowPart *renderWindowPart, QmitkRenderWindow *mainWindow) |
Sets the selected render window of the main display. This view then might need to change its window layout so that it shows the image of a different orientation. More... | |
Protected Slots | |
void | OnAxialWindowRadioButtonToggled (bool checked) |
Called when the axial window layout radio button is toggled. More... | |
void | OnSagittalWindowRadioButtonToggled (bool checked) |
Called when the sagittal window layout radio button is toggled. More... | |
void | OnCoronalWindowRadioButtonToggled (bool checked) |
Called when the coronal window layout radio button is toggled. More... | |
void | OnMultiWindowRadioButtonToggled (bool checked) |
Called when the multi window layout radio button is toggled. More... | |
void | OnMultiWindowComboBoxIndexChanged () |
Called when the window layout is selected in the the combo box. More... | |
void | OnSliceSpinBoxValueChanged (int slice) |
Called when the slice is changed by the spin box. More... | |
void | OnMagnificationSpinBoxValueChanged (double magnification) |
Called when the magnification is changed by the spin box. More... | |
void | OnSelectedPositionChanged (const mitk::Point3D &selectedPosition) |
Called when the scale factor is changed by zooming in a renderer window. More... | |
void | OnScaleFactorChanged (WindowOrientation orientation, double scaleFactor) |
Called when the scale factor is changed by zooming in a renderer window. More... | |
void | OnWindowLayoutChanged (WindowLayout windowLayout) |
Called when the window layout of the viewer has changed through interaction. More... | |
Qt Widget to provide a single SingleViewerWidget, and some associated buttons controlling 2/3 view, vertical/horizontal and axial/coronal/sagittal/ortho.
The widget will display whatever data nodes are visible in the currently focused render window, not including this widget. This means:
1. If this widget visible, when new data is added to the data storage, defaults to not-visible in this viewer. 2. When the focus changes, get the current editor axial, sagittal, coronal view: a. update visibility properties so that whatever is visible in main editor is visible in this widget.
niftk::SideViewerWidget::SideViewerWidget | ( | BaseView * | view, |
QWidget * | parent, | ||
mitk::RenderingManager * | renderingManager | ||
) |
Constructs a SideViewerWidget object.
view | Sets the containing view for callback purposes. The reason we do this, is so that we can ask QmitkAbstractView for the mitkIRenderWindowPart rather than have any hard coded reference to any widget such as DnDMultiWindowWidget. |
Note: We do not set the data storage for the viewer because that would recalculate the time geometry based on the globally visible data nodes in the data storage. This is wrong for us, since we want to see the nodes that are visible in the tracked window, and hence we want to set the time geometry of the track window to the viewer of this widget. The viewer gets the data storage from the rendering manager that is set through its constructor.
TODO Very ugly. This should be done in the other way round, from the MIDAS tools.
Note: We need to look for the focused window among every window of the editor. The MITK Display has not got the concept of 'selected' window and always returns the axial window as 'active'. Therefore we cannot use GetActiveQmitkRenderWindow.
Note: Direct call to m_Viewer->FitToDisplay() does not work because the function computes the desired scale factor for the visible render windows. At this time, however, no renderer window is visible, since the widget is just being constructed.
|
virtual |
Destructs the SideViewerWidget object.
|
protectedslot |
Called when the axial window layout radio button is toggled.
|
protectedslot |
Called when the coronal window layout radio button is toggled.
|
protectedslot |
Called when the magnification is changed by the spin box.
void niftk::SideViewerWidget::OnMainWindowChanged | ( | mitk::IRenderWindowPart * | renderWindowPart, |
QmitkRenderWindow * | mainWindow | ||
) |
Sets the selected render window of the main display. This view then might need to change its window layout so that it shows the image of a different orientation.
renderWindowPart | The render window part (aka. editor or display) that contins the window |
mainWindow | The selected render window of the main display. |
Note: The SetWindowLayout function does not change the layout if the viewer has not got a valid geometry. Therefore, if the viewer is initialised with a geometry for the first time, we need to set the window layout again, according to the main window orientation.
Note that changing the window layout resets the geometry, what sets the selected position in the centre. Therefore, we need to set the slice indexes to that of the main windows.
|
protectedslot |
Called when the window layout is selected in the the combo box.
|
protectedslot |
Called when the multi window layout radio button is toggled.
|
protectedslot |
Called when the sagittal window layout radio button is toggled.
|
protectedslot |
Called when the scale factor is changed by zooming in a renderer window.
|
protectedslot |
Called when the scale factor is changed by zooming in a renderer window.
Called when the slice is changed by the spin box.
|
protectedslot |
Called when the window layout of the viewer has changed through interaction.
Note: The selected window has not necessarily been changed, but it is not costly to refresh the GUI buttons every time.
void niftk::SideViewerWidget::SetFocused | ( | ) |
void niftk::SideViewerWidget::SetGeometry | ( | const itk::EventObject & | geometrySendEvent | ) |
Called when the world geometry of main window changes and updates the viewer accordingly.
Note: SetWindowLayout does not work when the viewer has no geometry. Therefore, we need to set it at the first time when the viewer receives a geometry.