Difference between revisions of "Documentation/4.1/Modules/Transforms"

From Slicer Wiki
Jump to: navigation, search
(Update UI screenshot)
m (Text replacement - "slicerWiki/index.php" to "wiki")
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<noinclude>{{documentation/versioncheck}}</noinclude>
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-header}}
 
{{documentation/{{documentation/version}}/module-header}}
Line 8: Line 9:
 
{{documentation/{{documentation/version}}/module-introduction-row}}
 
{{documentation/{{documentation/version}}/module-introduction-row}}
 
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].<br>
 
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].<br>
Author: Alex Yarmarkovich, Isomics, SPL <br>
+
Author: Alex Yarmarkovich (Isomics, SPL) <br>
Contact: Alex Yarmarkovich, alexy@bwh.harvard.edu <br>
+
Contributors: Jean-Christophe Fillion-Robin (Kitware), Julien Finet (Kitware)<br>
 +
Contact: Alex Yarmarkovich, <email>alexy@bwh.harvard.edu</email><br>
 
{{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
 
|{{collaborator|logo|isomics}}|{{collaborator|longname|isomics}}
 
|{{collaborator|logo|isomics}}|{{collaborator|longname|isomics}}
 +
|{{collaborator|logo|kitware}}|{{collaborator|longname|kitware}}
 
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}
 
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}
 
|{{collaborator|logo|nac}}|{{collaborator|longname|nac}}
 
|{{collaborator|logo|nac}}|{{collaborator|longname|nac}}
Line 21: Line 24:
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Module Description}}
 
{{documentation/{{documentation/version}}/module-section|Module Description}}
Transform module is used for creating and editing transformation matrices.
+
{{documentation/{{documentation/version}}/module-description}}
 
 
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
Line 34: Line 36:
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Tutorials}}
 
{{documentation/{{documentation/version}}/module-section|Tutorials}}
* Please use tutorial about [http://www.slicer.org/slicerWiki/index.php/Documentation/4.0/Training loading and viewing data].  
+
* Please use tutorial about [http://www.slicer.org/wiki/Documentation/4.0/Training loading and viewing data].  
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Panels and their use}}
 
{{documentation/{{documentation/version}}/module-section|Panels and their use}}
  
{|style="width: 100%"
+
{|
|
 
* Load panel:
 
** Load Transfrom button: brings a file browser allowing user to load a previously saved transformations from ITK style .tfm file. The .tfm files are also created by slicer when saving a scene containing transformation nodes.
 
* Display and Edit panel:
 
** Transform node selector: selects an existing transformation node or creates a new one and adds it to the scene.
 
** Transform Matrix: displays values and allows editing of individual components of 4x4 transformation matrix.
 
** Translation panel: allows editing of LR, PA, and IS translational components of the transformation matrix in the RAS space. Also, allows changing the min/max range of the slider in order to accommodate larger or smaller measurements.
 
** Rotaion panel: allows editing of LR, PA, and IS rotation angles in the RAS space.
 
** Coordinate Reference toggle: switches between global RAS space transformation and a local one, relative to the current position and orientation.
 
** Identity button: resets transformation matrix to identity.
 
** Revert button: inverts the transformation matrix.
 
| align="right" |
 
[[Image:QSlicerTransformsModuleUI.png|thumb|280px|Transforms module panel]]
 
 
|-
 
|-
|
+
| [[Image:QSlicerTransformsModuleUI.png|thumb|280px|Transforms module panel]]
 +
| [[Image:QSlicerTransformsModule.png|thumb|660px|''LinearTransform'' applied to ''Meningioma2''<br>Rotations: IS 45º<br>Translations: LR -41mm, IS 36mm]]
 
|}
 
|}
 +
 +
{{documentation/{{documentation/version}}/module-parametersdescription}}
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Similar Modules}}
 
{{documentation/{{documentation/version}}/module-section|Similar Modules}}
* Related modules: Data module, Registration modules.
+
* Related modules: [[Documentation/{{documentation/version}}/Modules/Data|Data module]], [[:Category:Documentation/{{documentation/version}}/Modules/Registration|Registration modules]].
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
Line 67: Line 59:
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Information for Developers}}
 
{{documentation/{{documentation/version}}/module-section|Information for Developers}}
{{documentation/{{documentation/version}}/module-developerinfo}}
+
===Key [[Documentation/{{documentation/version}}/Developers/MRML|MRML]] nodes===
 +
* [http://slicer.org/doc/html/classvtkMRMLTransformableNode.html vtkMRMLTransformableNode]
 +
* [http://slicer.org/doc/html/classvtkMRMLTransformNode.html vtkMRMLTransformNode]
 +
** [http://slicer.org/doc/html/classvtkMRMLLinearTransformNode.html vtkMRMLLinearTransformNode]
 +
** [http://slicer.org/doc/html/classvtkMRMLBSplineTransformNode.html vtkMRMLBSplineTransformNode]
 +
** [http://slicer.org/doc/html/classvtkMRMLGridTransformNode.html vtkMRMLGridTransformNode]
 +
How to programmatically apply a transform to a transformable node:
 +
vtkNew<[http://slicer.org/doc/html/classvtkMRMLLinearTransformNode.html vtkMRMLLinearTransformNode]> transformNode;
 +
scene->AddNode(transformNode.GetPointer());
 +
...
 +
vtkNew<vtkMatrix4x4> matrix;
 +
...
 +
transform->SetAndObserveMatrixTransformToParent( matrix.GetPointer() );
 +
...
 +
vtkMRMLVolumeNode* transformableNode = ...; // or vtkMRMLModelNode*...
 +
transformableNode->SetAndObserveTransformNodeID( transformNode->GetID() );
 +
 
 +
Because a ''transform'' node is also a ''transformable'' node, it is possible to concatenate transforms with each others:
 +
[http://slicer.org/doc/html/classvtkMRMLLinearTransformNode.html vtkMRMLLinearTransformNode*] transformNode = ...;
 +
[http://slicer.org/doc/html/classvtkMRMLLinearTransformNode.html vtkMRMLLinearTransformNode*] transformNode2 = ...;
 +
transformNode2->SetAndObserveTransformNodeID( transformNode->GetID() );
 +
...
 +
transformable->SetAndObserveTransformNodeID( transformNode2->GetID() );
  
 +
===Events===
 +
When a transform  node is observed by a transformable node, [http://slicer.org/doc/html/classvtkMRMLTransformableNode.html#ace1c30fc9df552543f00d51a20c038a6a4993bf6e23a6dfc138cb2efc1b9ce43b vtkMRMLTransformableNode::TransformModifiedEvent] is fired on the transformable node at observation time.
 +
Anytime a transform is modified, vtkCommand::ModifiedEvent is fired on the transform node and  [http://slicer.org/doc/html/classvtkMRMLTransformableNode.html#ace1c30fc9df552543f00d51a20c038a6a4993bf6e23a6dfc138cb2efc1b9ce43b vtkMRMLTransformableNode::TransformModifiedEvent] is fired on the transformable node.
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-footer}}
 
{{documentation/{{documentation/version}}/module-footer}}
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->

Latest revision as of 16:59, 21 November 2019

Home < Documentation < 4.1 < Modules < Transforms



Introduction and Acknowledgements

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 NA-MIC website.
Author: Alex Yarmarkovich (Isomics, SPL)
Contributors: Jean-Christophe Fillion-Robin (Kitware), Julien Finet (Kitware)
Contact: Alex Yarmarkovich, <email>alexy@bwh.harvard.edu</email>

Isomics, Inc.  
Kitware, Inc.  
National Alliance for Medical Image Computing (NA-MIC)  
Neuroimage Analysis Center (NAC)  


Module Description

This module is used for creating and editing transformation matrices.
Transformation nodes are used in Slicer to define spacial relationships between different nodes (such as volumes, models, fiducials, ROI's, or other Transform nodes) or between the nodes and the global RAS space.
You can establish these relations by moving nodes from the Transformable list to the Transformed list or by dragging the nodes under the Transformation nodes in the Data module.


Use Cases

Most frequently Transform module is used for these scenarios:

  • Manual Registration: You can insert a transformation node into your scene, and in the Data module drag a volume or a model under it,

making them children of the transformation node. After that any changes to the transformation matrix of this node will be applied to the display of children volumes and models.


Tutorials

Panels and their use

Transforms module panel
LinearTransform applied to Meningioma2
Rotations: IS 45º
Translations: LR -41mm, IS 36mm

Parameters:

  • Transforms
    • Active Transform: Select the transform node to display, control and edit.
  • Display - Edit>
    • Transform Matrix: 4x4 matrix. Each element is editable on double click. Type Enter to validate change, Escape to cancel or Tab to edit the next element.
    • Translation: Apply LR, PA, and IS translational components of the transformation matrix in the RAS space (in mm). Min and Max control the lower and upper bounds of the sliders.
    • Rotation: Apply LR, PA, and IS rotation angles (degrees) in the RAS space. Rotations are concatenated.
    • Coordinate Reference: Switches between global RAS space transformation and a local one, relative to the current position and orientation.
    • Identity: Resets transformation matrix to identity matrix.
    • Invert: Inverts the transformation matrix.
  • Transformed nodes
    • Transformable: List the nodes in the scene that DON'T use the transform node.
    • Transformed: List the nodes in the scene that use the transform node.
    • Right arrow: Apply the current transform node to the selected nodes in Transformable list.
    • Left arrow: Remove the current transform node from the selected nodes in the Transformed list.


Similar Modules

References

N/A

Information for Developers

Key MRML nodes

How to programmatically apply a transform to a transformable node:

vtkNew<vtkMRMLLinearTransformNode> transformNode;
scene->AddNode(transformNode.GetPointer());
...
vtkNew<vtkMatrix4x4> matrix;
...
transform->SetAndObserveMatrixTransformToParent( matrix.GetPointer() );
...
vtkMRMLVolumeNode* transformableNode = ...; // or vtkMRMLModelNode*...
transformableNode->SetAndObserveTransformNodeID( transformNode->GetID() );

Because a transform node is also a transformable node, it is possible to concatenate transforms with each others:

vtkMRMLLinearTransformNode* transformNode = ...;
vtkMRMLLinearTransformNode* transformNode2 = ...;
transformNode2->SetAndObserveTransformNodeID( transformNode->GetID() );
...
transformable->SetAndObserveTransformNodeID( transformNode2->GetID() );

Events

When a transform node is observed by a transformable node, vtkMRMLTransformableNode::TransformModifiedEvent is fired on the transformable node at observation time. Anytime a transform is modified, vtkCommand::ModifiedEvent is fired on the transform node and vtkMRMLTransformableNode::TransformModifiedEvent is fired on the transformable node.