Picket Fence Elekta Agility

154 views
Skip to first unread message

Pedro Bertolli

unread,
Feb 26, 2024, 8:39:55 AMFeb 26
to QATrack+
Hello everyone, I'm trying to implement a Picket Fence analysis on QATrack+ but I'm having a problem to analyse the picket fence image from an Elekta Versa HD with Agility MLC.The code below works fine in my Pyhton IDE but when I try this on QATrack I get an error (TypeError: _init_() got an unexpected keyword argument 'crop_mm'). And when I remove the crop_mm argument the following error appears:  "Invalid Test Procedure: pf_upload_analysis.py", line 8, in Test: Picket Fence Upload File "/home/qatrack/venvs/qatrack31/lib/python3.8/site-packages/pylinac/picketfence.py", line 355, in analyze self.mlc_meas.append(MLCValue(picket_num=picket_num, approx_idx=picket_idx, leaf_width=width, File "/home/qatrack/venvs/qatrack31/lib/python3.8/site-packages/pylinac/picketfence.py", line 648, in __init__ self.position: float = self.get_peak_position() File "/home/qatrack/venvs/qatrack31/lib/python3.8/site-packages/pylinac/picketfence.py", line 664, in get_peak_position fw80mc, _ = prof.fwxm_center(80, interpolate=True) IndexError: index 0 is out of bounds for axis 0 with size 0 "


import io
import pylinac

# run the picket fence analysis using pylinac
# note the use of `BIN_FILE` rather than `FILE` since we are dealing with an image
pf = pylinac.PicketFence(BIN_FILE.path, crop_mm=11)
pf.analyze(invert=True)

# our dictionary of results to return
pf_upload_analysis = {
    "percent passing": pf.percent_passing,
    "max error": pf.max_error,
    "number of pickets": pf.num_pickets,
    "orientation": pf.orientation,
}

# create a pylinac PDF and create an attachment with it
data = io.BytesIO()
pf.publish_pdf(data)
UTILS.write_file("testingpfpdf.pdf", data)

# convert the image to a png file so it can be displayed when performing the test list
UTILS.write_file("pf-image.png", pf.image)

I appreciate any thoughts
Best regards

Pedro Bertolli

Pedro Argolo Piedade

unread,
Feb 26, 2024, 8:52:13 AMFeb 26
to Pedro Bertolli, QATrack+
Pedro I had this problemas and  James Kerns jker...@gmail.com

You should consider spacing out the "pickets" further apart. See point 2:  Picket Fence — pylinac 3.10.0 documentation
Have you tested the file on pylinac stand alone?

My best regards
Pedro P

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/629dde77-1f3b-44ad-b6f9-aa94a7c17dd5n%40googlegroups.com.


--
Pedro Argôlo Piedade
Físico Médico - Radioterapia São Sebastião
www.radioterapiass.com.br
+55-048-91672105
pedroar...@gmail.com
skype: pedroargolopie
whatsapp: +554891672105

tbe...@gmail.com

unread,
Feb 26, 2024, 9:01:28 AMFeb 26
to QATrack+
Hi Petro B,

the crop_mm option was introduced in pylinac 3.0. It seems you are still using the old pylinac version which was installed with QATrack+. Please consider updating pylinac to a newer version for the full functionality.

regards
Thomas

Pedro Bertolli

unread,
Feb 26, 2024, 12:36:06 PMFeb 26
to QATrack+
Yes, I tried on pylinac stand alone and it works, but it does not works on QATrack.

Pedro Argolo Piedade

unread,
Feb 26, 2024, 1:40:04 PMFeb 26
to Pedro Bertolli, QATrack+
You need to update on your venvs!
Activate your virtual environment. like this:
source ~/venvs/qatrack31/bin/activate
pip install --upgrade pip
pip install pylinac --upgrade
I think will work! 

 

Pedro Argolo Piedade

unread,
Feb 26, 2024, 1:58:55 PMFeb 26
to Pedro Bertolli, QATrack+
correcting the command:
pip install --upgrade pylinac-qatrackplus

in the base.txt uses pylinac-qatrackplus==2.5.1.3

Pedro Bertolli

unread,
Mar 4, 2024, 7:25:29 AMMar 4
to QATrack+
I upgraded the pylinac version and it worked.
Thank you so much for the help.

Reply all
Reply to author
Forward
0 new messages