nifti.py 文件源码

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

项目:pisap 作者: neurospin 项目源码 文件源码
def save(self, image, outpath):
        """ A method that save the image data and associated metadata.

        Parameters
        ----------
        image: Image
            the image to be saved.
        outpath: str
            the path where the the image will be saved.
        """
        diag = (1. / image.spacing).tolist() + [1]
        _image = nibabel.Nifti1Image(image.data, numpy.diag(diag))
        nibabel.save(_image, outpath)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号