Catphan600 Error

Hi All,

i think I have seen this error posted already but I couln’t see a solution. I can run Caphan503 module no problem on out Catphan503 image.

I’ve also got a Catphan600 image I’d like to analyze with Pylinac but I’m getting hits message:
Traceback (most recent call last):

File “C:\TEMP\CATPHAN600\”, line 18, in
results = mycbct.results_data()

File “C:\Users\johnccronin\Anaconda3\lib\site-packages\pylinac\”, line 1992, in results_data

File “C:\Users\johnccronin\Anaconda3\lib\site-packages\pylinac\”, line 1993, in
p: self.ctp528.mtf.relative_resolution(p) for p in (80, 50, 30)

File “C:\Users\johnccronin\Anaconda3\lib\site-packages\”, line 36, in get
value = obj.dict[] = self.func(obj)

File “C:\Users\johnccronin\Anaconda3\lib\site-packages\pylinac\”, line 1092, in mtf
mtf = MTF(lp_spacings=spacings, lp_maximums=maxs, lp_minimums=mins)

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

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

File “C:\Users\johnccronin\Anaconda3\lib\site-packages\numpy\core\”, line 2754, in amax
return _wrapreduction(a, np.maximum, ‘max’, axis, None, out,

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

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

Any ideas?



This could mean the MTF module is either not seen or potentially in an area near the end of the scan. E.g. with CBCT the ends of the scan can look weird as you reach the end of the “cone” of the FOV. However, this appears to be related to the MTF module which should be in view. How are you lining up the phantom?

Hi James,

Thanks for taking a look. This is an analysis on a scan taken by a CT. I’ve tried 3/2/1mm slice thickness recons and also tried FOV’s of 220, 300, 500 mm but I’m still getting the same error. I can send you on the dataset if you like. Pylinac worked perfect on the Catphan503 we have.



Thanks, I think that should be on its way to you now…

Can you share your code? I’ve used pylinac 3.7, 3.8 and 3.9 and they all analyze the dataset correctly.

Hi James,

I’m running 3.9.13 and my code is:

from pylinac.ct import CatPhan600 # or import the CatPhan503 or CatPhan600

mycbct = CatPhan600(cbct_folder)
results = mycbct.results_data()



What version of pylinac?

You can run this to get it:

import pylinac



Ah. This bug may be to blame: Changelog — pylinac 3.8.0 documentation
If you can try 3.6+ it should work.

pip install pylinac --upgrade
pip install pylinac==3.6

Ah brilliant!

Apologies I had the incorrect version, silly mistake. I had recently used pip install pylinac and it seemed to be “requirement already satisfied” but pip install pylinac --upgrade did the trick and I’m running 3.9 now.

Thanks for the help and all the great work!