lancelevine / SlicerDRRGenerator

A 3D Slicer extension that generates Digitally Reconstructed Radiographs
12 stars 5 forks source link

How can I call the module functions from another module? #4

Open rafamoreta opened 3 years ago

rafamoreta commented 3 years ago

Hello, Thank you for developing this handy 3D Slicer module and make it public. I am developing a 3D slicer module using Python, and I would like to call your GenerateDRR function from my code. However, I have tried accessing the GenerateDRR function of your widget by using the following code in the Slicer Python Console: “slicer.modules.drrgeneratormodule.widgetRepresentation()”. I can only see the functions “setRotation,” “setTranslation”, etc. Still, I cannot access the functions “GenrateDRR” or “SetInputVolume.” Even if I set a value to the function “setRotationX” (for example), the module UI boxes do not change their value. Is there a way to generate the DRR image by calling your module functions from my module? I know it is possible to access functions and variables from modules developed in C++ using Python, but I do not know how to do it with yours. Thank you very much in advance.

lancelevine commented 3 years ago

I'll attempt to do so and let you know if I can. If not you might have to ask on the slicer discourse forum.