from pylinac.cheese import CIRS062M
data_folder = r"D:/CIRS062M"
CIRS062M = CIRS062M(data_folder)
CIRS062M.analyze()
# print text to the console
print(CIRS062M.results())
# return a dictionary or dataclass
results = CIRS062M.results_data()
# view analyzed image summary
CIRS062M.plot_analyzed_image()
# save the images
CIRS062M.save_analyzed_image()
# finally, save a PDF
CIRS062M.publish_pdf()
>>> %Run CIRS062M.py
C:\Users\chewlipteck\env\lib\site-packages\numpy\core\fromnumeric.py:3432: RuntimeWarning: Mean of empty slice.
return _methods._mean(a, axis=axis, dtype=dtype,
C:\Users\chewlipteck\env\lib\site-packages\numpy\core\_methods.py:190: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
Traceback (most recent call last):
File "C:\Users\chewlipteck\Documents\Work\Computing\Python\Python Scripts\pylinac\python\CIRS062M.py", line 4, in <module>
CIRS062M.analyze()
File "C:\Users\chewlipteck\env\lib\site-packages\pylinac\cheese.py", line 229, in analyze
self.localize()
File "C:\Users\chewlipteck\env\lib\site-packages\pylinac\ct.py", line 1769, in localize
self._phantom_center_func = self.find_phantom_axis()
File "C:\Users\chewlipteck\env\lib\site-packages\pylinac\ct.py", line 1843, in find_phantom_axis
fit_zx = np.poly1d(np.polyfit(zs[common_idxs], center_xs[common_idxs], deg=1))
File "<__array_function__ internals>", line 180, in polyfit
File "C:\Users\chewlipteck\env\lib\site-packages\numpy\lib\polynomial.py", line 638, in polyfit
raise TypeError("expected non-empty vector for x")
TypeError: expected non-empty vector for x