# How to get the Needle model tip position in the World coordinate？

**URL:** <https://discourse.slicer.org/t/how-to-get-the-needle-model-tip-position-in-the-world-coordinate/16156>\
**Category:** Support\
**Tags:** python\
**Created:** [February 23, 2021, 9:52am UTC](https://discourse.slicer.org/t/how-to-get-the-needle-model-tip-position-in-the-world-coordinate/16156 "2021-02-23T09:52:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenyx](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@chenyx](https://discourse.slicer.org/u/chenyx)\
**Post date:** [February 23, 2021, 9:52am UTC](https://discourse.slicer.org/t/how-to-get-the-needle-model-tip-position-in-the-world-coordinate/16156/1 "2021-02-23T09:52:34Z")

</div>

Dear friends， i wanna get the position of the needle model which created by the module “IGT/CreateModels”

---

<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 23, 2021, 12:58pm UTC](https://discourse.slicer.org/t/how-to-get-the-needle-model-tip-position-in-the-world-coordinate/16156/2 "2021-02-23T12:58:46Z")

</div>

Coordinate of the needle tip is (0,0,0). See complete definition of the StylusTip coordinate system [here](http://perk-software.cs.queensu.ca/plus/doc/nightly/user/CommonCoordinateSystems.html).

---

<div class="post-metadata">

**Author:** ![chenyx](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@chenyx](https://discourse.slicer.org/u/chenyx)\
**Post date:** [February 23, 2021, 2:32pm UTC](https://discourse.slicer.org/t/how-to-get-the-needle-model-tip-position-in-the-world-coordinate/16156/3 "2021-02-23T14:32:52Z")

</div>

Thx, but i insert transform with the stylus model, so the modified position follow the changable transform. i wanna get the current position.  
Can you share me some method to get the stylus tip position？

---

<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 23, 2021, 2:36pm UTC](https://discourse.slicer.org/t/how-to-get-the-needle-model-tip-position-in-the-world-coordinate/16156/4 "2021-02-23T14:36:33Z")

</div>

Current position of the needle tip is the translation part (4th column) of the the matrix you get from [GetMatrixTransformToWorld()](http://apidocs.slicer.org/master/classvtkMRMLTransformNode.html#a5d2d93382aa7da7ec3d9a27987305bce) (called on the parent transform).

---

<div class="post-metadata">

**Author:** ![chenyx](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@chenyx](https://discourse.slicer.org/u/chenyx)\
**Post date:** [February 23, 2021, 2:40pm UTC](https://discourse.slicer.org/t/how-to-get-the-needle-model-tip-position-in-the-world-coordinate/16156/5 "2021-02-23T14:40:14Z")

</div>

Thank you very much.
