AverageOfAir_ExtendedMask.py 文件源码

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

项目:MDT 作者: cbclab 项目源码 文件源码
def _get_air_voxels(self, input_data, border_offset=3):
        """Get a two dimensional list with all the voxels in the air.

        Returns:
            ndarray: The first dimension is the list of voxels, the second the signal per voxel.
        """
        indices = np.where(input_data.mask > 0)
        max_dims = np.max(indices, axis=1)
        min_dims = np.min(indices, axis=1)

        mask = np.copy(input_data.mask)

        mask[min_dims[0]:max_dims[0]] = True
        mask[:, min_dims[1]:max_dims[1], :] = True
        mask[..., min_dims[2]:max_dims[2]] = True

        mask[0:border_offset] = True
        mask[-border_offset:] = True
        mask[:, 0:border_offset, :] = True
        mask[:, -border_offset:, :] = True
        mask[..., 0:border_offset] = True
        mask[..., -border_offset:] = True

        return create_roi(input_data.signal4d, np.invert(mask))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号