I have a quick question. I would like to verify the position of my MLCs to comply with French regulations. I’m wondering if it’s possible to use an image with only one pair of leaves (a single picket) for this purpose. I didn’t find any examples in the documentation, and when I attempted it, I encountered the following error:
PS C:\Users\ben-abdellah-aghzout\Code> python -u “c:\Users\ben-abdellah-aghzout\Code\positionnementMLC\positionnementMLC2.py”
C:\Users\ben-abdellah-aghzout\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core\fromnumeric.py:3464: RuntimeWarning: Mean of empty slice.
return _methods._mean(a, axis=axis, dtype=dtype,
C:\Users\ben-abdellah-aghzout\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\core_methods.py:192: RuntimeWarning: invalid value encountered in scalar divide
ret = ret.dtype.type(ret / rcount)
Traceback (most recent call last):
File “c:\Users\ben-abdellah-aghzout\Code\positionnementMLC\positionnementMLC2.py”, line 17, in
pf.analyze(separate_leaves=True,nominal_gap_mm=gap)
File “C:\Users\ben-abdellah-aghzout\AppData\Local\Programs\Python\Python38\lib\site-packages\pylinac\picketfence.py”, line 705, in analyze
window = self._get_mlc_window(
File “C:\Users\ben-abdellah-aghzout\AppData\Local\Programs\Python\Python38\lib\site-packages\pylinac\picketfence.py”, line 801, in _get_mlc_window
left_edge = max(int(approx_idx - spacing / 2), 0)
ValueError: cannot convert float NaN to integer
Is it possible to perfom an analysis on a single picket ?
normally pylinac needs more than one picket to analyze the picket fence test, since the distance between the pickets is one of the analyzed parameters. In the analyze method there is a part were pylinac tries to determine the distance between the pickets and use this info to find the position of each “kiss”
you could try to give the picket_spacing parameter when doing the analyze and see what happens then.
Note: picket_spacing - If None (default), the spacing between pickets is determined automatically. If given, it should be an int or float specifying the number of PIXELS apart the pickets are.