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