# Transformation graph for quick calculation of concatenated transforms

**URL:** <https://discourse.slicer.org/t/transformation-graph-for-quick-calculation-of-concatenated-transforms/326>\
**Category:** Development\
**Created:** [May 16, 2017, 5:23pm UTC](https://discourse.slicer.org/t/transformation-graph-for-quick-calculation-of-concatenated-transforms/326 "2017-05-16T17:23:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 16, 2017, 7:57pm UTC](https://discourse.slicer.org/t/transformation-graph-for-quick-calculation-of-concatenated-transforms/326/5 "2017-05-16T19:57:41Z")

</div>

Example:

```
transformAToB = vtk.vtkGeneralTransform()
a = getNode('MRHead').GetParentTransformNode()
b = getNode('CTChest').GetParentTransformNode()
slicer.vtkMRMLTransformNode.GetTransformBetweenNodes(a, b, transformAToB)

```

If you want to use transformAToB in a transform node using SetTransformToParent then you have to deep-copy it using slicer.vtkMRMLTransformNode.DeepCopyTransform. If you only have linear transforms it is much simpler and faster to use GetMatrixTransformBetweenNodes and SetMatrixTransformToParent.

---

_[View the full topic](https://discourse.slicer.org/t/transformation-graph-for-quick-calculation-of-concatenated-transforms/326)._
