Skip to content

Converter and utilities for the ORMIR-MIDS data format

License

Notifications You must be signed in to change notification settings

mariamonzon/ormir-mids

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: Open In Colab

Main contributors

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

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 dcm2mbids as an executable to convert DICOM data to the BIDS format.
  2. Importing ormir-mids as a Python module to find, load, and interrogate BIDS-format data.

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

dcm2mbids -h

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

from muscle_bids.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

Medical volume manipulation within Pyhon

ormir-mids can be used within Python to load, manipule and visualize medical volume datasets, without convertion to the BIDS format.

  • Load a DICOM file to a MedicalVolume object
from muscle_bids.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

Acknowledgement

This package was developed thanks to the support of the JCMSK community during the Maastricht 2022 workshop and hackaton “Building the Jupyter Community in Musculoskeletal Imaging Research”.

Image I/O is based on DOSMA by Arjun Desai. A stripped-down version of DOSMA is present in muscle-bids/dosma_io.

About

Converter and utilities for the ORMIR-MIDS data format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 82.8%
  • Python 17.2%