Skip to main content

Model-driven image registration

Project description

https://img.shields.io/badge/License-Apache_2.0-blue.svg

Model-driven motion correction for medical imaging

Installation

pip install mdreg

Typical usage

import mdreg

# Get some test data (variable flip angle MRI)
data = mdreg.fetch('VFA')

# Configure the signal model fit
fit_image = {
    'func': mdreg.fit_spgr_vfa_lin,     # VFA signal model
    'FA': data['FA'],               # Flip angle in degress
    'progress_bar': True,           # Show a progress bar
}

# Configure the coregistration method
fit_coreg = {
    'package': 'elastix',
    'spacing': data['spacing'],
}

# Perform the motion correction
coreg, defo, fit, pars = mdreg.fit(
    data['array'],                # Signal data to correct
    fit_image = fit_image,        # Signal model fit
    fit_coreg = fit_coreg,        # Coregistration
    verbose = 2,                  # Show progress update
)

# Visualize the results
anim = mdreg.plot.animation(
    coreg,
    title = 'Motion corrected VFA',
    'interval' : 500,                   # Time between animation frames in ms
    'vmin' : 0,                         # Minimum value of the colorbar
    'vmax' : np.percentile(coreg, 99),  # Maximum value of the colorbar
)
https://qib-sheffield.github.io/mdreg/_images/sphx_glr_plot_3Dexample_vfa_002.gif

License

Released under the Apache 2.0 license:

Copyright (C) 2023-2024 dcmri developers

Project details


Download files

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

Source Distribution

mdreg-0.5.1.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

mdreg-0.5.1-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

Details for the file mdreg-0.5.1.tar.gz.

File metadata

  • Download URL: mdreg-0.5.1.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for mdreg-0.5.1.tar.gz
Algorithm Hash digest
SHA256 7c6de5c9e2165e741ec3af967c24b555b7c621b2912a6397db16a464521ef6da
MD5 95c4d82e426272069e7e871851d9063f
BLAKE2b-256 632c8bcd750850e3168d99cbfa3cbf68d15404964b4e930e19848875b6162a4c

See more details on using hashes here.

File details

Details for the file mdreg-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: mdreg-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 42.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for mdreg-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd682eaf86de037ca2d77622ab4f7bac29d66b1351da8b4d5d83722a547c84c2
MD5 3a2f0001ece26be522247a60d1f7d5a8
BLAKE2b-256 1abf97a369aec412291dda7846749fa5298e2fd20367b730f35219376f03bf02

See more details on using hashes here.

Supported by

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