AttributeError: 'DicomImage' object has no attribute 'copy'.

60 views
Skip to first unread message

Douillard Simon

unread,
Apr 23, 2024, 5:21:57 AMApr 23
to QATrack+

Hi, 

 

I have a problem when I want to use the .analyze() function, or .results_data() on a .dcm object.  When I run the test it fails and returns the following error :

 

AttributeError: 'DicomImage' object has no attribute 'copy'.

for lines 159, 779 and 845 of planar_imaging.py in qatrack31/lib/python3.8/site-packages/pylinac/. 

 

I also tested with the demo given on pylinac but I got the same error.

I've attached the two examples of LeedsTOR ghosts I'm using.

Here is the code I use :

 

import io

import pylinac

from pylinac import LeedsTOR

 

# import pydicom

 

# leeds = pylinac.LeedsTOR.from_demo_image()

# image = pydicom.dcmread(BIN_FILE, force=True)

leeds = pylinac.LeedsTOR(BIN_FILE.path)

leeds.analyze()

data = leeds.results_data()

leeds_upload_analysis = {

    "low_contrast_rois": data.num_contrast_rois_seen,

    "median_cnr": data.median_cnr,

    "median_contrast": data.median_contrast,

}

data = io.BytesIO()

leeds.publish_pdf(data)

UTILS.write_file("leeds.pdf", data)

 

Best regards.

 

Simon Douillard

leeds.dcm
kV leeds sample.dcm

tbe...@gmail.com

unread,
Apr 23, 2024, 8:58:21 AMApr 23
to QATrack+
Hi Simon,

on my system (using spyder with latest pylinac version on python 3.10) I have no problems analyzing your images.
Which pylinac version do you use? Line 159 in planar_imaging.py is a blank line in pylinac 3.22.0.

regards
Thomas

Douillard Simon

unread,
Apr 24, 2024, 4:16:33 AMApr 24
to QATrack+
I use Python 3.8 and pylinac-qatrackplus 2.5.1.3. on Ubuntu 20.04. 

James Kerns

unread,
Apr 24, 2024, 12:00:29 PMApr 24
to QATrack+
pylinac 2.5 is no longer supported and does not contain that behavior. I suggest uninstalling pylinac-qatrackplus and installing a recent version of pylinac: https://pylinac.readthedocs.io/en/latest/installation.html
Reply all
Reply to author
Forward
0 new messages