Closed LuisOlivaresJ closed 9 months ago
I am running OMG-D in Spyder (distributed with Anaconda). I don't know if it's related, but I need to change the preferences for graphics backend to Automatic instead of the default (inline).
Thanks Jean, it works. In the corresponding documentation I'll add that spyder is another requirement. I just wanted to run the script in Visual Studio Code, or Anaconda PowerShell.
Great, I'm glad you got it working! I always used OMG in Spyder, but it would be nice if we could get it to work in other IDEs too.
The problem seems to be the use of plt.show() in non-interactive mode before all plots are done.
The first call to show a Figure starts on line L351 (from imageRGB.py), when we want to show the gafchromic image:
Seems that once the figure is displayed, it stops acepting new plots or draws. We can see that behaviour after line L615, because the next plots methods (L616 self.plot_profile
,L617 self.plot_calibration_curves
, ....) do not work (the gafchromic films is the only image showed in the pdf report).
https://github.com/jfcabana/omg_dosimetry/blob/f6bfc948960f5a59be8138fe8b45b24970cf4226/src/omg_dosimetry/calibration.py#L603-L619
As an attempt to solve that, I added a plt.ion
just after the creation of the Figure object: https://github.com/jfcabana/omg_dosimetry/blob/f6bfc948960f5a59be8138fe8b45b24970cf4226/src/omg_dosimetry/calibration.py#L603-L607
When I run omg_calibration_demo.py file in Visual Studio Code, the pdf report is correctly generated! :smiley:
I have the modification on Branch plt_ion, but before a Pull Request, I am also considering to change the default parameter show
to False, in the plot method of BaseImage class:
In the next days I am going to analyze what could be the implication of that approach, particularly if the user choose a manual ROI selection.
Looks promising! I always wanted to make the software flexible and not dependant on a specific IDE. There will probably be other issues along the way, notably with the analysis module that relies heavily on interactive plots. Thanks for working on this :)
Fixed in #16, If it is ok, I will close this issue.
The steps I followed to install OMG_D were:
These are the output figures and pdf, after I run the file. I am going to try figure out the problem.