Problems with Dynalog

Hi all

I can run the dynalog demo with out problems. but when I try to analise a Trilogy Dynalog file captured in our hospital
with this simple script

import matplotlib as plt
plt.use(‘Qt5Agg’)
from pylinac import Dynalog
from pylinac import load_log

dlog_path = “/home/karl/Scrivania/A20180307125643_zzz_trilogy_QA_v3.dlg”
dlog = Dynalog(dlog_path)

dlog.fluence.actual.calc_map()
dlog.fluence.actual.plot_map()

I get this error

Traceback (most recent call last):
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py”, line 519, in _draw_idle
self.draw()
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py”, line 433, in draw
self.figure.draw(self.renderer)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/figure.py”, line 1475, in draw
renderer, self, artists, self.suppressComposite)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/image.py”, line 141, in _draw_list_compositing_images
a.draw(renderer)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py”, line 2607, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/image.py”, line 141, in _draw_list_compositing_images
a.draw(renderer)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/image.py”, line 593, in draw
renderer, renderer.get_image_magnification())
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/image.py”, line 841, in make_image
unsampled=unsampled)
File “/home/karl/anaconda3/lib/python3.5/site-packages/matplotlib/image.py”, line 438, in _make_image
self.get_filterrad() or 0.0)
ValueError: Unsupported dtype

Someone has an idea whot the trouble could be?
Thank you in advance
Karl

Have you tried using it without overriding the plotting backend? Does the demo work with Qt5Agg? Do all the logs give you this issue or is it just this one?

James

Hi James, thank you for your suggestion. Also without changing the backend, the same error occurs. Also If I change the Backend to (‘Qt5Agg’) this makes no difference for the Dynalog Demo: it works as before.
I do not have at the oment tried other logfiles. I founf however d Discussion on matplotlib: https://github.com/matplotlib/matplotlib/pull/10768 which seems to adress my problem. I Have however not enough experience to install the bugfix.

You could try installing the latest version of MPL. You could also send me the log and I’ll see if I can create a bugfix for pylinac.

Hi James.
I made some tests in the meantime. I normally work on linux but I verified that the same issue the issue came up also on windows as I had expected. I also tried another Dynalog file and got the same result. Besides Dynalog I tried also trajectorylog. In trajectorylog the Lineplots were fine, but with the fluence image the same the same error occured. The last line in the error traceback is always File
“/home/karl/anaconda3/lib/ python3.5/site-packages/matplotlib/image.py”, line 438, in _make_image

self.get_filterrad() or 0.0)
ValueError: Unsupported dtype

I dont know what MPL. is. If I try to instal it with conda or pip the answer is that MPL is unknown.

Sorry, MPL is shorthand for matplotlib, which is the library that’s generating the error.

HI James, my dynalog problem seems to be identical with that of “By Rebo”. as I mentioned already, the issue of “unsupported dtype” has been addressed and solved in matplotlib issue #10768. I cloned matplotlib from github and verified that the fix seem to work in general. Pylinac does not work with this matplotlib version though and when I reinstall Pylinac, it deinstalles the matplotlib version with the bugfix and reinstalls the version which has the problem.

You can try installing pylinac without updating the dependencies:
pip install pylinac --no-deps
Just install the version of matplotlib you’d like first.

I can send you a random tlog James if you wish. As kvoyager said I have the same issue.