Hi Folks,
I’m trying to create a custom ED phantom analysis script for the Gammex Model 467 CT to ED phantom using the Cheese module.
I’m getting errors when I try to create a very simple custom test routine with 5 ROI’s running the attached python script (using the Pylinac documentation guide):
When .analyze() is called, its giving errors:
Traceback (most recent call last):
File “U:\Python Scripts\Pylinac\CTtoED\new_phantom_config.py”, line 59, in
swiss.analyze()
File “C:\Users\johnccronin\Anaconda3\lib\site-packages\pylinac\cheese.py”, line 211, in analyze
self.localize()
File “C:\Users\johnccronin\Anaconda3\lib\site-packages\pylinac\ct.py”, line 1699, in localize
self._phantom_center_func = self.find_phantom_axis()
File “C:\Users\johnccronin\Anaconda3\lib\site-packages\pylinac\ct.py”, line 1727, in find_phantom_axis
p30, p70 = np.percentile(center_x, [30, 70])
File “<array_function internals>”, line 5, in percentile
File “C:\Users\johnccronin\Anaconda3\lib\site-packages\numpy\lib\function_base.py”, line 3867, in percentile
return _quantile_unchecked(
File “C:\Users\johnccronin\Anaconda3\lib\site-packages\numpy\lib\function_base.py”, line 3986, in _quantile_unchecked
r, k = _ureduce(a, func=_quantile_ureduce_func, q=q, axis=axis, out=out,
File “C:\Users\johnccronin\Anaconda3\lib\site-packages\numpy\lib\function_base.py”, line 3564, in _ureduce
r = func(a, **kwargs)
File “C:\Users\johnccronin\Anaconda3\lib\site-packages\numpy\lib\function_base.py”, line 4098, in _quantile_ureduce_func
n = np.isnan(ap[-1])
IndexError: index -1 is out of bounds for axis 0 with size 0
This phantom has a 33 cm diameter so I suspect this has something to do with it having difficulty detecting the center of the phantom and trying to account for roll?
See attached phantom dimensions and also the CT images I’m trying to analyze.
Thanks,
John
gammex_phantom.zip (4.95 MB)
new_ed_phantom_pylinac.py (1.66 KB)