# How to make RTBeamNode or VolumeNode sensitive to patient support rotation from UI?

**URL:** <https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410>\
**Category:** Development\
**Tags:** extensions-manager, slicerrt\
**Created:** [February 24, 2020, 5:47am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410 "2020-02-24T05:47:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [February 24, 2020, 5:47am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/1 "2020-02-24T05:47:19Z")

</div>

When i change patient support rotation angle in “Beams” module or “Room’s Eye View” it changes the position of patient support but CT volume node is still on the same place. How to make a volume node or rt beam sensitive to that rotation from UI not using “Transform” module?

That is required for correct MLC opening calculation and RTImage calculation.

Screen shot example: Patient Support is rotated, but CT series data are still on the same place.

 ![ScreenshotExample](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/0/d07847343e2f4ba4e96c7b3519b7ba124b440d2a.png)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 24, 2020, 9:18am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/2 "2020-02-24T09:18:34Z")

</div>

This is a known issue that patient support rotation does not affect moving the patient as it should. This is one of the many things that would need to be improved around beams and plans in SlicerRT. Treatment planning features are still quite rudimentary due to the lack of funds to continue development. We are in the process of writing a grant just for this, but that is a lengthy process, so if you prefer not to wait, then you may consider contributing.

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [February 24, 2020, 9:47am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/3 "2020-02-24T09:47:22Z")

</div>

There is no rush, but that’s a must have feature in my case. I’m ready to help in this issue.

I have tried myself but i haven’t found how to get a proper transformation node between Patient Support or Table Top to RAS in IECTransformLogic.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 24, 2020, 1:56pm UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/4 "2020-02-24T13:56:59Z")

</div>

You can get the transformation using

`vtkSlicerIECTransformLogic::GetTransformBetween(vtkSlicerIECTransformLogic::PatientSupport, vtkSlicerIECTransformLogic::RAS, outputTransform)`

It should also be possible to define the patient for the plan, and have the whole patient (CT, segmentation, fiducials, all of that) transformed accordingly when the patient support is moved. However, that is a larger task to do it properly, in a future-proof way.

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [March 1, 2020, 5:11pm UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/5 "2020-03-01T17:11:26Z")

</div>

I managed to solve this problem partially, at least now with rotation of patient support the patient CT and segmentation rotated as well.

Another issue is a camera control to fix slice views on table top position.

 ![Screenshot](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/4/f45733631bd8f859c7eb3ad65eac09028cacd599.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:** [March 1, 2020, 7:19pm UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/6 "2020-03-01T19:19:14Z")

</div>

You bcan use Volume Reslice Driver module (in SlicerIGT extension) to move slice views by transforms. You can combine transforms and as the transforms change, the slice views are updated in real-time.

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [March 2, 2020, 8:02am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/7 "2020-03-02T08:02:24Z")

</div>

Thank you for suggestion of using IGT extension.

As another approach it is possible to create a reverse transforms from IEC, e.g. everything (table support, gantry, etc) rotates and translates around still CT data?

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [March 2, 2020, 9:56am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/8 "2020-03-02T09:56:37Z")

</div>

> [@Mik](#):
>
> As another approach it is possible to create a reverse transforms from IEC, e.g. everything (table support, gantry, etc) rotates and translates around still CT data?

Yes, and actually this is what I imagine to be a proper fix for considering the patient support transform. What this would imply is that the reference in terms of IEC will be the patient support and not the world (FixedReference / RAS). However, this would take time to implement in a proper and maintainable manner, which requires funding (see my first comment).

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [March 2, 2020, 10:58am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/9 "2020-03-02T10:58:58Z")

</div>

> [@cpinter](#):
>
> However, this would take time to implement in a proper and maintainable manner

I understood that, and that is good to know that reverse transforms is a proper way.

---

<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:** [March 3, 2020, 2:53am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/10 "2020-03-03T02:53:46Z")

</div>

I don’t know if it helps, but you can compute inverse transform (and compute relative transform between any two coordinate systems) using “Transform processor” module in SlicerIGT extension. The computed transform is updated in real-time when any of the input transforms are changed.

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [March 8, 2020, 7:20am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/11 "2020-03-08T07:20:54Z")

</div>

I have made a dynamic IEC hierarchy matrix transformation calculation, and i can make a PR if this is interesting.

Transformation for Collimator to Patient looks like:

Collimator → Gantry → fixedReference → patientSupport → tableTopEccentric → tableTop → Patient (RAS)

1. Works with “Beams” and “External Beam Plan” modules
2. Doesn’t break compatibility with “Room’s Eye View” module

Gantry and patient support angles:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/5/05947e938543f2a3ef9688915923bb7140830a14.png)

RTBeamNode transformation:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/5/351d9079187bc92ef49f6367a9ed367fae9ae0b9.png)

Image example:

 ![Screenshot4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/a/3a4552f04014f722bc694e875f885ae9518d9ff7.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:** [March 9, 2020, 2:03am UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/12 "2020-03-09T02:03:39Z")

</div>

Looks very nice. Please submit a pull request so the implementation can be reviewed and integrated.

---

<div class="post-metadata">

**Author:** ![Mik](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mik](https://discourse.slicer.org/u/Mik)\
**Post date:** [March 9, 2020, 5:29pm UTC](https://discourse.slicer.org/t/how-to-make-rtbeamnode-or-volumenode-sensitive-to-patient-support-rotation-from-ui/10410/13 "2020-03-09T17:29:16Z")

</div>

Pull request that partially fix that issue: [https://github.com/SlicerRt/SlicerRT/pull/133](https://github.com/SlicerRt/SlicerRT/pull/133)
