def min_max(self, mask=None):
"""Get the minimum and maximum value in this data.
If a mask is provided we get the min and max value within the given mask.
Infinities and NaN's are ignored by this algorithm.
Args:
mask (ndarray): the mask, we only include elements for which the mask > 0
Returns:
tuple: (min, max) the minimum and maximum values
"""
if mask is not None:
roi = mdt.create_roi(self.data, mask)
return np.nanmin(roi), np.nanmax(roi)
return np.nanmin(self.data), np.nanmax(self.data)
评论列表
文章目录