# SlicerRT access from other module

**URL:** <https://discourse.slicer.org/t/slicerrt-access-from-other-module/29845>\
**Category:** Development\
**Created:** [June 5, 2023, 1:28pm UTC](https://discourse.slicer.org/t/slicerrt-access-from-other-module/29845 "2023-06-05T13:28:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankkkss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/frankkkss/32/66280_2.png) [@frankkkss](https://discourse.slicer.org/u/frankkkss)\
**Post date:** [June 5, 2023, 1:28pm UTC](https://discourse.slicer.org/t/slicerrt-access-from-other-module/29845/1 "2023-06-05T13:28:35Z")

</div>

Hello

I am trying to create a module in 3D Slicer that needs access to the SlicerRT module to use the DoseVolumeHistogram functions, but I cannot do it. I think I would just need to enter the segmentation and dose volume from code. How is it done? I haven’t found documentation for that module.

---

<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:** [June 6, 2023, 11:46am UTC](https://discourse.slicer.org/t/slicerrt-access-from-other-module/29845/2 "2023-06-06T11:46:44Z")

</div>

This is too little information to be able to say anything useful.

What programming language do you use? What functions of SlicerRT do you want to access and exactly how? Also please add any other information about the structure/deployment of your module that could be useful. Thanks

---

<div class="post-metadata">

**Author:** ![frankkkss](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/frankkkss/32/66280_2.png) [@frankkkss](https://discourse.slicer.org/u/frankkkss)\
**Post date:** [June 6, 2023, 12:39pm UTC](https://discourse.slicer.org/t/slicerrt-access-from-other-module/29845/3 "2023-06-06T12:39:24Z")

</div>

In a Python code I am opening a .txt file with transforms that are applied to already loaded Nodes in the scene. Then, I need to compute the dose volume histogram from a segmentation and a RT dose volume that are in the scene. Then I would need to show the DVH but I believe that would easily be done by using the AddDvhToChart function. I have tried to use the ComputeDvh() function from SlicerRT but I don’t know how to state the inputs, as it says that only one input is needed.

Thank you

---

<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:** [June 6, 2023, 2:47pm UTC](https://discourse.slicer.org/t/slicerrt-access-from-other-module/29845/4 "2023-06-06T14:47:15Z")

</div>

You can use the widgets to set the inputs like it happens in the test script

> <https://github.com/SlicerRt/SlicerRT/blob/master/Testing/Python/IGRTWorkflow_SelfTest.py#L591>

Or you can set the input to the parameter node (which is a nicer solution because it does not go through the widget, but the logic).

> <https://github.com/SlicerRt/SlicerRT/blob/master/DoseVolumeHistogram/MRML/vtkMRMLDoseVolumeHistogramNode.h#L100>
