跳转到主要内容

生成具有现实性头部的虚拟医学图像数据,用于图像处理测试

项目描述

https://github.com/australian-imaging-service/medimages4tests/actions/workflows/test.yml/badge.svg https://codecov.io/gh/australian-imaging-service/medimages4tests/branch/main/graph/badge.svg?token=UIS0OGPST7 Supported Python versions Latest Version

生成带有垃圾图像数据的虚拟医学图像,但具有现实性头部,以测试图像处理管道

安装

Medimage4tests可在PyPI上获取,因此要安装,只需使用pip

$ pip3 install medimages4tests

或者在您的包的test_requires中包含。

用法

创建一个pytest fixture,包含具有DICOM格式的场图元数据的虚拟图像

# Import medimages4tests generator functions
from medimages4tests.dummy.dicom.mri.fmap.ge.discovery_mr888.dv26_0_r05_2008a import get_image

# Return generated images in pytest fixtures (or alternative test framework)
@pytest.fixture()
def ge_dicom_fmap():
    return get_image()

创建一个虚拟NIfTI图像

import numpy
# Import `get_image` function
from medimages4tests.dummy.nifti import get_image

# Create dummy nifti image of 10x10x10 containing all ones
@pytest.fixture()
def ones_nifti():
    return get_image(
        data=numpy.ones((10, 10, 10))
    )

访问来自OpenNeuro.org的真实T1加权图像

from medimages4tests.mri.neuro.t1w import get_image

@pytest.fixture()
def t1w_nifti():
    return get_image(sample="ds004130-ON01016")

致谢

作者感谢国家成像设施提供的设施和科学及技术支持,该设施是国家协作研究基础设施战略(NCRIS)的能力。

项目详情


下载文件

下载适用于您平台的项目文件。如果您不确定该选择哪个,请了解更多关于安装包的信息。

源代码分发

本发行版没有可用的源代码分发文件。请参阅生成分发存档的教程

构建分发

medimages4tests-0.5.5-py3-none-any.whl (1.0 MB 查看哈希值)

上传时间 Python 3

支持