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. 11 Jun, 2018 1 commit
    • 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 31 Mar, 2016 1 commit
  9. 24 Jun, 2012 1 commit