jrkerns / pylinac

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

WinstonLutz images which don't get inverted trigger a `ValueError: output array is read-only` #303

Closed randlet closed 4 years ago

randlet commented 4 years ago

Describe the bug

When performing a Winston Lutz analysis on an image set where the images don't get inverted, a ValueError: output array is read-only exception gets thrown.

To Reproduce

Run WL analysis with attached image set.

Additional context

The reason it occurs is because the DicomImage class sets the array attribute to the dicom dataset pixel_array attribute (here)which is read only. Since it's read only self.array -= min_value in ground (here) triggers the ValueError. The demo image doesn't trigger the same issue because self.array is reassigned in invert (here.

PR incoming.