Skip to main content

Library for standardized data input/output for musculoskeletal imaging, based on BIDS

Project description

ormir-mids

I/O of Medical Image Data Structure (MIDS) for Open and Reproducible Musculoskeletal Imaging Research (ORMIR). Based on the BIDS data structure.

[!NOTE]
This package is a fork of muscle-bids for muscle MR imaging data.

GitHub license

Tutorial

Run the tutorial on Binder    Binder
Run the tutorial on Colab     Open In Colab

Main contributors

  • Francesco Santini
  • Donnie Cameron
  • Leonardo Barzaghi
  • Judith Cueto Fernandez
  • Jilmen Quintiens
  • Lee Youngjun
  • Jukka Hirvasniemi
  • Gianluca Iori
  • Simone Poncioni
  • Serena Bonaretti

Installation

Dependencies

To install ormir-mids, run the code below, noting this list of dependencies.

It is recommended to install ormir-mids in a separate virtual environment:

conda env create -n ormir-mids
conda activate ormir-mids

Clone the git repository:

git clone https://github.com/ormir-mids/ormir-mids.git

Now we can install the package using pip. This will also install the required dependencies.

cd ormir-mids
pip install .
pip install --upgrade nibabel # the default nibabel has bugs

Usage

ormir-mids can be used in two ways:

  1. Running dcm2omids as an executable to convert DICOM data to the MIDS format.
  2. Importing ormir-mids as a Python module to find, load, and interrogate ORMIR-MIDS-format data.

1. Converting DICOMs to the ORMIR-MIDS structure

The commandline script is called dcm2omids.exe. To view the commandline script help type

dcm2omids -h

To use ormir-mids within Python, import the following modules

from ormir_mids.utils.io import find_bids, load_bids
import nibabel as nib

For a detailed description of how to use ormir-mids see the following notebook

ormir-mids usage: dcm2mbids Made withJupyter

2. Exploring medical volumes with ORMIR-MIDS

ormir-mids can be used within Python to load, manipulate, and visualize medical volume datasets, without having to convert them to the ORMIR-MIDS structure.

  • Load a DICOM file to a MedicalVolume object
from ormir_mids.utils.io import load_dicom
mv = load_dicom('<Path-to-DICOM-file>')
  • Slice the volume. This will create a separate subvolume. Metadata will be sliced appropriately.
mv_subvolume = mv[50:90, 50:90, 30:70]
mv_itk = mv.to_sitk()

Examples of how to use ormir-mids for common data handling, image manipulation and processing tasks within Python can be found in this notebook

ormir-mids usage: MedicalVolume class Made withJupyter

Acknowledgement

The development of ORMIR-MIDS specification and package started during the 2nd ORMIR workshop Sharing and Curating Open Data in Musculoskeletal Imaging Research and is currently ongoing. ORMIR-MIDS is an extension of muscle-BIDS, which was partly developed during the 1st ORMIR workshop Building the Jupyter Community in Musculoskeletal Imaging Research.

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

ormir_mids-0.1.2.tar.gz (28.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ormir_mids-0.1.2-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

Details for the file ormir_mids-0.1.2.tar.gz.

File metadata

  • Download URL: ormir_mids-0.1.2.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for ormir_mids-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dfd48e12b6bc3bd4315f8c5759ebe5f29960d75ea25b03c7cc34c4412964f8d4
MD5 b07c25342b0f08f801baa71ac0276863
BLAKE2b-256 ba6a210d66190463b021869459053810fa481e6fdd5747a295f1258b8e2b8832

See more details on using hashes here.

File details

Details for the file ormir_mids-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ormir_mids-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 36.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for ormir_mids-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04e12dcfdb1dc9e923a1ff4089edad1894f9bda8c871d2b6051d1af0602a39fb
MD5 7deb065fe03abc878b0d32ce3935aeb7
BLAKE2b-256 6db9b4bc74992801993773a21f39e361d36542cb877b31d4ddbf06bed7bd86d9

See more details on using hashes here.

Supported by

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