jrkerns / pylinac

An image analysis library for medical physics
https://pylinac.readthedocs.io/en/latest/
MIT License
157 stars 99 forks source link

Catphan slice thickness calculation mismatch with documentation #416

Closed keithoffer closed 2 years ago

keithoffer commented 2 years ago

In the Catphan documentation, in the calculation procedure for slice thickness it states:

"Based on testing, the FWHM is not always perfectly detected and may not “catch” the profile, giving an undervalued representation. Thus, the two longest profiles are averaged and the value is converted from pixels to mm and multiplied by 0.42."

However in the code it seems to average all four profiles (line 503 to 505 of pylinac/ct.py):

def meas_slice_thickness(self) -> float:
    """The average slice thickness for the 4 wire measurements in mm."""
    return np.mean(sorted(roi.wire_fwhm*self.mm_per_pixel*0.42 for roi in self.thickness_rois.values()))/(1+2*self.pad)

I believe these two should agree. I'm not sure which is more appropriate to change though.

jrkerns commented 2 years ago

Good catch. I think this was behavior I initially made but converted later. For backwards compatibility I'll change the docs. Thanks!