Skip to content
Snippets Groups Projects

Refactored view ruler and orientation marker

Closed Sam Horvath requested to merge github/fork/jcfr/viewannotations-integ-reorg-jcfr into master
  1. Jan 29, 2016
    • Andras Lasso's avatar
      ENH: Refactored view ruler and orientation marker · c70d9713
      Andras Lasso authored and Jean-Christophe Fillion-Robin's avatar Jean-Christophe Fillion-Robin committed
      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).
      c70d9713
    • Andras Lasso's avatar
      ENH: Update vtkMRMLLogic API adding GetApplication(Home|Share)Directory() · b66b61b9
      Andras Lasso authored and Jean-Christophe Fillion-Robin's avatar Jean-Christophe Fillion-Robin committed
      Added common helper functions for accessing file resources from MRML
      nodes.
      
      Previously a Slicer-specific environment variable was hardcoded in
      vtkMRMLFreeSurferProceduralColorNode.
      
      Now the environment variable name is configurable in CMake and
      GetApplicationHomeDirectory and GetApplicationShareDirectory methods
      in vtkMRMLLogic can be used to determine resource file paths.
      b66b61b9
    • Jean-Christophe Fillion-Robin's avatar
    • Andras Lasso's avatar
      ENH: Add infrastructure to support default MRML nodes · 3e18e59f
      Andras Lasso authored and Jean-Christophe Fillion-Robin's avatar Jean-Christophe Fillion-Robin committed
      
      Allow modifying default node content: Scene can store "default" nodes. If
      a default node is specified for a class then the content of that node will
      be used to initialize new nodes and reset nodes.
      
      Currently used only for 3D views but can be used for other purposes, too
      (e.g., disable interpolation by default for volume nodes).
      
      This is a backward incompatible change. Signature of
      
        vtkMRMLNode::Reset()
      
      has been changed into
      
        vtkMRMLNode::Reset(vtkMRMLNode* defaultNode)
      
      Co-authored-by: default avatarCsaba Pinter <csaba.pinter@queensu.ca>
      3e18e59f
Loading