Difference between revisions of "Documentation/Nightly/Modules/Contours"

From Slicer Wiki
Jump to: navigation, search
m (Text replacement - "\[http:\/\/www\.slicer\.org\/slicerWiki\/index\.php\/([^ ]+) ([^]]+)]" to "$2")
 
(4 intermediate revisions by 2 users not shown)
Line 11: Line 11:
 
Author: Csaba Pinter (PerkLab, Queen's University)<br>
 
Author: Csaba Pinter (PerkLab, Queen's University)<br>
 
Contact: Csaba Pinter, <email>pinter@cs.queensu.ca</email><br>
 
Contact: Csaba Pinter, <email>pinter@cs.queensu.ca</email><br>
[http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/SlicerRT Back to SlicerRT home]
+
[[Documentation/Nightly/Extensions/SlicerRT|Back to SlicerRT home]]
 
{{documentation/{{documentation/version}}/module-introduction-row}}
 
{{documentation/{{documentation/version}}/module-introduction-row}}
 
{{documentation/{{documentation/version}}/module-introduction-logo-gallery
 
{{documentation/{{documentation/version}}/module-introduction-logo-gallery
Line 22: Line 22:
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Module Description}}
 
{{documentation/{{documentation/version}}/module-section|Module Description}}
The {{documentation/modulename}} module manages contours and contour hierarchies.
+
The {{documentation/modulename}} module manages contours and contour hierarchies.<br><br>
 +
'''NOTE: There are some inconveniences and unsupported features in the current state of this module. Instead of addressing these issues, we re-implement the whole mechanism. It will be called Segmentations, and will be available around summer of 2015'''. Until then, please see FAQ section on this page, or contact us with questions. <br>
 +
Further information about the Segmentation effort on the related [https://www.assembla.com/spaces/slicerrt/tickets/626 Assembla ticket] and [https://www.assembla.com/spaces/slicerrt/wiki/Segmentation wiki page], and the links pointing from these pages.
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
Line 32: Line 34:
  
 
{|align="center"
 
{|align="center"
|[[File:SlicerRT0.5 Contours.png|thumb|720px| Contours module GUI]]
+
|[[File:20150112_ContoursModuleUI.png|thumb|720px| Contours module GUI]]
 
|[[File:SlicerRT_ContourRepresentations.png|thumb|704px| Contours representations]]
 
|[[File:SlicerRT_ContourRepresentations.png|thumb|704px| Contours representations]]
 
|}
 
|}
Line 44: Line 46:
  
 
; Create contour from scratch
 
; Create contour from scratch
: In the Editor module create a labelmap on the desired reference anatomical volume
+
: In Contours module select 'Create new Contour' in the contour selector drop-down to create a new contour
: In the Contours module, expand the box 'Create Contour From Representation'
+
: In Subject Hierarchy module drag&drop new contour to under a contour set in the tree
:: Select the newly created labelmap, give it a name, and click 'Create'
+
: The default representation is an empty Ribbon model. It can be converted to Indexed labelmap in the Contours module, then the labelmap extracted in SH, which '''can be edited in the Editor module'''
 +
: Note: this feature is quite inconvenient right now, a full overhaul is [https://www.assembla.com/spaces/slicerrt/tickets/626 coming up soon]
  
 
; Create contour from labelmap volume or model
 
; Create contour from labelmap volume or model
: In the Subject Hierarchy module drag&drop the existing representation (labelmap or model) from 'Potential subject hierarchy nodes' list to under a structure set in the tree. This way an encapsulating Contour node gets created and associated to the corresponding color table
+
: In Contours module use the Create contour from representation section
: Alternatively, in the Contours module, expand the box 'Create Contour From Representation'
+
: In Subject Hierarchy module drag&drop the existing representation (labelmap or model) to under a contour set in the tree. This way an encapsulating Contour node gets created and associated to the corresponding color table
:: Select the desired labelmap volume or model, give it a name, and click 'Create'
 
  
; Create new Structure set from scratch
+
; Create new Contour set from scratch
: Right-click on an existing Study node and select 'Create child structure set'. This menu item is only available for Study level nodes
+
: Right-click on an existing Study node and select 'Create child contour set'. This menu item is only available for Study level nodes
 +
 
 +
; Extract labelmap representation from a contour (for editing or display).
 +
: First make sure labelmap representation is present, if not sure see Change active representation section in Contours module
 +
: In Contours module click Extract in Contour functions section
 +
: In Subject hierarchy right-click the contour and select the Extract labelmap to volume node option
  
 
;[[Documentation/Nightly/Modules/Contours/HowToEdit|Edit an existing contour]]
 
;[[Documentation/Nightly/Modules/Contours/HowToEdit|Edit an existing contour]]
Line 62: Line 69:
 
{{documentation/{{documentation/version}}/module-section|Panels and their use}}
 
{{documentation/{{documentation/version}}/module-section|Panels and their use}}
 
* Current contour(s): Currently selected contour node (vtkMRMLContourNode) or conotur hierarchy node (vtkMRMLContourHierarchyNode)
 
* Current contour(s): Currently selected contour node (vtkMRMLContourNode) or conotur hierarchy node (vtkMRMLContourHierarchyNode)
* Active representation: The active representation ('''Ribbon model / Indexed labelmap / Closed surface model''') of the selected contour. If a hierarchy is selected in which the active representations of the contained contours do not match, '''Various''' is indicated
+
* Representations: The active representation ('''Ribbon model / Indexed labelmap / Closed surface model''') of the selected contour. If a hierarchy is selected in which the active representations of the contained contours do not match, '''Various''' is indicated
 
* Change active representation: This box contains controls to convert from one representation to another
 
* Change active representation: This box contains controls to convert from one representation to another
 +
* Create contour from representation: see above
 +
* Contour functions: see above
 
<!--
 
<!--
 
{{documentation/{{documentation/version}}/module-parametersdescription}}
 
{{documentation/{{documentation/version}}/module-parametersdescription}}
Line 74: Line 83:
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|References}}
 
{{documentation/{{documentation/version}}/module-section|References}}
Issue on SlicerRT ticketing system [https://www.assembla.com/spaces/slicerrt/tickets/137 here]
+
* Issue for original Contours effort on SlicerRT Assembla ticketing system [https://www.assembla.com/spaces/slicerrt/tickets/137 here]
 +
* Issue for Segmentations (complete Contours overhaul, expected delivery 2015 summer) [https://www.assembla.com/spaces/slicerrt/tickets/626 here]
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Information for Developers}}
 
{{documentation/{{documentation/version}}/module-section|Information for Developers}}
 +
N/A
  
 
+
<!-- ---------------------------- -->
 +
=FAQ=
 +
* Extract model from a contour<br>
 +
:There is currently no UI solution to extract a model node from a contour node, but it can be done via the python console:
 +
<pre>
 +
>>> contour = getNode('Bladder_Contour')
 +
>>> points = contour.GetDicomRtRoiPoints() # This extracts the planar contour points, but you may want to extract the RibbonModel or ClosedSurfaceModel
 +
>>> pointsCopy = vtk.vtkPolyData()
 +
>>> pointsCopy.DeepCopy(points)
 +
>>> pointsCopy.GetNumberOfPoints()
 +
>>> modelNode = slicer.vtkMRMLModelNode()
 +
>>> modelNode.SetName(contour.GetStructureName())
 +
>>> modelNode = slicer.mrmlScene.AddNode(modelNode)
 +
>>> polyDataProducer = vtk.vtkTrivialProducer()
 +
>>> polyDataProducer.SetOutput(pointsCopy)
 +
>>> modelNode.SetPolyDataConnection(polyDataProducer.GetOutputPort())
 +
>>> displayNode = slicer.vtkMRMLModelDisplayNode()
 +
>>> slicer.mrmlScene.AddNode(displayNode)
 +
>>> displayNode.VisibilityOn()
 +
>>> modelNode.SetAndObserveDisplayNodeID(displayNode.GetID())
 +
</pre>
 +
:This script uses a contour node with a specific name. If you want to do this for all contours, then just iterate over the vtkMRMLContourNode nodes in the scene, like this:
 +
<pre>
 +
>>> allContours = slicer.util.getNodes('vtkMRMLContourNode*')
 +
>>> for contour in allContours.values():
 +
>>>  points = contour.GetDicomRtRoiPoints()
 +
>>> ...
 +
</pre>
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-footer}}
 
{{documentation/{{documentation/version}}/module-footer}}
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->

Latest revision as of 02:36, 27 November 2019

Home < Documentation < Nightly < Modules < Contours


For the latest Slicer documentation, visit the read-the-docs.


Introduction and Acknowledgements

This work is part of the SparKit project, funded by An Applied Cancer Research Unit of Cancer Care Ontario with funds provided by the Ministry of Health and Long-Term Care and the Ontario Consortium for Adaptive Interventions in Radiation Oncology (OCAIRO) to provide free, open-source toolset for radiotherapy and related image-guided interventions.
Author: Csaba Pinter (PerkLab, Queen's University)
Contact: Csaba Pinter, <email>pinter@cs.queensu.ca</email>
Back to SlicerRT home

Cancer Care Ontario  
Software Platform and Adaptive Radiotherapy Kit  
Ontario Consortium for Adaptive Interventions in Radiation Oncology  

Module Description

The Contours module manages contours and contour hierarchies.

NOTE: There are some inconveniences and unsupported features in the current state of this module. Instead of addressing these issues, we re-implement the whole mechanism. It will be called Segmentations, and will be available around summer of 2015. Until then, please see FAQ section on this page, or contact us with questions.
Further information about the Segmentation effort on the related Assembla ticket and wiki page, and the links pointing from these pages.

Use Cases

  • Load as ribbon, then compute DVH; the user wants to see the contours in 3D
  • Edit contour 1, edit contour 2; see contour 1 while editing contour 2
  • Create contour node, convert it to (empty) labelmap; do contouring on the labelmapo representation; convert to model
  • Create/load labelmap or surface, create Contour node from that in Subject Hierarchy module
Contours module GUI
Contours representations

Tutorials

N/A

How to

Create contour from scratch
In Contours module select 'Create new Contour' in the contour selector drop-down to create a new contour
In Subject Hierarchy module drag&drop new contour to under a contour set in the tree
The default representation is an empty Ribbon model. It can be converted to Indexed labelmap in the Contours module, then the labelmap extracted in SH, which can be edited in the Editor module
Note: this feature is quite inconvenient right now, a full overhaul is coming up soon
Create contour from labelmap volume or model
In Contours module use the Create contour from representation section
In Subject Hierarchy module drag&drop the existing representation (labelmap or model) to under a contour set in the tree. This way an encapsulating Contour node gets created and associated to the corresponding color table
Create new Contour set from scratch
Right-click on an existing Study node and select 'Create child contour set'. This menu item is only available for Study level nodes
Extract labelmap representation from a contour (for editing or display).
First make sure labelmap representation is present, if not sure see Change active representation section in Contours module
In Contours module click Extract in Contour functions section
In Subject hierarchy right-click the contour and select the Extract labelmap to volume node option
Edit an existing contour
See page via link above

Panels and their use

  • Current contour(s): Currently selected contour node (vtkMRMLContourNode) or conotur hierarchy node (vtkMRMLContourHierarchyNode)
  • Representations: The active representation (Ribbon model / Indexed labelmap / Closed surface model) of the selected contour. If a hierarchy is selected in which the active representations of the contained contours do not match, Various is indicated
  • Change active representation: This box contains controls to convert from one representation to another
  • Create contour from representation: see above
  • Contour functions: see above

Similar Modules

N/A

References

  • Issue for original Contours effort on SlicerRT Assembla ticketing system here
  • Issue for Segmentations (complete Contours overhaul, expected delivery 2015 summer) here

Information for Developers

N/A

FAQ

  • Extract model from a contour
There is currently no UI solution to extract a model node from a contour node, but it can be done via the python console:
>>> contour = getNode('Bladder_Contour')
>>> points = contour.GetDicomRtRoiPoints() # This extracts the planar contour points, but you may want to extract the RibbonModel or ClosedSurfaceModel
>>> pointsCopy = vtk.vtkPolyData()
>>> pointsCopy.DeepCopy(points)
>>> pointsCopy.GetNumberOfPoints()
>>> modelNode = slicer.vtkMRMLModelNode()
>>> modelNode.SetName(contour.GetStructureName())
>>> modelNode = slicer.mrmlScene.AddNode(modelNode)
>>> polyDataProducer = vtk.vtkTrivialProducer()
>>> polyDataProducer.SetOutput(pointsCopy)
>>> modelNode.SetPolyDataConnection(polyDataProducer.GetOutputPort())
>>> displayNode = slicer.vtkMRMLModelDisplayNode()
>>> slicer.mrmlScene.AddNode(displayNode)
>>> displayNode.VisibilityOn()
>>> modelNode.SetAndObserveDisplayNodeID(displayNode.GetID())
This script uses a contour node with a specific name. If you want to do this for all contours, then just iterate over the vtkMRMLContourNode nodes in the scene, like this:
>>> allContours = slicer.util.getNodes('vtkMRMLContourNode*')
>>> for contour in allContours.values():
>>>   points = contour.GetDicomRtRoiPoints()
>>> ...