# Trajectory calculation for stereotaxic frames

**URL:** <https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963>\
**Category:** Support\
**Created:** [October 9, 2020, 8:18pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963 "2020-10-09T20:18:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaston](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gaston/32/8401_2.png) [@Gaston](https://discourse.slicer.org/u/Gaston)\
**Post date:** [October 9, 2020, 8:18pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/1 "2020-10-09T20:18:29Z")

</div>

Good morning, Maybe you can help me. I am looking for an extension or a method that allows to calculate coordinates and angle of a trajectory between an input point and a target point.  
To be able to be used in stereotactic frames.

---

<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:** [October 10, 2020, 12:19am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/2 "2020-10-10T00:19:37Z")

</div>

Angle computation from point coordinates is fairly straightforward. How far did you get and what step you are stuck at?

What is your workflow? How do you register your stereotactic frame coordinate system to your image coordinate system?

---

<div class="post-metadata">

**Author:** ![Gaston](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gaston/32/8401_2.png) [@Gaston](https://discourse.slicer.org/u/Gaston)\
**Post date:** [October 12, 2020, 2:35pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/3 "2020-10-12T14:35:48Z")

</div>

Dear Andras, the stereotactic frame, is brand crw. Regarding where I got stuck, it is at the beginning. I would like to know if there is an easy procedure to do this in slicer. Thanks

---

<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:** [October 12, 2020, 2:52pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/4 "2020-10-12T14:52:03Z")

</div>

Whatever you want to do should be easily doable, as Slicer has a wide range of calibration, registration, planning, and visualization tools for stereotactic surgery. If you can describe what your intended workflow then we can tell how to implement it in Slicer. For example, what imaging do you do, how do you identify target position, do you use a localizer frame to determine the head ring position or identify landmarks on the ring, do you have a computational model of the stereotactic system (position of rotation and translation axes, relative to landmarks or localizer frame, or this model is yet to be built), …?

---

<div class="post-metadata">

**Author:** ![Gaston](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gaston/32/8401_2.png) [@Gaston](https://discourse.slicer.org/u/Gaston)\
**Post date:** [October 13, 2020, 7:29pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/5 "2020-10-13T19:29:32Z")

</div>

Hello Andras, thank you very much for answering.  
The images we use are MRI and CT  
We use a frame of reference during imaging procedures.  
Then with the frame references we calculate the center, and then we calculate the coordinates of the target with respect to the center.  
I do not currently have a computational model of the stereotaxic system.

---

<div class="post-metadata">

**Author:** ![JBeninca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jbeninca/32/10039_2.png) [@JBeninca](https://discourse.slicer.org/u/JBeninca)\
**Post date:** [April 8, 2021, 10:34am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/6 "2021-04-08T10:34:59Z")

</div>

Hello. I ´ve been working for a while in a project like you describe.  
it´s applied to a Micromar Stereotactic device,which has its fiducials in 90o angles.  
It has 2 versions: one with just the fiducial calculus for registration and a second one with some graphic functions, objects, that show where de the arc an biopsy needle are in the brain.  
it was published in a medical journal.: [Revista NeuroTarget | Vanguardia en Neurociencia](http://neurotarget.com/numero.php?idn=30)

in page 37.-  
Please tell me if its the kind of software you are looking for.- Thanks

---

<div class="post-metadata">

**Author:** ![JBeninca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jbeninca/32/10039_2.png) [@JBeninca](https://discourse.slicer.org/u/JBeninca)\
**Post date:** [April 10, 2021, 3:49pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/7 "2021-04-10T15:49:55Z")

</div>

![Figura_3](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/2/c235dbfc74412908b54f5a31618f0f98f740a5cd.jpeg)

---

<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:** [April 14, 2021, 3:07pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/8 "2021-04-14T15:07:08Z")

</div>

This looks nice, thanks for sharing. Is it open-source? If yes, the you could consider submitting to the extensions index so that users can find it more easily.

---

<div class="post-metadata">

**Author:** ![JBeninca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jbeninca/32/10039_2.png) [@JBeninca](https://discourse.slicer.org/u/JBeninca)\
**Post date:** [April 15, 2021, 10:04am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/9 "2021-04-15T10:04:33Z")

</div>

hello. Yes, it´s open source.  
it is a scripted widget.- I don t know if it has to be written in C or something like that.  
I ask you for some advice on how to publish it.

---

<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:** [April 15, 2021, 11:20am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/10 "2021-04-15T11:20:37Z")

</div>

> [@JBeninca](#):
>
> I ask you for some advice on how to publish it.

Scripted is fine for an extension. The steps linked below describe how to make a formal extension. There are several steps involved and there’s a general expectation you’ll be available to answer questions and do some maintenance from time to time (e.g. if Slicer core changes). If you don’t want to sign up for that you can just make your code available online, perhaps in github, and post a link here so it can be an example for future developers.

[https://slicer.readthedocs.io/en/latest/developer\_guide/extensions.html](https://slicer.readthedocs.io/en/latest/developer_guide/extensions.html)

---

<div class="post-metadata">

**Author:** ![JBeninca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jbeninca/32/10039_2.png) [@JBeninca](https://discourse.slicer.org/u/JBeninca)\
**Post date:** [May 20, 2021, 8:55pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/11 "2021-05-20T20:55:46Z")

</div>

Hi, we´had developed a module that calculates the target and path of stereotatic frames.  
you can get it here:

> **[JBeninca/SlicerStereotaxia](https://github.com/JBeninca/SlicerStereotaxia)**
>
> Slicer stereotatic frame 3D coordinates calculus.-

in fact, there are 2 modules, one with graphics and the other without.  
in our hospital we use it with a Micromar frame, that has the fiducials with 90° degrees., but you can adapt 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:** [May 21, 2021, 4:14am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/12 "2021-05-21T04:14:07Z")

</div>

Very nice! Would you could consider submitting this to the extensions index so that users can more easily find and install it?

---

<div class="post-metadata">

**Author:** ![Glenn](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@Glenn](https://discourse.slicer.org/u/Glenn)\
**Post date:** [September 29, 2021, 9:01am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/13 "2021-09-29T09:01:40Z")

</div>

> [@JBeninca](#):
>
> JBeninca/SlicerStereotaxia

Hello, I am particularly interested in your extension, but I can’t install it. Can you give me some guidance?thanks。

---

<div class="post-metadata">

**Author:** ![JBeninca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jbeninca/32/10039_2.png) [@JBeninca](https://discourse.slicer.org/u/JBeninca)\
**Post date:** [September 29, 2021, 6:27pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/14 "2021-09-29T18:27:00Z")

</div>

Let me see. I need 2-3 days. Thanks

---

<div class="post-metadata">

**Author:** ![Glenn](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@Glenn](https://discourse.slicer.org/u/Glenn)\
**Post date:** [September 30, 2021, 3:39am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/15 "2021-09-30T03:39:11Z")

</div>

ok，I am looking forward to your guidance,

thank you fou your reply.! 😀

---

<div class="post-metadata">

**Author:** ![JBeninca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jbeninca/32/10039_2.png) [@JBeninca](https://discourse.slicer.org/u/JBeninca)\
**Post date:** [October 7, 2021, 11:48am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/16 "2021-10-07T11:48:16Z")

</div>

hi, sorry for delay.-

to get the modules working you must:

1- download zip from [GitHub - JBeninca/SlicerStereotaxia: Slicer stereotatic frame 3D coordinates calculus.-](https://github.com/JBeninca/SlicerStereotaxia)

2 - unzip and move to: /where\_you\_want\_directory

3 - open 3DSlicer

4 - Edit-\> Applications settings → Modules → additional module path → Add

5 - select: /where\_you\_want\_directory

6 - restart 3DSlicer

7 - you will find the 2 new modules in “Stereotaxia”

there is a paciente.nrrd file for example.

have luck.-

thanks . Jorge.-

---

<div class="post-metadata">

**Author:** ![JBeninca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jbeninca/32/10039_2.png) [@JBeninca](https://discourse.slicer.org/u/JBeninca)\
**Post date:** [October 7, 2021, 11:49am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/17 "2021-10-07T11:49:44Z")

</div>

I´m actually using 3DSlicer version 4.11.20210226

---

<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:** [October 7, 2021, 12:45pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/18 "2021-10-07T12:45:12Z")

</div>

Actually it also works well in Slicer 4.13.

However，I don’t know how to use it，could you help provide more tutorial or a video?

---

<div class="post-metadata">

**Author:** ![Xestance](https://avatars.discourse-cdn.com/v4/letter/x/e480ec/32.png) [@Xestance](https://discourse.slicer.org/u/Xestance)\
**Post date:** [January 1, 2022, 7:49am UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/19 "2022-01-01T07:49:10Z")

</div>

Dear All  
Greetings. I am a new member of the 3d slicer community and i wish to ask can i use 3d slicer solely for stereotactic procedures starting from image fusion between more than 2 images and target localization up to fiducial marking for entry and target.  
I am using both crw and brw frames

Thanks alot. Yours

---

<div class="post-metadata">

**Author:** ![Greydon\_Gilmore](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/greydon_gilmore/32/6863_2.png) [@Greydon\_Gilmore](https://discourse.slicer.org/u/Greydon_Gilmore)\
**Post date:** [January 1, 2022, 8:39pm UTC](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963/20 "2022-01-01T20:39:05Z")

</div>

@Xestance @Gaston @slicer365 @Glenn

I have been developing an extension for stereotactic planning that supports Leksell, BRW, and CRW frames. This extension allows pre-op planning (with coordinates in ACPC and frame space), visualization of intraop MER, post-op electrode localization, and VTA modelling.

The documentation site (WIP): [trajectoryguide.greydongilmore.com/](http://trajectoryguide.greydongilmore.com/)

Let me know if you’d be interested in trying it out.

Greydon

[Next page](https://discourse.slicer.org/t/trajectory-calculation-for-stereotaxic-frames/13963.md?page=2)
