CBCT Catphan analysis

Hi all,

I am trying to analyze images acquired with SFOV and LFOV CBCT for two Catphan phantoms (504 and 600). Unfortunately the script gives errors in both cases.

My script is pretty simple:

from pylinac import CatPhan600
import tkinter as tk
from tkinter import filedialog

root = tk.Tk()
root.lift()
root.focus_force()
root.wm_attributes(‘-topmost’,True)
root.after_idle(root.attributes,‘-topmost’,False)
root.withdraw()

# image selection

cbct_folder = filedialog.askdirectory()

mycbct = CatPhan600(cbct_folder)

mycbct.analyze()

# print results to the console
print(mycbct.results())
# view analyzed images
mycbct.plot_analyzed_image()
# save the image
mycbct.save_analyzed_image(‘mycatphan.png’)
# generate PDF
mycbct.publish_pdf(‘mycatphan.pdf’, open_file=True) # open the PDF after saving as well.

Below the errors, that are different in the case of the 504 and 600.

Catphan 504:

add = (f’MTF 50% (lp/mm): {self.ctp528.mtf.relative_resolution_at(50):2.2f}\n’)

AttributeError: ‘MTF’ object has no attribute ‘relative_resolution_at’

Catphan 600:

File “C:\ProgramData\Anaconda3\lib\site-packages\pylinac\ct.py”, line 1294, in results
add = (f’MTF 50% (lp/mm): {self.ctp528.mtf.relative_resolution_at(50):2.2f}\n’)

File “C:\ProgramData\Anaconda3\lib\site-packages\pylinac\ct.py”, line 637, in mtf
mtf = MTF(lp_spacings=spacings, lp_maximums=maxs, lp_minimums=mins)

File “C:\ProgramData\Anaconda3\lib\site-packages\pylinac\core\mtf.py”, line 38, in init
max_delta = np.max(np.diff(list(self.norm_mtfs.values())))

File “<array_function internals>”, line 6, in amax

File “C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py”, line 2734, in amax
keepdims=keepdims, initial=initial, where=where)

File “C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py”, line 87, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)

ValueError: zero-size array to reduction operation maximum which has no identity

If anyone wants to help me, I would be grateful :slight_smile:

Thanks in advance!

Andrea

Hi,

maybe it would help if you could share one of the CBCT datasets.

regards
Thomas