Code Monkey home page Code Monkey logo

medimages4tests's Introduction

Medimages4tests

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

medimages4tests's People

Contributors

tclose avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.