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. 10 Nov, 2018 2 commits
  3. 23 Oct, 2018 1 commit
    • cpinter's avatar
      BUG: Fix default display and storage node creation · 0f8704d1
      cpinter authored
      The CreateDefaultDisplayNodes and CreateDefaultStorageNode functions did not use the CreateNewNodeByClass infrastructure so default nodes were not considered. This has been fixed in all node classes using such functions.
      
      Tests also needed to be fixed accordingly. Null check for scene and raw ID setting has been removed from EXERCISE_ALL_BASIC_MRML_METHODS, and all failing tests have been changed so that the tested node is in a scene.
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27516 3bd1e089-480b-0410-8dfb-8563597acbee
      0f8704d1
  4. 16 Oct, 2018 1 commit
  5. 11 Jun, 2018 4 commits
    • cpinter's avatar
      ENH: Add volume rendering options to Application Settings · 07ea3617
      cpinter authored
      In addition to the current rendering method and GPU memory size options, the following were added:
      - Default quality
      - Default interactive speed
      - Default surface smoothing
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27241 3bd1e089-480b-0410-8dfb-8563597acbee
      07ea3617
    • cpinter's avatar
      ENH: Move volume rendering properties from display node to 3D view node · e565732e
      cpinter authored
      - Move properties from vol.ren. display node to view node: RaycastTechnique, ExpectedFPS, GPUMemorySize, EstimatedSampleDistance (renamed to VolumeRenderingOversamplingFactor, as the former name was misleading as it does not specify sample distance but an oversampling factor), PerformanceControl (renamed to VolumeRenderingQuality, as it is not directly related to performance, and even the enum was called Quality), SurfaceSmoothing (renamed to VolumeRenderingSurfaceSmoothing).
        Reasons:
        1. Setting these options differently for volumes is not useful, however setting some of them per view could be useful
        2. The new multi volume rendering method has only one common mapper, and some properties cannot be set per volume
        3. It would be nice to expose these properties in Application Settings, to be able to define application defaults. For this, the view node is a better place
      
      Important note: this commit breaks backwards compatibility in terms of loading a scene containing special volume rendering settings, so those settings will not be loaded correctly. However Slicer 4.10 and soon after Slicer 5 is coming up, so this might be a good time to make this step.
      
      - Move GetSampleDistance function from displayable manager to vtkMRMLVolumeRenderingDisplayNode
      - Fix bugs related to multi-volume rendering
      - Fix vtkSlicerVolumeRenderingLogicTest and fix todo in vtkMRMLVolumeRenderingDisplayable by adding utility functions in the displayable manager
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27240 3bd1e089-480b-0410-8dfb-8563597acbee
      e565732e
    • cpinter's avatar
      STYLE: Fix indents and improve docstrings · 53f754bc
      cpinter authored
      Style related changes in view node and slice node classes to keep
      formatting consistent
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27239 3bd1e089-480b-0410-8dfb-8563597acbee
      53f754bc
    • cpinter's avatar
      ENH: Add real MultiVolume volume rendering option · a192028f
      cpinter authored
      Add vtkMultiVolume driven volume rendering method as third option.
      
      Two blocking issues with vtkMultiVolume make it unusable in Slicer as is. Workarounds have been applied:
      1. vtk/vtk#17325: Added dummy single-voxel all-transparent volume so that all user transforms are correctly handled
      2. vtk/vtk#17302: Volume connections removed from actor and mapper so that it is actually hidden from the view when visibility checkbox is turned off
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27238 3bd1e089-480b-0410-8dfb-8563597acbee
      a192028f
  6. 14 May, 2018 1 commit
  7. 09 May, 2018 1 commit
  8. 01 May, 2018 1 commit
  9. 26 Apr, 2018 1 commit
    • pinter's avatar
      BUG: Fix double-saving of MRML node attribute · f021ee64
      pinter authored
      As the WriteXML method in both the vtkMRMLGPURayCastVolumeRenderingDisplayNode class and its base class vtkMRMLVolumeRenderingDisplayNode saved the raycastTechnique attribute, saving a scene containing GPU volume rendering resulted in an invalid XML file. By removing it from the specialized class, this issue is fixed.
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27164 3bd1e089-480b-0410-8dfb-8563597acbee
      f021ee64
  10. 19 Apr, 2018 2 commits
  11. 17 Apr, 2018 1 commit
    • lassoan's avatar
      ENH: Added new volume rendering quality option: Normal · e94653c8
      lassoan authored
      SetLockSampleDistanceToInputSpacing usually provides good quality rendering at acceptable speed, but on slow computers or in virtual reality views (where very high frame rate is needed), it is still necessary to allow choose between volume rendering speed and quality.
      
      Added a new option to clearly distinguish between quality settings:
      - adaptive: sampling computed from desired fps
      - normal: sampling computed from input volume
      - maximum quality: sampling computed from input volume, with 10x oversampling
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27153 3bd1e089-480b-0410-8dfb-8563597acbee
      e94653c8
  12. 16 Mar, 2018 1 commit
  13. 13 Mar, 2018 1 commit
    • pinter's avatar
      ENH: Added performance related options to GPU volume rendering · 4e01304f
      pinter authored
      - Added option to use the mapper's feature LockSampleDistanceToInputSpacing to calculate it internally instead of setting sampling distance manually. On by default. Only applies to GPU rendering in adaptive mode.
      - Added UseJittering option to GPU display node and the UI in advanced rendering properties (called Surface smoothing). If turned on, then uses random noise to remove the wood-grain artifact. Off by default.
      - Widened range of FPS slider for adaptive mode to accommodate for new virtual reality use cases (maximum used to be 20, now it is 100)
      - Removed empty "Misc" tab from Volume rendering module UI
      - Fixed ctkDoubleSlider related warning message
      - Modernized vtkMRMLVolumeRenderingDisplayNode to use node references and new property macros. This fixed several bugs as well (e.g. not reading/writing attributes). Removed the related test step from vtkMRMLVolumePropertyNodeTest1
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@27072 3bd1e089-480b-0410-8dfb-8563597acbee
      4e01304f
  14. 10 Mar, 2018 1 commit
  15. 08 Mar, 2018 1 commit
  16. 24 Feb, 2018 1 commit
    • pinter's avatar
      ENH: Separated volume rendering preset combobox from module widget · f4b50114
      pinter authored
      The Volume Rendering module widget handled everything, which made the class quite big, and also prevented reusing the preset combobox in other modules or slicelets.
      
      - Added reusable qSlicerVolumeRenderingPresetComboBox class that contains the combobox and the shift slider
      - Added EffectiveRange member to vtkMRMLVolumePropertyNode. It sets a custom extent to the transfer functions so that only the meaningful part of it is shown (and not the long tails). Thus the shift slider is much less sensitive and is more user friendly
      - Added effectiveRange attribute to presets.xml. For now the effective range is between the second and last second points for CTs, first and second last for MRs
      - Removed calculation of transfer function extent based on volume scalar range. The effective range is always valid, and contains a meaningful range (if not then encompasses the transfer function bounds), so this is not necessary anymore (and the combobox class is also cleaner)
      - Instead of only moving the middle points of the transfer function, all the points are moved. This fixes the bug of squashing the transfer function if it was shifted beyond its extreme points (bounds)
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@26955 3bd1e089-480b-0410-8dfb-8563597acbee
      f4b50114
  17. 13 Aug, 2017 1 commit
  18. 24 Mar, 2017 1 commit
    • pinter's avatar
      STYLE: Indentation related changes · 4e0a67e3
      pinter authored
      1. vtkMRMLNode::Indent member seemed unused in the core, except from the also unused ROI list node, so the member was removed
      
      2. In WriteXML functions, the increasing indentation was added between the XML attributes, which did not have major effect on the top level, but for example in the scene view section, where indentation was increased, it made the nodes look like this:
      
        <Selection
          id="vtkMRMLSelectionNodeSingleton"    name="Selection"    hideFromEditors="true"    selectable="true"    selected="false"    singletonTag="Singleton"
      
      As the purpose of indentation is to add space in front of the _lines_, adding that space between the XML attributes seems unnecessary. With these changes, the same entry now looks like this:
      
        <Selection
          id="vtkMRMLSelectionNodeSingleton" name="Selection" hideFromEditors="true" selectable="true" selected="false"
      
      History:
      
      In the first implementation of `WriteXML()`, the name of the node (e.g vtkMRMLModelNode.cxx) was explicitly serialized and indented in the function by explicitly using `nIndent`.
      See r40 (COMP: added vtkITK and MRML libs). Code like this was used:
      
          vtkIndent i1(nIndent);
          of << i1 << "<Model";
      
          of << " id='" << this->ID << "'";
          if (this->Name && strcmp(this->Name, ""))
          {
            of << " name='" << this->Name << "'";
          }
          [...]
          if (this->Color && strcmp(this->Color, ""))
          {
            of << " color='" << this->Color << "'";
          }
      
      Then, this approach was reviewed in r133 (ENH: more transform functionality) by systematically calling the base class implementation of WriteXML() function.
      
      Code above was then updated like this:
      
         Superclass::WriteXML(of, nIndent);
         vtkIndent indent(nIndent);
      
         if (this->Color && strcmp(this->Color, ""))
         {
           of << indent << " color='" << this->Color << "'";
         }
      
      This commit simplifies the XML serialization and explicitly mark `indent` parameter as deprecated.
      
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@25870 3bd1e089-480b-0410-8dfb-8563597acbee
      4e0a67e3
  19. 20 Oct, 2016 1 commit
  20. 01 Sep, 2016 1 commit
  21. 31 Aug, 2016 1 commit
  22. 13 Jun, 2016 1 commit
  23. 01 Apr, 2016 1 commit
    • lassoan's avatar
      ENH: Simplified hiding of volume rendering display nodes · 4a97483f
      lassoan authored
      Volume rendering display node was set to be hidden at the lowest level of the class hierarchy:
      * vtkMRMLCPURayCastVolumeRenderingDisplayNode -> this->SetHideFromEditors(1);
      * vtkMRMLVolumeRenderingDisplayNode -> this->SetHideFromEditors(false);
      * vtkMRMLDisplayNode -> this->HideFromEditors = 1;
      * vtkMRMLNode -> this->HideFromEditors = 0;
      
      This was unnecessarily complex and confusing. Simplified it by removing HideFromEditors flag adjustment in all volume rendering display node base class and all children classes:
      * vtkMRMLDisplayNode -> this->HideFromEditors = 1;
      * vtkMRMLNode -> this->HideFromEditors = 0;
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@24997 3bd1e089-480b-0410-8dfb-8563597acbee
      4a97483f
  24. 31 Mar, 2016 1 commit
  25. 01 Dec, 2015 1 commit
    • jcfr's avatar
      STYLE: Remove VTKv5 support · e8a2e18e
      jcfr authored
      As discussed during the developer hangout of 2015-03-31, this commit
      removes support for VTKv5.
      
      Most of the h/cxx files have been updated automatically using the
      script "slicer_remove_vtk5_support.py" [1]. See below.
      
      The remaining of h/cxx, python and CMake files have been updated
      manually.
      
      
      slicer_remove_vtk5_support.py:
      cd ~/Project/Slicer
      ~/Download/slicer_remove_vtk5_support.py $(ack -l VTK_MAJOR_VERSION)
      
      [1] https://gist.github.com/jcfr/91d2f5d07c2a36320e48
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@24801 3bd1e089-480b-0410-8dfb-8563597acbee
      e8a2e18e
  26. 29 Sep, 2015 1 commit
    • naucoin's avatar
      BUG: fix volume property file extensions for saving · 4f65338f
      naucoin authored
      When fixing the repeated file extensions problem, the
      volume property files were missed. The problem
      came up when loading in a volume property file
      via add data (rather than a scene file) then
      trying to save it again. The node was named with
      the .vp file extension and then the file name
      was adjusted to add another .vp to the end. This
      fix changes the the name of the node to exclude
      the extension so it will save correctly.
      
      Added testing for the AddVolumePropertyFromFile
      method and added some checks to it for missing
      scene and file names. Added the supported
      write types as well.
      
      Issue #3956
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@24583 3bd1e089-480b-0410-8dfb-8563597acbee
      4f65338f
  27. 08 Mar, 2015 1 commit
  28. 19 Jan, 2015 3 commits
  29. 30 Oct, 2014 1 commit
  30. 18 Jul, 2014 1 commit
  31. 08 May, 2014 1 commit
  32. 02 May, 2014 1 commit
  33. 26 Mar, 2014 1 commit
    • hjohnson's avatar
      STYLE: Remove end of line spaces · a331fb08
      hjohnson authored
      Spaces at the end of lines can cause noise in patch sets
      when editors or git gobbles them up during other relatively
      minor changes to files.
      
      Removing end of line changes makes long term maintenance easier as
      well.
      
      When reviewing git histories or patch sets, the "--ignore-space-change"
      option can be useful in filtering out changes due only to spacing.
      
      i.e.
      git diff HEAD~2 --ignore-space-change
      
      git-svn-id: http://svn.slicer.org/Slicer4/trunk@23021 3bd1e089-480b-0410-8dfb-8563597acbee
      a331fb08