'DeviceFieldAnalysis' object has no attribute 'image'


I am trying to run the demo file for DeviceFieldAnalysis and and receive this error on run:

Traceback (most recent call last):
File “filepath”, line 214, in
File " filepath “, line 183, in AnalyzeFA
fa.publish_pdf(filename = filepath\PDF_Output\fatest1.pdf”)
File " filepath \pylinac\pylinac\field_analysis.py", line 681, in publish_pdf
self._save_plot(self._plot_image, stream, title=“image”)
File " filepath \pylinac\pylinac\field_analysis.py", line 906, in _save_plot
File " filepath \pylinac\pylinac\field_analysis.py", line 811, in _plot_image
axis.imshow(self.image.array, cmap=get_dicom_cmap())
AttributeError: ‘DeviceFieldAnalysis’ object has no attribute ‘image’

And here is the code I run to get the error:

fa = DeviceFieldAnalysis.from_demo_image()
fa.analyze(protocol=Protocol.VARIAN, is_FFF=True)
fa.publish_pdf(filename = “filepath\PDF_Output\fatest1.pdf”)

Am hoping that someone may have ideas. Looking into it, the plots do get created and I am able to save them separately, just not using publish_pdf.

Thank you,

Hi Joseph,

I can confirm the problem. I use pylinac 3.1.0 on python 3.8.7.
I think you found a bug. Bugreports can be submitted here: https://github.com/jrkerns/pylinac/issues


Thanks for reporting. As you can imagine, there is no actual image for a device measurement. Will probably have to just omit the image panel.