jrkerns / pylinac

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

IC Profiler x-profiles not copying cax dose to correct position #485

Closed AnthEspin closed 4 months ago

AnthEspin commented 8 months ago

Describe the bug Horizontal profiles are incorrectly inserting cax dose in wrong position. As Y profiles include 2 extra detectors around the central axis, pylinac is copying the cax dose to +1 and -1. I believe this should be at +1 and the cax index, so that the the 3 points are next to each other.

To Reproduce Load an IC profiler measurmeent and plot the horizontal plot

Expected behavior It is expected that the responses for 31, 32 and 33 should be the same. Response at detectors 30 and 31 should be swapped

Screenshots image

Additional context Line 309 - 311 in core/io.py should be changed from array = np.insert( array, center_detector_idx - 1, array[center_detector_idx] ) to array = np.insert( array, center_detector_idx, array[center_detector_idx] ) This should insert the cax dose to the correct position

jrkerns commented 7 months ago

Thanks! will be fixed in the next release

jrkerns commented 4 months ago

Fixed in 3.22.