<?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.2%2FModules%2FAnnotations</id>
	<title>Documentation/4.2/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.2%2FModules%2FAnnotations"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.2/Modules/Annotations&amp;action=history"/>
	<updated>2026-06-17T22:46:49Z</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.2/Modules/Annotations&amp;diff=32631&amp;oldid=prev</id>
		<title>UpdateBot: Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.2/Modules/Annotations&amp;diff=32631&amp;oldid=prev"/>
		<updated>2013-06-14T07:38:13Z</updated>

		<summary type="html">&lt;p&gt;Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887&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 07:38, 14 June 2013&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-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;/ins&gt;&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;div&gt;&amp;lt;!-- ---------------------------- --&amp;gt;&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;&amp;lt;!-- ---------------------------- --&amp;gt;&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;div&gt;{{documentation/{{documentation/version}}/module-header}}&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;{{documentation/{{documentation/version}}/module-header}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.2/Modules/Annotations&amp;diff=28822&amp;oldid=prev</id>
		<title>UpdateBot: Nightly -&gt; 4.2</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.2/Modules/Annotations&amp;diff=28822&amp;oldid=prev"/>
		<updated>2012-10-31T22:00:45Z</updated>

		<summary type="html">&lt;p&gt;Nightly -&amp;gt; 4.2&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&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;
This work is part of the 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. Information on NA-MIC can be obtained from the [http://www.na-mic.org/ NA-MIC website].&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Nicole Aucoin, BWH&amp;lt;br&amp;gt;&lt;br /&gt;
Contributor: Kilian Pohl, UPenn&amp;lt;br&amp;gt;&lt;br /&gt;
Contributor: Daniel Haehn, UPenn&amp;lt;br&amp;gt;&lt;br /&gt;
Contributors: Yong Zhang, BWH&amp;lt;br&amp;gt;&lt;br /&gt;
Contributor: Alex Yarmarkovich, Isomics&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;
=== Access to Fiducial Locations from Python ===&lt;br /&gt;
&lt;br /&gt;
Starting from the ID of an Annotation hierarchy node that collects a group of fiducials, you can get a fiducial 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;
  coords = [0,0,0]&lt;br /&gt;
  annotation.GetFiducialCoordinates(coords)&lt;br /&gt;
  print coords&lt;br /&gt;
&lt;br /&gt;
If you have the id of the fiducial node, it's more direct:&lt;br /&gt;
  fidID = &amp;quot;vtkMRMLAnnotationFiducialNode1&amp;quot;&lt;br /&gt;
  fid = slicer.mrmlScene.GetNodeByID(fidID)&lt;br /&gt;
  coords = [0,0,0]&lt;br /&gt;
  fid.GetFiducialCoordinates(coords)&lt;br /&gt;
  print coords[0], coords[1], coords[2]&lt;br /&gt;
&lt;br /&gt;
You can also look at the sample code in the [https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/Scripts/Endoscopy.py#L287  Endoscopy module] to see how python is used to access fiducials.&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;
=== Programmatic Access to Fiducials ===&lt;br /&gt;
&lt;br /&gt;
This section explains how to access fiducial nodes added into the scene by the user.&lt;br /&gt;
&lt;br /&gt;
In your module's Logic class, overwrite SetMRMLSceneInternal to observe the NodeAddedEvent of the scene:&lt;br /&gt;
 void vtkSlicerMYMODULEModuleLogic::SetMRMLSceneInternal(vtkMRMLScene * newScene)&lt;br /&gt;
   {&lt;br /&gt;
   vtkIntArray *events = vtkIntArray::New();&lt;br /&gt;
   events-&amp;gt;InsertNextValue(vtkMRMLScene::NodeAddedEvent);&lt;br /&gt;
   // Optionally you can add here more events&lt;br /&gt;
   // you can be interested in such as vtkMRMLScene::NodeRemovedEvent&lt;br /&gt;
   this-&amp;gt;SetAndObserveMRMLSceneEventsInternal(newScene, events);&lt;br /&gt;
   events-&amp;gt;Delete();&lt;br /&gt;
   }&lt;br /&gt;
Via the set and observe mrml scene macro, anytime a node is added into the scene, it will trigger the base Logic class method&lt;br /&gt;
[http://slicer.org/doc/html/classvtkMRMLAbstractLogic.html#a51fdf00ecfc18c1a1465d4bccb789ef1 vtkMRMLAbstractLogic::ProcessMRMLNodesEvents] which calls the virtual method &amp;lt;code&amp;gt;vtkMRMLAbstractLogic::OnMRMLSceneNodeAdded(vtkMRMLNode* node)&amp;lt;/code&amp;gt; to reimplement in your logic:&lt;br /&gt;
 void vtkSlicerMYMODULEModuleLogic::OnMRMLSceneNodeAdded(vtkMRMLNode* addedNode)&lt;br /&gt;
   {&lt;br /&gt;
   vtkMRMLAnnotationFiducialNode* fidNode =&lt;br /&gt;
     vtkMRMLAnnotationFiducialNode::SafeDownCast(addedNode);&lt;br /&gt;
   if (fidNode)&lt;br /&gt;
     {&lt;br /&gt;
     // here you write what you need to do when a &lt;br /&gt;
     // fiducial node is added into the scene&lt;br /&gt;
     }&lt;br /&gt;
   }&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 fiducials with the mouse are:&lt;br /&gt;
  selectionNode-&amp;gt;SetActiveAnnotationID (&amp;quot;vtkMRMLAnnotationFiducialNode&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 fiducial has been placed, and you just need to reset the current interaction mode for future placing (the active annotation id 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>