Simplify and copy transforms?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Simplify and copy transforms?

banderie@asu.edu
Hello all,

I am trying to write a scripted extension that allows me to place VTK objects in the 3D view at the tip of a stylus (which is tracked by an NDI Polaris Vicra and visualized in 3D). I was initially pointed to the Endoscopy.py file as an example, which has been very helpful.  I can now create VTK objects in the 3D view, but am stuck on applying the transform. I would like the object created to stay (with respect to RAS) where it is placed and NOT continue to follow the tracked probe. Therefore, simply setting the parent transform to that of the probe will not work. Is there a way to make a static copy of a transform so that the object created is placed at the tip of the tool but remains fixed to RAS? Also, is there a way to consolidate a long hierarchy of transforms into one? For example, when I register my phantom object, I have the following hierarchy: StylusTipToStylus (from the pivot calibration) --> StylusToReference (from the Polaris Vicra) --> ReferenceToInitial (initial landmark registration) --> InitialToRas (surface registration). Can I get a single, static transformation equivalent to this hierarchy (i.e. StylusTipToRas), that I can then as the parent transform for my new object? I am still a little confused about how the transform system works. Is there any good documentation where I can learn more about the transform conventions? I have read the explanations in the SlicerIGT registration tutorials, which were quite helpful from a theoretical standpoint, but I would like to get a better understanding of the ToParent/FromParent distinctions in the actual code.

Any assistance is greatly appreciated. Thanks and best regards,

Barrett

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Simplify and copy transforms?

Dzenan Zukic
Hi Barret,

you should be able to get a vtkMatrix4x4 (perhaps this method?), then create a new transform node, set this matrix to it, add it to the scene and make your object observe it.

Regards

Dženan Zukić, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.)

On Thu, Apr 6, 2017 at 3:07 AM, [hidden email] <[hidden email]> wrote:
Hello all,

I am trying to write a scripted extension that allows me to place VTK objects in the 3D view at the tip of a stylus (which is tracked by an NDI Polaris Vicra and visualized in 3D). I was initially pointed to the Endoscopy.py file as an example, which has been very helpful.  I can now create VTK objects in the 3D view, but am stuck on applying the transform. I would like the object created to stay (with respect to RAS) where it is placed and NOT continue to follow the tracked probe. Therefore, simply setting the parent transform to that of the probe will not work. Is there a way to make a static copy of a transform so that the object created is placed at the tip of the tool but remains fixed to RAS? Also, is there a way to consolidate a long hierarchy of transforms into one? For example, when I register my phantom object, I have the following hierarchy: StylusTipToStylus (from the pivot calibration) --> StylusToReference (from the Polaris Vicra) --> ReferenceToInitial (initial landmark registration) --> InitialToRas (surface registration). Can I get a single, static transformation equivalent to this hierarchy (i.e. StylusTipToRas), that I can then as the parent transform for my new object? I am still a little confused about how the transform system works. Is there any good documentation where I can learn more about the transform conventions? I have read the explanations in the SlicerIGT registration tutorials, which were quite helpful from a theoretical standpoint, but I would like to get a better understanding of the ToParent/FromParent distinctions in the actual code.

Any assistance is greatly appreciated. Thanks and best regards,

Barrett

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Simplify and copy transforms?

banderie@asu.edu
In reply to this post by banderie@asu.edu
That worked perfectly, thanks!

Barrett

--
Barrett Anderies
B.S.E. Biomedical Engineering | B.S. Mathematics
Barrett, the Honors College | Arizona State University
Phone: 480-721-9370
           [hidden email]

On Thu, Apr 6, 2017 at 6:18 AM, Dzenan Zukic <[hidden email]> wrote:
Hi Barret,

you should be able to get a vtkMatrix4x4 (perhaps this method?), then create a new transform node, set this matrix to it, add it to the scene and make your object observe it.

Regards

Dženan Zukić, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.)

On Thu, Apr 6, 2017 at 3:07 AM, [hidden email] <[hidden email]> wrote:
Hello all,

I am trying to write a scripted extension that allows me to place VTK objects in the 3D view at the tip of a stylus (which is tracked by an NDI Polaris Vicra and visualized in 3D). I was initially pointed to the Endoscopy.py file as an example, which has been very helpful.  I can now create VTK objects in the 3D view, but am stuck on applying the transform. I would like the object created to stay (with respect to RAS) where it is placed and NOT continue to follow the tracked probe. Therefore, simply setting the parent transform to that of the probe will not work. Is there a way to make a static copy of a transform so that the object created is placed at the tip of the tool but remains fixed to RAS? Also, is there a way to consolidate a long hierarchy of transforms into one? For example, when I register my phantom object, I have the following hierarchy: StylusTipToStylus (from the pivot calibration) --> StylusToReference (from the Polaris Vicra) --> ReferenceToInitial (initial landmark registration) --> InitialToRas (surface registration). Can I get a single, static transformation equivalent to this hierarchy (i.e. StylusTipToRas), that I can then as the parent transform for my new object? I am still a little confused about how the transform system works. Is there any good documentation where I can learn more about the transform conventions? I have read the explanations in the SlicerIGT registration tutorials, which were quite helpful from a theoretical standpoint, but I would like to get a better understanding of the ToParent/FromParent distinctions in the actual code.

Any assistance is greatly appreciated. Thanks and best regards,

Barrett

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ



_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ