# Transformation Between Two Tools

**URL:** <https://discourse.slicer.org/t/transformation-between-two-tools/18958>\
**Category:** Support\
**Tags:** surgical-navigation, slicerigt\
**Created:** [July 28, 2021, 7:41pm UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958 "2021-07-28T19:41:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasmine-lou](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasmine-lou/32/11369_2.png) [@jasmine-lou](https://discourse.slicer.org/u/jasmine-lou)\
**Post date:** [July 28, 2021, 7:41pm UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958/1 "2021-07-28T19:41:44Z")

</div>

Hello!

Is there any way in Slicer to easily obtain the transform between two tools? I am using the NDI Aurora Tracker with two coils, and can currently obtain transforms between each of the coils and the Aurora tracker, but cannot get a transform between one tool to the other. I also tried adding a transform from tool 1 to tool 2 in the configuration file but that did not seem to do what I intended. Is there a module I can use for this? Thanks!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 28, 2021, 9:17pm UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958/2 "2021-07-28T21:17:09Z")

</div>

You probably want `vtkMRMLTransformNode::GetTransformBetweenNodes` which you can use on either node. See: [Slicer: vtkMRMLTransformNode Class Reference](http://apidocs.slicer.org/master/classvtkMRMLTransformNode.html)

---

<div class="post-metadata">

**Author:** ![jasmine-lou](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasmine-lou/32/11369_2.png) [@jasmine-lou](https://discourse.slicer.org/u/jasmine-lou)\
**Post date:** [July 29, 2021, 11:57am UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958/3 "2021-07-29T11:57:07Z")

</div>

Thank you so much for the response! I don’t think I quite understand the explanation; is there any way I could get that transform via the Slicer App? Or by changing some things in the Plus configuration file?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 29, 2021, 1:14pm UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958/4 "2021-07-29T13:14:51Z")

</div>

I’m not sure you can do this at the Plus level, but if you have a custom Python script (or C++ module) you could get the `vtkMRMLTransformNode` for each of the tools and then get the relative transform that could be used to map coordinates between the two spaces.

---

<div class="post-metadata">

**Author:** ![ungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ungi/32/78573_2.png) [@ungi](https://discourse.slicer.org/u/ungi)\
**Post date:** [July 29, 2021, 5:30pm UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958/5 "2021-07-29T17:30:53Z")

</div>

In PLUS, you can list any transform (between any two tools) in the PlusOpenIGTLinkServer, TransformNames section of the config file. E.g. if you add this line  
`<Transform Name="StylusToReference"/>`  
then PLUS will automatically concatenate StylusToTracker and TrackerToReference transforms and send it to Slicer. In Slicer, it will show up as a transform node called “StylusToReference”.

---

<div class="post-metadata">

**Author:** ![jasmine-lou](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jasmine-lou/32/11369_2.png) [@jasmine-lou](https://discourse.slicer.org/u/jasmine-lou)\
**Post date:** [July 29, 2021, 6:12pm UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958/6 "2021-07-29T18:12:03Z")

</div>

@ungi is there any scenario where this method would fail? This is what I did initially which was that I had a transform called Tool1ToTool2. However, when I examined the transform while holding my two tools fixed in relation to one another, I was noticing that the translation portion of the transform was changing as I was moving the two tools in unison which made me think that I was doing something incorrectly

---

<div class="post-metadata">

**Author:** ![slicer365](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slicer365/32/67549_2.png) [@slicer365](https://discourse.slicer.org/u/slicer365)\
**Post date:** [August 14, 2023, 1:48pm UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958/7 "2023-08-14T13:48:18Z")

</div>

Hi ,Mr Ungi,I have bought the Aurora device,

I want to connect it to slicer with Plus,

Now I want to send 2 tools’ position to slicer ,

How should I change the XML file.

I have 2 sensors.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/5/85b79736c13e50f8e486f618e6995c589eb191c1.png)

---

<div class="post-metadata">

**Author:** ![ungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ungi/32/78573_2.png) [@ungi](https://discourse.slicer.org/u/ungi)\
**Post date:** [August 14, 2023, 1:52pm UTC](https://discourse.slicer.org/t/transformation-between-two-tools/18958/8 "2023-08-14T13:52:49Z")

</div>

Hi, here is the PLUS user manual page for Aurora tracker: [Plus applications user manual: NDI Vega, Polaris and Aurora pose trackers](http://perk-software.cs.queensu.ca/plus/doc/nightly/user/DeviceNDI.html)

If you are not familiar with PLUS, you may need to read about the configuration file in general: [Plus applications user manual: Device set configuration](http://perk-software.cs.queensu.ca/plus/doc/nightly/user/Configuration.html)

I hope this helps.
