CatPhan604 Error

Hello,

I have been using TIGRE as an external CT reconstruction tool, and appending a DICOM header to it for analysis by pylinac. I have run the pylinac demo as well as a sample from a clinically reconstructed ct which both work. My own files give this error though.

Traceback (most recent call last):
File “C:\Users\drman\PycharmProjects\pythonProject\main.py”, line 9, in
mycbct.analyze()
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\pylinac\ct.py”, line 1992, in analyze
self.localize()
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\pylinac\ct.py”, line 1699, in localize
self._phantom_center_func = self.find_phantom_axis()
File “C:\Users\drman\PycharmProjects\pythonProject\venv\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 200, in percentile
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\lib\function_base.py”, line 4205, in percentile
return _quantile_unchecked(
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\lib\function_base.py”, line 4473, in _quantile_unchecked
return _ureduce(a,
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\lib\function_base.py”, line 3752, in _ureduce
r = func(a, **kwargs)
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\lib\function_base.py”, line 4639, in _quantile_ureduce_func
result = _quantile(arr,
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\lib\function_base.py”, line 4745, in _quantile
take(arr, indices=-1, axis=DATA_AXIS)
File “<array_function internals>”, line 200, in take
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\core\fromnumeric.py”, line 190, in take
return _wrapfunc(a, ‘take’, indices, axis=axis, out=out, mode=mode)
File “C:\Users\drman\PycharmProjects\pythonProject\venv\lib\site-packages\numpy\core\fromnumeric.py”, line 57, in _wrapfunc
return bound(*args, **kwds)
IndexError: cannot do a non-empty take from an empty axes.

attached is one slice of the image I’m trying to analyze.

Thank you so much for your help!!

testfile92.dcm (514 KB)

One slice isn’t going to help me help you. You can send the whole dataset via the google form here: https://forms.gle/er2Gaoz7UfwjNJY19

Hey I shared those files with you on google forms, did you get a chance to look at them?

Thanks again

Something is fishy with the FOV. The image size is 512x512 and the pixel spacing is 0.65mm/pixel. This gives an FOV of 333mm, but the ReconstructionDiameter says 250, which is ~33% discrepancy. Pylinac is expecting a catphan of a certain size. If I change the catphan expected size to 133 (default is 101) the phantom is now detected. Unfortunately, this causes a lot of problems elsewhere because the physical values are expected to be accurate. The HU values are also off by ~1000, but that won’t stop the analysis. The slice thickness also seems iffy. It’s reported as 2.5mm but the distance in slices between the high contrast and HU modules was ~20 slices. The physical distance is 40mm for the 504, so i’m tempted to think the real slice thickness is 2. The ImagePatientPosition tag also did not vary which it should.

Unfortunately, I spent my available time just getting this far. The TL;DR is that you should check the DICOM tags to ensure they are accurate.

You can get somewhere by overriding the mm_per_pixel propery like so: catphan mm override (github.com)

I have made significant progress, although I am getting a new error. I found that originally my scans were backwards and flipped horizontally, which was part o the problem. Their pixel values were also off due to my poor HU mapping. I now have some data that works and some that doesn’t with the error text as follows

Traceback (most recent call last):
File “C:\Users\Physics 3\PycharmProjects\pythonProject\main.py”, line 9, in
print(mycbct.results())
^^^^^^^^^^^^^^^^
File “C:\Users\Physics 3\PycharmProjects\pythonProject\venv\Lib\site-packages\pylinac\ct.py”, line 2111, in results
f"MTF 80% (lp/mm): {self.ctp528.mtf.relative_resolution(80):2.2f}",
^^^^^^^^^^^^^^^
File “C:\Users\Physics 3\PycharmProjects\pythonProject\venv\Lib\site-packages\cached_property.py”, line 36, in get
value = obj.dict[self.func.name] = self.func(obj)
^^^^^^^^^^^^^^
File “C:\Users\Physics 3\PycharmProjects\pythonProject\venv\Lib\site-packages\pylinac\ct.py”, line 1126, in mtf
raise ValueError(
ValueError: Did not find any spatial resolution pairs to analyze. File an issue on github (https://github.com/jrkerns/pylinac/issues) if this is a valid dataset.

Process finished with exit code 1

I would greatly appreciate the assistance, I’ll also provide you with the data I’m using via the google form.