<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.5%2FModules%2FAnnotations</id>
	<title>Documentation/4.5/Modules/Annotations - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.5%2FModules%2FAnnotations"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.5/Modules/Annotations&amp;action=history"/>
	<updated>2026-04-21T06:19:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.5/Modules/Annotations&amp;diff=61920&amp;oldid=prev</id>
		<title>Grundlett: Text replacement - &quot;slicerWiki/index.php&quot; to &quot;wiki&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.5/Modules/Annotations&amp;diff=61920&amp;oldid=prev"/>
		<updated>2019-11-21T17:33:18Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;slicerWiki/index.php&amp;quot; to &amp;quot;wiki&amp;quot;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:33, 21 November 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l68&quot; &gt;Line 68:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 68:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Use the Markups module for fiducials ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Use the Markups module for fiducials ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Fiducials have been moved to the [http://www.slicer.org/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;slicerWiki/index.php&lt;/del&gt;/Documentation/Nightly/Modules/Markups  Markups module].'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Fiducials have been moved to the [http://www.slicer.org/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;wiki&lt;/ins&gt;/Documentation/Nightly/Modules/Markups  Markups module].'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Add a Ruler via Python ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Add a Ruler via Python ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Grundlett</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.5/Modules/Annotations&amp;diff=43918&amp;oldid=prev</id>
		<title>UpdateBot: Nightly -&gt; 4.5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.5/Modules/Annotations&amp;diff=43918&amp;oldid=prev"/>
		<updated>2015-11-12T22:14:52Z</updated>

		<summary type="html">&lt;p&gt;Nightly -&amp;gt; 4.5&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
:'''Author(s)/Contributor(s):''' Nicole Aucoin (SPL, BWH), Kilian Pohl (UPenn), Daniel Haehn (UPenn), Yong Zhang (BWH), Alex Yarmarkovich (Isomics)&lt;br /&gt;
: '''Acknowledgements:''' This work is part of the [http://www.na-mic.org/ National Alliance for Medical Image Computing] (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149.&amp;lt;br&amp;gt;&lt;br /&gt;
: '''Contact:''' Nicole Aucoin, &amp;lt;email&amp;gt;nicole@bwh.harvard.edu&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|nac}}|{{collaborator|longname|nac}}&lt;br /&gt;
}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Use Cases}}&lt;br /&gt;
Most frequently used for these scenarios:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1: placing fiducial markers at points of interest on images&lt;br /&gt;
* Use Case 2: using fiducials to seed tractography&lt;br /&gt;
* Use Case 3: using rulers to measure tumor diameters&lt;br /&gt;
* Use Case 4: using ROIs to crop volume rendering&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Tutorials}}&lt;br /&gt;
&lt;br /&gt;
To delete multiple fiducials from a list press down the Control key and left click to select fiducials in the Annotations GUI, then click on the trash can to delete them.&lt;br /&gt;
&lt;br /&gt;
To move multiple fiducials from one list to another, hold down the Shift key and left click to select a group of fiducials, then while still holding down the shift key, left click on the selection to drag and drop it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Panels and their use}}&lt;br /&gt;
&lt;br /&gt;
A list of all the panels in the interface, their features, what they mean, and how to use them. &lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:Slicer4-1-Annotations-GUI.jpeg|thumb|200px|Annotations]]&lt;br /&gt;
|[[Image:Slicer4-Annotations-ModifyPropeties.jpeg|thumb|200px|Modify Annotation Properties]]&lt;br /&gt;
|[[Image:Slicer4-Annotations-ModifyHierarchy.jpeg|thumb|200px|Modify Hierarchy Properties]]&lt;br /&gt;
|[[Image:Slicer4-Annotations-Toolbar.jpeg|thumb|200px|Annotation tool bar]]&lt;br /&gt;
|}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-parametersdescription}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Similar Modules}}&lt;br /&gt;
* The Annotations tool bar at the top of the main Slicer window is used to add new annotations to the scene.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|References}}&lt;br /&gt;
N/A&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-developerinfo}}&lt;br /&gt;
&lt;br /&gt;
=== Use the Markups module for fiducials ===&lt;br /&gt;
&lt;br /&gt;
'''Fiducials have been moved to the [http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Markups  Markups module].'''&lt;br /&gt;
&lt;br /&gt;
=== Add a Ruler via Python ===&lt;br /&gt;
&lt;br /&gt;
Use this code to programatically add a ruler to the scene:&lt;br /&gt;
&lt;br /&gt;
  rulerNode = slicer.vtkMRMLAnnotationRulerNode()&lt;br /&gt;
  rulerNode.SetPosition1(-10,-10,-10)&lt;br /&gt;
  rulerNode.SetPosition2(10,10,10)&lt;br /&gt;
  rulerNode.Initialize(slicer.mrmlScene)&lt;br /&gt;
&lt;br /&gt;
=== Access to Ruler Locations from Python ===&lt;br /&gt;
&lt;br /&gt;
Starting from the ID of an Annotation hierarchy node that collects a group of rulers, you can get a ruler location using the following python code:&lt;br /&gt;
  # get the first list of annotations&lt;br /&gt;
  listNodeID = &amp;quot;vtkMRMLAnnotationHierarchyNode2&amp;quot;&lt;br /&gt;
  annotationHierarchyNode = slicer.mrmlScene.GetNodeByID(listNodeID)&lt;br /&gt;
  # get the first in the list&lt;br /&gt;
  listIndex = 0&lt;br /&gt;
  annotation = annotationHierarchyNode.GetNthChildNode(listIndex).GetAssociatedNode()&lt;br /&gt;
  coords1 = [0,0,0]&lt;br /&gt;
  coords2 = [0,0,0]&lt;br /&gt;
  annotation.GetPosition1(coords1)&lt;br /&gt;
  annotation.GetPosition2(coords2)&lt;br /&gt;
  print coords1, coords2&lt;br /&gt;
&lt;br /&gt;
If you have the id of the ruler node, it's more direct:&lt;br /&gt;
  rulerID = &amp;quot;vtkMRMLAnnotationRulerNode1&amp;quot;&lt;br /&gt;
  ruler = slicer.mrmlScene.GetNodeByID(rulerID)&lt;br /&gt;
  coords1 = [0,0,0]&lt;br /&gt;
  coords2 = [0,0,0]&lt;br /&gt;
  ruler.GetPosition1(coords1)&lt;br /&gt;
  ruler.GetPosition2(coords2)&lt;br /&gt;
  print coords1, coords2&lt;br /&gt;
&lt;br /&gt;
=== Placing the GUI into Ruler or ROI Place Mode via Python ===&lt;br /&gt;
&lt;br /&gt;
To programatically set the mouse mode to placing rulers or ROIs use this code from python:&lt;br /&gt;
&lt;br /&gt;
  selectionNode = slicer.mrmlScene.GetNodeByID(&amp;quot;vtkMRMLSelectionNodeSingleton&amp;quot;)&lt;br /&gt;
  # place rulers&lt;br /&gt;
  selectionNode.SetReferenceActivePlaceNodeClassName(&amp;quot;vtkMRMLAnnotationRulerNode&amp;quot;)&lt;br /&gt;
  # to place ROIs use the class name vtkMRMLAnnotationROINode&lt;br /&gt;
  interactionNode = slicer.mrmlScene.GetNodeByID(&amp;quot;vtkMRMLInteractionNodeSingleton&amp;quot;)&lt;br /&gt;
  placeModePersistence = 1&lt;br /&gt;
  interactionNode.SetPlaceModePersistence(placeModePersistence)&lt;br /&gt;
  # mode 1 is Place, can also be accessed via slicer.vtkMRMLInteractionNode().Place&lt;br /&gt;
  interactionNode.SetCurrentInteractionMode(1)&lt;br /&gt;
&lt;br /&gt;
=== Transforms ===&lt;br /&gt;
Individual annotations are transformable (able to be placed under a transform node), but lists are not. In order to apply a transform to a set of annotations, open the python console (View -&amp;gt; Python Interctor) and use the following code. First you'll need to get the transform node MRML id from the Data module (click on Display MRML IDs), and save it to a variable:&lt;br /&gt;
  transformNodeID = &amp;quot;vtkMRMLLinearTransformNode5&amp;quot;&lt;br /&gt;
Then get the id of the annotation hierarchy list node that holds the annotations that you wish to transform:&lt;br /&gt;
  listNodeID = &amp;quot;vtkMRMLAnnotationHierarchyNode3&amp;quot;&lt;br /&gt;
Then use this code snippet to apply the transform to all the annotations under the hierarchy node:&lt;br /&gt;
  annotationHierarchyNode = slicer.mrmlScene.GetNodeByID(listNodeID)&lt;br /&gt;
  numNodes = annotationHierarchyNode.GetNumberOfChildrenNodes()&lt;br /&gt;
  for i in range(numNodes):&lt;br /&gt;
    annotation = annotationHierarchyNode.GetNthChildNode(i).GetAssociatedNode()&lt;br /&gt;
    annotation.SetAndObserveTransformNodeID(transformNodeID)&lt;br /&gt;
* [[Documentation/{{documentation/version}}/Modules/Transforms#Information_for_Developers|Read more]] about transforming MRML nodes&lt;br /&gt;
&lt;br /&gt;
===Selection and interaction===&lt;br /&gt;
This section indicates how to change in the GUI the mouse placing mode to start placing nodes.&lt;br /&gt;
 &lt;br /&gt;
For the selection and interaction nodes, make sure that you access the singleton nodes already in the scene (rather than making your own) via (caveat: this call works on displayable managers, you may have to go a different route to get at the application logic):&lt;br /&gt;
  vtkMRMLApplicationLogic *mrmlAppLogic = this-&amp;gt;GetMRMLApplicationLogic();&lt;br /&gt;
  vtkMRMLInteractionNode *inode = mrmlAppLogic-&amp;gt;GetInteractionNode();&lt;br /&gt;
  vtkMRMLSelectionNode *snode = mrmlAppLogic-&amp;gt;GetSelectionNode();&lt;br /&gt;
If you can't get at the mrml application logic, you can get the nodes from the scene:&lt;br /&gt;
  vtkMRMLInteractionNode *interactionNode = vtkMRMLInteractionNode::SafeDownCast(this-&amp;gt;GetMRMLScene()-&amp;gt;GetNodeByID(&amp;quot;vtkMRMLInteractionNodeSingleton&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
You can then call methods on the nodes or add your own event observers as in&lt;br /&gt;
  vtkSlicerAnnotationModuleLogic::ObserveMRMLScene&lt;br /&gt;
You can see vtkSlicerAnnotationModuleLogic::ProcessMRMLNodesEvents to see how to respond to interaction node changes, but I don't think you'll need to do that.&lt;br /&gt;
&lt;br /&gt;
Slicer4/Base/QTGUI/qSlicerMouseModeToolBar.cxx has a lot of the code you'll need as well, with a slightly different way of getting at the mrml app logic to access the nodes.&lt;br /&gt;
&lt;br /&gt;
The calls you need to make to switch into placing rulers with the mouse are:&lt;br /&gt;
  selectionNode-&amp;gt;SetReferenceActivePlaceNodeClassName(&amp;quot;vtkMRMLAnnotationRulerNode&amp;quot;);&lt;br /&gt;
  interactionNode-&amp;gt;SetCurrentInteractionMode(vtkMRMLInteractionNode::Place);&lt;br /&gt;
If you don't set PlaceModePersistence on the interaction node, the mouse mode/current interaction mode will automatically go back to view transform after one ruler has been placed, and you just need to reset the current interaction mode for future placing (the active place node class name is persistent).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
</feed>