# Generating DRRs using the DRRGeneratorModule in a Python Script

**URL:** <https://discourse.slicer.org/t/generating-drrs-using-the-drrgeneratormodule-in-a-python-script/45003>\
**Category:** Support\
**Tags:** python\
**Created:** [November 8, 2025, 6:50am UTC](https://discourse.slicer.org/t/generating-drrs-using-the-drrgeneratormodule-in-a-python-script/45003 "2025-11-08T06:50:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmarcantoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fmarcantoni/32/81384_2.png) [@fmarcantoni](https://discourse.slicer.org/u/fmarcantoni)\
**Post date:** [November 8, 2025, 6:50am UTC](https://discourse.slicer.org/t/generating-drrs-using-the-drrgeneratormodule-in-a-python-script/45003/1 "2025-11-08T06:50:14Z")

</div>

Hello everyone,

I’m been using 3D slicer for a couple of weeks now, and I’ve been using the DRRGeneratorModule extension to create DRRs of a volume. Now, I’m trying to change the module parameters and run the generation through a python script rather than through the GUI, running this python script on my Linux terminal externally from 3D slicer. I cannot figure out how to modify the parameters or generate the DRRs. I can access the module logic as follows: slicer.modules.drrgeneratormodule.logic()

But I don’t know how to proceed after this. I also found this problem on Github which is the exact same issue not resolved: [Using the module in a python script · Issue #10 · lancelevine/SlicerDRRGenerator · GitHub](https://github.com/lancelevine/SlicerDRRGenerator/issues/10)

Please let me know if you know how I could go on with this, thank you.

---

<div class="post-metadata">

**Author:** ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Post date:** [November 9, 2025, 9:36pm UTC](https://discourse.slicer.org/t/generating-drrs-using-the-drrgeneratormodule-in-a-python-script/45003/2 "2025-11-09T21:36:45Z")

</div>

> [@fmarcantoni](#):
>
> slicer.modules.drrgeneratormodule.logic()

I am not certain but I suspect this might construct a new logic rather than grabbing the one that is associated with the module you’ve already loaded into Slicer. To grab the already existing logic:

```python
slicer.util.getModuleLogic("DRRGeneratorModule")

```

Here is a good place to get started with accessing module logic methods: [Python FAQ — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/python_faq.html#calling-methods-of-a-module-logic)
