1. 08 Mar, 2019 1 commit
    • jcfr's avatar
      COMP: Fix unused warnings related to use of vtkMRMLNodePropertyMacros · 29be7973
      jcfr authored
      These classes where using the macros vtkMRMLWriteXMLBeginMacro and
      vtkMRMLWriteXMLEndMacro but without any content printed or written
      between those calls.
      
      This commit fixes warnings like the following:
      
      ```cpp
      [...]
      Modules/Loadable/VolumeRendering/MRML/vtkMRMLGPURayCastVolumeRenderingDisplayNode.cxx: In member function ‘virtual void vtkMRMLGPURayCastVolumeRenderingDisplayNode::ReadXMLAttributes(const char**)’:
      Libs/MRML/Core/vtkMRMLNodePropertyMacros.h:148:15: warning: variable ‘xmlReadAttName’ set but not used [-Wunused-but-set-variable]
         const char* xmlReadAttName; \
                     ^~~~~~~~~~~~~~
      Modules/Loadable/VolumeRendering/MRML/vtkMRMLGPURayCastVolumeRenderingDisplayNode.cxx:48:3: note: in expansion of macro ‘vtkMRMLReadXMLBeginMacro’
         vtkMRMLReadXMLBeginMacro(atts);
         ^~~~~~~~~~~~~~~~~~~~~~~~
      [...]
      Modules/Loadable/VolumeRendering/MRML/vtkMRMLGPURayCastVolumeRenderingDisplayNode.cxx: In member function ‘virtual void vtkMRMLGPURayCastVolumeRenderingDisplayNode::WriteXML(std::ostream&, int)’:
      Libs/MRML/Core/vtkMRMLNodePropertyMacros.h:30:12: warning: unused variable ‘xmlWriteOutputStream’ [-Wunused-variable]
         ostream& xmlWriteOutputStream = of;
                  ^~~~~~~~~~~~~~~~~~~~
      Modules/Loadable/VolumeRendering/MRML/vtkMRMLGPURayCastVolumeRenderingDisplayNode.cxx:57:3: note: in expansion of macro ‘vtkMRMLWriteXMLBeginMacro’
         vtkMRMLWriteXMLBeginMacro(of);
         ^~~~~~~~~~~~~~~~~~~~~~~~~
      ```
      
      ```cpp
      [...]
      Modules/Loadable/VolumeRendering/MRML/vtkMRMLGPURayCastVolumeRenderingDisplayNode.cxx: In member function ‘virtual void vtkMRMLGPURayCastVolumeRenderingDisplayNode::PrintSelf(std::ostream&, vtkIndent)’:
      Libs/MRML/Core/vtkMRMLNodePropertyMacros.h:417:12: warning: unused variable ‘printOutputStream’ [-Wunused-variable]
         ostream& printOutputStream = os; \
                  ^~~~~~~~~~~~~~~~~
      Modules/Loadable/VolumeRendering/MRML/vtkMRMLGPURayCastVolumeRenderingDisplayNode.cxx:78:3: note: in expansion of macro ‘vtkMRMLPrintBeginMacro’
         vtkMRMLPrintBeginMacro(os, indent);
         ^~~~~~~~~~~~~~~~~~~~~~
      Libs/MRML/Core/vtkMRMLNodePropertyMacros.h:418:13: warning: variable ‘printOutputIndent’ set but not used [-Wunused-but-set-variable]
         vtkIndent printOutputIndent = indent;
                   ^~~~~~~~~~~~~~~~~
      Modules/Loadable/VolumeRendering/MRML/vtkMRMLGPURayCastVolumeRenderingDisplayNode.cxx:78:3: note: in expansion of macro ‘vtkMRMLPrintBeginMacro’
         vtkMRMLPrintBeginMacro(os, indent);
      ```
      
      From: Pablo Hernandez-Cerdan <pablo.hernandez@kitware.com>
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27999 3bd1e089-480b-0410-8dfb-8563597acbee
      29be7973
  2. 05 Mar, 2019 1 commit
  3. 04 Mar, 2019 2 commits
    • jcfr's avatar
      COMP: Markups/VTKWidgets: Fix -Wunused-parameter and -Wunused-variable warnings · a9cf8672
      jcfr authored
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27987 3bd1e089-480b-0410-8dfb-8563597acbee
      a9cf8672
    • lassoan's avatar
      ENH: Reworked markups fiducials and added line, angle, and curves · 6289b334
      lassoan authored
      
      
      Features:
      - New markups: angle, line, open curve, closed curve
      - Speed improvement: thousands of markup points can be visualized and interactively manipulated (previously, the limit was about 50-100 points)
      - Live preview: preview of markup position and label is shown during placement in all views, current point is highlighted in all views
      - Slide on surface: in 3D views, markups are kept on visible surfaces (previously, placement was done on visible surface, but adjustments were simply constrained to the view plane)
      - Improved keyboard shortcuts:
        - LeftClick to jump to control point
        - LeftClick-and-drag: translate control point
        - Delete: delete highlighted markup
        - Ctrl-LeftClick: insert point along line
        - MiddleClick-and-drag: translate widget (experimental)
      
      Fixes:
      - Labels in 3D can no longer be partially obscured by 3D geometry (sometimes labels are visible when the corresponding markup is not visible anymore, but this will be fixed soon)
      - Point picking in 3D views is unstable
      
      Infrastructure improvements:
      - Focus management is centralized (interactor style queries all the displayable managers if they can process the event and then forwards the event for processing to the most suitable one). This allows much faster event management than using VTK's picking manager.
      - Interaction events are converted to vtkEventData type (originally introduced for virtual reality), which can carry all important metadata with them (display and world position, key modifiers, associated view and data nodes, etc.). This allows processing all kinds of interaction events (mouse, keyboard, virtual reality, any new interaction devices, etc.) using the same framework and modules have easy access to lots of metadata in all interaction events.
      - Maximum number of markups can be specified for markups fiducials (e.g., if it is set to 1 then the markup node can be used for getting a single point from the user).
      - Any point can be placed again (no user interface for this yet) - this can be used for predefining markup names and then place them.
      - Keyboard shortcuts are configurable (no user interface yet) - flexible module/application specific keyboard mapping is feasible (VTK's event translator does not support event translation with modifiers, widget-state-dependent shortcuts, etc.)
      - No more synchronization needed between MRML and widget states: widget states are directly stored in MRML, including point positions (as vtkPolyData) - in local and world coordinate system. This removed lots of synchronization overhead and potential for bugs.
      
      Note that this first set of changes is just a beginning of a number of new features and improvements.
      Co-authored-by: Andras Lasso's avatarAndras Lasso <lasso@queensu.ca>
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27974 3bd1e089-480b-0410-8dfb-8563597acbee
      6289b334
  4. 01 Mar, 2019 1 commit
    • lassoan's avatar
      BUG: Fix mouse cursor in Segment Editor · 4f2e0807
      lassoan authored
      Since recent updates in VTK Qt widget, when a Segment Editor effect was active the mouse cursor remained the default arrow cursor.
      Fixed by adding setViewCursor() method that calls appropriate method to change the cursor shape, and calling this method from Segment Editor.
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27971 3bd1e089-480b-0410-8dfb-8563597acbee
      4f2e0807
  5. 19 Feb, 2019 2 commits
  6. 18 Feb, 2019 1 commit
    • cpinter's avatar
      ENH: Use subject hierarchy in Models module · e9f25f8c
      cpinter authored
      - Only shows model and model hierarchy nodes (which are represented as SH folders)
      - All plugins are disabled except for Models, Folder, Opacity (and Default)
      - Apply color to branch action provided by the Folder plugin replaces the checkbox in model hierarchy
        - When the user changes the color of the folder then this option gets enabled automatically
        - Can be enabled/disabled using a checkable visibility action (right-click on eye icon or color)
        - If enabled, then visibility only applies to the folder, otherwise the default SH behavior is used (show/hide all items in whole branch)
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27966 3bd1e089-480b-0410-8dfb-8563597acbee
      e9f25f8c
  7. 09 Feb, 2019 2 commits
    • pieper's avatar
      STYLE: remove unneeded debug print · de605a29
      pieper authored
      From: Steve Pieper <pieper@isomics.com>
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27960 3bd1e089-480b-0410-8dfb-8563597acbee
      de605a29
    • pieper's avatar
      ENH: adds hook for loading directory archetypes · c2ee153c
      pieper authored
      When a directory is added via the Add Data dialog,
      it may contain a collection of files that should be
      treated as a single MRML data type, such as a series
      of image files that get loaded as a volume.
      
      This change allows a qSlicerFileReader subclass to define
      a method that can examine the contents of a directory and
      filter out any files that should be loaded as a group.  One
      of these files then serves as the archetype and the io properties
      can be configured such that the files are loaded correctly.
      
      The qSlicerVolumesReader and related classes have been updated
      to use the hooks for reading multiple image files as a volume
      by default.
      
      From: Steve Pieper <pieper@isomics.com>
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27959 3bd1e089-480b-0410-8dfb-8563597acbee
      c2ee153c
  8. 27 Jan, 2019 1 commit
  9. 26 Jan, 2019 1 commit
  10. 21 Jan, 2019 1 commit
  11. 13 Jan, 2019 3 commits
  12. 11 Jan, 2019 1 commit
    • johan.andruejol's avatar
      ENH: Update level tracing effect on mouse wheel event · b623e538
      johan.andruejol authored
      This allows the level tracing effect to be updated when the user scrolls
      through the slices.
      
      On the implementation:
      Note that the method processViewNodeEvents is used instead of adding the
      events with the MouseMoveEvent as the MouseMoveEvent eats the event
      (abortEvent == True) which prevent the slice from scrolling.
      If the MouseWheelForwardEvent and MouseWheelBackwardEvent are given their
      own case (without abortEvent == True) weird interaction happen as the
      effect preview is seemingly called before the slice has scrolled to the new
      offset.
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27684 3bd1e089-480b-0410-8dfb-8563597acbee
      b623e538
  13. 07 Jan, 2019 1 commit
  14. 03 Jan, 2019 1 commit
  15. 18 Dec, 2018 2 commits
  16. 17 Dec, 2018 1 commit
    • lassoan's avatar
      BUG: Fix error: AddMRMLDisplayableManagerEvent - eventId:16004 already added · 393509c2
      lassoan authored
      Since some refactoring in related code, such errors appeared in the log:
      
      ERROR: In C:\SAB\P\Slicer-0\Libs\MRML\DisplayableManager\vtkMRMLAbstractDisplayableManager.cxx, line 801
      vtkMRMLAbstractDisplayableManager (000001F5B12AC5E0): AddMRMLDisplayableManagerEvent - eventId:16004 already added
      
      The problem was that vtkMRMLAbstractDisplayableManager::AddMRMLDisplayableManagerEvent used GetSize() to get number of values in this->Internal->MRMLDisplayableNodeObservableEvents array. GetSize() returns the array capacity, not the actual number of values in the array. As elements are added to an array, capacity is increased exponentially (0, 1, 3, 7, ...) while actual size is increased linearly (0, 1, 2, ...), so uninitialized values were read from the array's buffer (which sometimes contained ID of already added events).
      
      I've checked all other uses of GetSize() in the code based and fixed them (except errors in Charts classes, as they will be removed soon anyway).
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27663 3bd1e089-480b-0410-8dfb-8563597acbee
      393509c2
  17. 15 Dec, 2018 2 commits
  18. 14 Dec, 2018 1 commit
  19. 13 Dec, 2018 1 commit
  20. 12 Dec, 2018 2 commits
    • cpinter's avatar
      BUG: Prevent deleting scene in SH when nothing is selected · f209e9d0
      cpinter authored
      In case of deletion with no selection in subject hierarchy the whole scene was deleted. This could not happen in Slicer application, but it was possible in other SH tree views set up in a way that allowed the presence of items that the proxy model rejected. For example filtering out node types that showed up because they were parents of otherwise accepted items (so their parents showed up to show their position in the tree and allow them to show in general).
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27626 3bd1e089-480b-0410-8dfb-8563597acbee
      f209e9d0
    • lassoan's avatar
      BUG: Fixed segment remaining completely transparent after Threshold effect · a5495253
      lassoan authored
      When user changed current segment while Threshold effect was active, the segment that was originally selected remained completely transparent (invisible) after thresholding was completed.
      
      Now opacity of all segments are properly restored after preview, even if user selects a different segment during thresholding.
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27625 3bd1e089-480b-0410-8dfb-8563597acbee
      a5495253
  21. 11 Dec, 2018 1 commit
  22. 08 Dec, 2018 1 commit
    • jcfr's avatar
      ENH: Speedup (from 2x to 10x faster) and simplify python tests · 783cf816
      jcfr authored
      
      * Run python self tests with a messageDelay of 100ms. Message delay is used
        in function "delayDisplay" to (1) let the event loop catch up to the state
        of the test and (2) to display a meaningful message when running test
        interactively from Slicer.
      
        When running tests on the dashboard, there is no need to wait too long
        before each test steps. This commit sets a default of 50ms when tests
        are executed from the module panel. It also provides a Slicer to change
        the value.
      
      * Refactor tests to use ScriptedLoadableModule base classes
      
      * Remove redundant test case AbdominalAtlasTest already coverted by
        AtlasTests
      
      * Remove duplicated implementation of functions like takeScreenshot.
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27617 3bd1e089-480b-0410-8dfb-8563597acbee
      783cf816
  23. 06 Dec, 2018 4 commits
  24. 05 Dec, 2018 5 commits
  25. 04 Dec, 2018 1 commit
    • cpinter's avatar
      ENH: Make anatomic region expand button blink 3x · 390396d1
      cpinter authored
      According to feedback the single blink of the expand button that opens the anatomic region panel in the terminology selector widget looked like a bug. Now it blinks three times, making it more obvious that it's intentional. If it's too much, then we can dial it down later, based on further feedback.
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27594 3bd1e089-480b-0410-8dfb-8563597acbee
      390396d1