Skip to main content

Generates dummy medical image data with realistic headers to be used in image handling tests

Project description

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

Generates dummy medical images, with junk image data but realistic headers, to test imaging handling pipelines

Installation

Medimage4tests is available on PyPI so to install, simply use pip

$ pip3 install medimages4tests

or include in your package’s test_requires.

Usage

Create a pytest fixture consisting of a dummy image with field-map metadata in DICOM format

# 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()

Create a dummy NIfTI image

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))
    )

Access real T1-weighted from OpenNeuro.org

from medimages4tests.mri.neuro.t1w import get_image

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

Acknowledgements

The authors acknowledge the facilities and scientific and technical assistance of the National Imaging Facility, a National Collaborative Research Infrastructure Strategy (NCRIS) capability.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

medimages4tests-0.5.4-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file medimages4tests-0.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for medimages4tests-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5703465ba1ae8e65fc76dbed206d7bc5e44e9927fac8c77fac37106e50f93a08
MD5 48e89aa6c600baf7e06eb3e7f46d1641
BLAKE2b-256 b504c6cf22a53ebd28b8a910bc07fdc8f2ee31f501455c357615cc6f0f069192

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page