# OpenIGTlinkIF Transform references

**URL:** <https://discourse.slicer.org/t/openigtlinkif-transform-references/8097>\
**Category:** Development\
**Created:** [August 19, 2019, 7:33pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097 "2019-08-19T19:33:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)\
**Post date:** [August 19, 2019, 7:33pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/1 "2019-08-19T19:33:23Z")

</div>

I am using openigtif extenstion to get streaming data from my tracker. Is there a way to get a reference to the transforms created by openigtif extenstion before they are created?

I want a object to be set to a default position (identity) until the slicerIGTIF updates this transform.  
I have tried creating a transform node with the same name as the transform coming in, but I just get duplicates instead.

---

<div class="post-metadata">

**Author:** ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)\
**Post date:** [August 19, 2019, 7:36pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/2 "2019-08-19T19:36:40Z")

</div>

Update to my own question.

I am thinking of going down the path of having an observer that watches the scene to see if a node with the correct name was added. Is this the best method?

---

<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:** [August 21, 2019, 4:38pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/3 "2019-08-21T16:38:12Z")

</div>

OpenIGTlinkIF module looks up nodes by name (that matches the device name in OpenIGTLink message).

We usually create the node by the appropriate name _before_ we establish the OpenIGTLink connection. This way OpenIGTLinkIF module finds that node and updates it in real-time.

If you prefer OpenIGTLinkIF to create the nodes for you then looking them up by name is correct, too. The only slight additional complexity is that you need to add the scene observers to detect when the nodes are added.

---

<div class="post-metadata">

**Author:** ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)\
**Post date:** [August 23, 2019, 1:11pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/4 "2019-08-23T13:11:25Z")

</div>

I assumed that the openigtlinkif module looked nodes up by name. And I created a node with the same name prior to creating the openigt link. However, I get another node with the same name when the connection is established rather than the node that I previously created being used.

Here is the screenshot. The first one in the list is the one I created. The second is the one that was added by openigtlinkif after establishing the connection.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/c/fc954e02b7cdf7c1ad2b09c6eb74197262011183.png)

---

<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:** [August 23, 2019, 4:10pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/5 "2019-08-23T16:10:51Z")

</div>

Please try with latest Preview Release of Slicer and let us know if this is still the case.

@Sunderlandkyl Do you remember having a problem that OpenIGTLinkIF created new nodes instead of reusing existing nodes by the same name&type?

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [August 23, 2019, 4:24pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/6 "2019-08-23T16:24:48Z")

</div>

When it was originally split into the SlicerOpenIGTLink module it had that problem, but as I recall I fixed it shortly after.

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [August 23, 2019, 4:27pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/7 "2019-08-23T16:27:33Z")

</div>

I just tested it with the latest nightly version of Slicer, and it found the existing nodes with the same name.

---

<div class="post-metadata">

**Author:** ![burnhamd](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@burnhamd](https://discourse.slicer.org/u/burnhamd)\
**Post date:** [August 23, 2019, 4:56pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/8 "2019-08-23T16:56:39Z")

</div>

Found the issue.

I was using a TransformNode.  
Once I used the LinearTransformNode, it works as expected.

---

<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:** [August 23, 2019, 5:00pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/9 "2019-08-23T17:00:34Z")

</div>

@Sunderlandkyl could you update OpenIGTLinkIF so that it can update vtkMRMLTransformNode types as well?

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [August 23, 2019, 6:16pm UTC](https://discourse.slicer.org/t/openigtlinkif-transform-references/8097/10 "2019-08-23T18:16:44Z")

</div>

Integrated in [36041a4](https://github.com/openigtlink/SlicerOpenIGTLink/commit/36041a4d6a7a247fc8ed783485524e60bb340f0f).

It should be included in tomorrows nightly build.
