def optimize_contrast(self, data):
if (self._vmin_user is not None and self._vmax_user is not None):
return
if "complex" in data.dtype.name:
data = np.log(np.abs(data))
self._vmin_auto, self._vmax_auto = utils.contrast_stretching(
data, self.saturated_pixels)
After Change
def optimize_contrast(self, data):
if (self._vmin_user is not None and self._vmax_user is not None):
return
if np.issubdtype(data.dtype, complex):
data = np.log(np.abs(data))
self._vmin_auto, self._vmax_auto = utils.contrast_stretching(
data, self.saturated_pixels)