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. 27 Feb, 2019 1 commit
    • jcfr's avatar
      BUG: ScreenCapture: Fix deprecated use of QPixmap::grabWidget · 109bd90b
      jcfr authored
      This fixes a deprecation warning QPixmap::grabWidget is deprecated, use
      QWidget::grab() instead.
      To replicate the warning, use ScreenCapture module to capture a single
      image of all views.
      
      This use case was accidentally overlooked when r26255 was committed
      which fixed other instances.
      
      Once Slicer is no longer trying to support both Qt4 and Qt5, then
      QWidget::grab() can be used directly. Currently
      ctkWidgetUtils.grabWidget is used which uses QPixmap::grabWidget if Qt4
      and QWidget::grab if Qt5.
      
      From: jamesobutler <jbutler@sonovol.com>
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27969 3bd1e089-480b-0410-8dfb-8563597acbee
      109bd90b
  6. 19 Feb, 2019 2 commits
  7. 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
  8. 15 Feb, 2019 1 commit
  9. 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
  10. 27 Jan, 2019 1 commit
  11. 26 Jan, 2019 1 commit
  12. 21 Jan, 2019 1 commit
  13. 13 Jan, 2019 3 commits
  14. 11 Jan, 2019 2 commits
    • 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
    • lassoan's avatar
      BUG: Attempt to fix SampleData test on Windows · bea87318
      lassoan authored
      URI needs prepending three forward slashes on Windows and just two was added.
      Fixed by creating URI using urlparse.
      
      Also removed unnecessary temporary file removal (auto-remove is enabled by default).
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27683 3bd1e089-480b-0410-8dfb-8563597acbee
      bea87318
  15. 10 Jan, 2019 1 commit
  16. 07 Jan, 2019 1 commit
  17. 06 Jan, 2019 1 commit
  18. 03 Jan, 2019 3 commits
  19. 26 Dec, 2018 1 commit
  20. 23 Dec, 2018 1 commit
  21. 19 Dec, 2018 1 commit
  22. 18 Dec, 2018 2 commits
  23. 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
  24. 15 Dec, 2018 8 commits