base.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:MDT 作者: cbclab 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号