# Reading a Linear Transform using scripting while openigtl server keeps sending transform messages

**URL:** <https://discourse.slicer.org/t/reading-a-linear-transform-using-scripting-while-openigtl-server-keeps-sending-transform-messages/21879>\
**Category:** Support\
**Created:** [February 9, 2022, 8:19pm UTC](https://discourse.slicer.org/t/reading-a-linear-transform-using-scripting-while-openigtl-server-keeps-sending-transform-messages/21879 "2022-02-09T20:19:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![srivastavava](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@srivastavava](https://discourse.slicer.org/u/srivastavava)\
**Post date:** [February 9, 2022, 8:19pm UTC](https://discourse.slicer.org/t/reading-a-linear-transform-using-scripting-while-openigtl-server-keeps-sending-transform-messages/21879/1 "2022-02-09T20:19:35Z")

</div>

Hi,  
I have a linear transform that I receive from a OpenIGTL Server. I am using the openigtlinkIF module to receive this transform in 3d slicer. I want to read the transform message and place a fiducial by extracting the RAS coordinates from the linear message. Can someone please help me with the script to perform the reading of the transform and placement of the fiducial while I’m receiving the transforms in realt time ?

---

<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:** [February 9, 2022, 11:01pm UTC](https://discourse.slicer.org/t/reading-a-linear-transform-using-scripting-while-openigtl-server-keeps-sending-transform-messages/21879/2 "2022-02-09T23:01:19Z")

</div>

This feature is already implemented in several modules. For example:

- there is a C++ module in SlicerIGT extension - `Collect Points` - that does exactly what you describe: record transforms into fiducials
- if you want to reconstruct catheter paths from tracking sensors then you can use [PathReconstruction extension](https://github.com/SlicerIGT/SlicerPathReconstruction)
- if you want to record and analyze hand and tool motion, you can use [Perk Tutor extension](http://perktutor.org/)
- if you just need a simple example of how to collect points and display the results in real-time then you can have a look at [TrackingErrorMapping module](https://github.com/SlicerIGT/SlicerTrackingErrorInspector/blob/master/TrackingErrorMapping/TrackingErrorMapping.py) in TrackingErrorInspector extension

---

<div class="post-metadata">

**Author:** ![srivastavava](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@srivastavava](https://discourse.slicer.org/u/srivastavava)\
**Post date:** [February 11, 2022, 2:57pm UTC](https://discourse.slicer.org/t/reading-a-linear-transform-using-scripting-while-openigtl-server-keeps-sending-transform-messages/21879/3 "2022-02-11T14:57:06Z")

</div>

Thank you, Andras… to that… if I want to extend the functionality to view these markup fiducials in slice views in real time, how should I go about it ?

---

<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:** [February 11, 2022, 3:31pm UTC](https://discourse.slicer.org/t/reading-a-linear-transform-using-scripting-while-openigtl-server-keeps-sending-transform-messages/21879/4 "2022-02-11T15:31:00Z")

</div>

As you can see from these many examples, everything is very flexible, customizable, extensible. What functionality would you like to add?
