Generating DRRs using the DRRGeneratorModule in a Python Script

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

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

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:

slicer.util.getModuleLogic("DRRGeneratorModule")

Here is a good place to get started with accessing module logic methods: Python FAQ — 3D Slicer documentation