Import 2017-06-07 23:51:09: master d0afb3d2

Author Committer Branch Timestamp Parent
jcfr jcfr master 2016-01-29 13:29:10 master 73dbf09b
Changeset

ENH: Refactored view ruler and orientation marker

Ruler and orientation marker:

  • available in both 2D and 3D viewers

  • easier to discover (available in viewer controller widgets and
    application settings)

  • more customizable (size, visibility, custom ruler scales, orientation
    marker models)

  • implemented with cleaner design (using displayable managers for
    rendering and regular node attributes for data storage).

New features:

  • Ruler and orientation marker is configurable per viewer in the slice/3D
    view controller widgets (same way as all view options)

  • Ruler and orientation marker can be shown in 3D view

  • Default ruler orientation marker settings (and additional 3D view settings,
    such as orthographic projection, show 3D cube, axis labels, depth peeling)
    can be configured in the application settings (saved in .ini file)

  • Allow using any model in the scene as orientation marker (for example, set a
    custom orientation marker in the 3D viewer:

    getNode('View1').SetOrientationMarkerHumanModelNodeID(getNode('ToriaClipped03').GetID() )

  • All ruler and orientation marker settings (including custom orientation marker)
    are saved in the scene

  • Added "thick" ruler mode: there is an option now to show the ruler with a
    thicker line and larger font so that it can be seen from a larger distance
    (e.g., interventional use)

Fixes bugs in the old implementation:

  • ruler showed incorrect value when zoomed in or zoomed out very much (instead
    of hiding the ruler, it was kept displayed at an incorrect scale)

  • Ruler was unusable in lightboxview: ruler line was clipped in half, label was
    not visible

  • Some observers were not removed

Design changes compared to the old implementation:

  • Ruler and orientation marker are rendered by displayable managers: This allows
    much simpler and more robust resource management and rendering update (there was
    previously an infinite loop in the orientation marker update causing Slicer crash
    by stack overflow).

  • Orientation marker is loaded from a single file, color is stored in scalars:
    This makes the implementation simpler and displaying of multi-color custom
    models feasible.

Slicer core changes:

  • Removed roll/pitch/yaw buttons from 3D view: to reduce the additional
    complexity caused by adding 2 new buttons (for show/hide ruler and
    orientation marker)

Remarks and next steps:

  • Slice view corner annotations and scalar bar were left unchanged in the DataProbe
    module, as they were not obvious how to clean up and generalize. Slice corner
    annotations have to be made more generic, allowing displaying of custom text provided
    by various modules (see for example CornerAnnotations module).

  • Scalar bar will need to be harmonized with the Color module's scalar bar display
    (that is currently only available in the 3D view).

From: Andras Lasso <lasso@queensu.ca>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24908 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Base/Logic/Resources/CMakeLists.txt Diff File
add - Base/Logic/Resources/OrientationMarkers/Human.vtp Diff File
mod - Base/QTGUI/Resources/UI/qSlicerSettingsViewsPanel.ui Diff File
mod - Base/QTGUI/qSlicerSettingsViewsPanel.cxx Diff File
mod - Base/QTGUI/qSlicerSettingsViewsPanel.h Diff File
mod - Libs/MRML/Core/vtkMRMLAbstractViewNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLAbstractViewNode.h Diff File
mod - Libs/MRML/Core/vtkMRMLColorNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLScene.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLSliceNode.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLViewNode.cxx Diff File
mod - Libs/MRML/DisplayableManager/CMakeLists.txt Diff File
mod - Libs/MRML/DisplayableManager/Testing/Data/vtkMRMLCameraDisplayableManagerTest1.mrml Diff File
mod - Libs/MRML/DisplayableManager/vtkMRMLCameraDisplayableManager.cxx Diff File
add - Libs/MRML/DisplayableManager/vtkMRMLOrientationMarkerDisplayableManager.cxx Diff File
add - Libs/MRML/DisplayableManager/vtkMRMLOrientationMarkerDisplayableManager.h Diff File
add - Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.cxx Diff File
add - Libs/MRML/DisplayableManager/vtkMRMLRulerDisplayableManager.h Diff File
add - Libs/MRML/Widgets/Resources/Icons/OrientationMarker.png Diff File
add - Libs/MRML/Widgets/Resources/Icons/Ruler.png Diff File
mod - Libs/MRML/Widgets/Resources/UI/qMRMLSliceControllerWidget.ui Diff File
mod - Libs/MRML/Widgets/Resources/UI/qMRMLThreeDViewControllerWidget.ui Diff File
mod - Libs/MRML/Widgets/Resources/qMRMLWidgets.qrc Diff File
mod - Libs/MRML/Widgets/Testing/qMRMLSliceWidgetTest2.cxx Diff File
mod - Libs/MRML/Widgets/Testing/qMRMLThreeDViewTest1.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLSliceControllerWidget.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLSliceControllerWidget.h Diff File
mod - Libs/MRML/Widgets/qMRMLSliceControllerWidget_p.h Diff File
mod - Libs/MRML/Widgets/qMRMLSliceView.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLThreeDView.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLThreeDViewControllerWidget.cxx Diff File
mod - Libs/MRML/Widgets/qMRMLThreeDViewControllerWidget.h Diff File
mod - Libs/MRML/Widgets/qMRMLThreeDViewControllerWidget_p.h Diff File
mod - Modules/Loadable/Models/qSlicerModelsModuleWidget.cxx Diff File
mod - Modules/Loadable/ViewControllers/qSlicerViewControllersModule.cxx Diff File
mod - Modules/Loadable/ViewControllers/qSlicerViewControllersModule.h Diff File
mod - Modules/Scripted/DataProbe/CMakeLists.txt Diff File
rm - Modules/Scripted/DataProbe/DataProbeLib/Resources/Models/humanOrientationMarker.stl Diff File
rm - Modules/Scripted/DataProbe/DataProbeLib/Resources/Models/leftShoeOrientationMarker.stl Diff File
rm - Modules/Scripted/DataProbe/DataProbeLib/Resources/Models/rightShoeOrientationMarker.stl Diff File
rm - Modules/Scripted/DataProbe/DataProbeLib/Resources/Models/shortsOrientationMarker.stl Diff File
mod - Modules/Scripted/DataProbe/DataProbeLib/Resources/UI/settings.ui Diff File
mod - Modules/Scripted/DataProbe/DataProbeLib/SliceViewAnnotations.py Diff File