mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-13 03:01:50 +02:00
fix(image_processor): support for nans in nd arrays
This commit is contained in:
@ -27,7 +27,12 @@ class ImageStats:
|
|||||||
Returns:
|
Returns:
|
||||||
ImageStats: The statistics of the image data.
|
ImageStats: The statistics of the image data.
|
||||||
"""
|
"""
|
||||||
return cls(maximum=np.max(data), minimum=np.min(data), mean=np.mean(data), std=np.std(data))
|
return cls(
|
||||||
|
maximum=np.nanmax(data),
|
||||||
|
minimum=np.nanmin(data),
|
||||||
|
mean=np.nanmean(data),
|
||||||
|
std=np.nanstd(data),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyDataclass
|
# noinspection PyDataclass
|
||||||
@ -81,7 +86,7 @@ class ImageProcessor(QObject):
|
|||||||
Returns:
|
Returns:
|
||||||
np.ndarray: The processed data.
|
np.ndarray: The processed data.
|
||||||
"""
|
"""
|
||||||
return np.abs(np.fft.fftshift(np.fft.fft2(data)))
|
return np.abs(np.fft.fftshift(np.fft.fft2(np.nan_to_num(data))))
|
||||||
|
|
||||||
def rotation(self, data: np.ndarray, rotate_90: int) -> np.ndarray:
|
def rotation(self, data: np.ndarray, rotate_90: int) -> np.ndarray:
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user