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.
Tutorial
Run the tutorial on Binder
Run the tutorial on Colab
Main contributors
- Francesco Santini
- Donnie Cameron
- Leonardo Barzaghi
- Judith Cueto Fernandez
- Jilmen Quintiens
- Lee Youngjun
- Jukka Hirvasniemi
- Gianluca Iori
- 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:
- Running
dcm2omids
as an executable to convert DICOM data to the MIDS format. - 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
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]
- Convert volume to ITK image with SimpleITK
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
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
Built Distribution
File details
Details for the file ormir_mids-0.0.6.tar.gz
.
File metadata
- Download URL: ormir_mids-0.0.6.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e88ada7667d4a31d06e26944e8b84f35d01912fa9524d9cd2a55242979ea500 |
|
MD5 | fcb7d765aa71be4dc28a23b6b8d66040 |
|
BLAKE2b-256 | fd6b47a0ebde9181921ed3620bed6443857fac91d50b549ac8d237b02611f0dc |
File details
Details for the file ormir_mids-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: ormir_mids-0.0.6-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a8374d6fc2c860e33347dad22456686638ee7ec3000b65b1e60daa8cbd4181e |
|
MD5 | 8baf56bd94d142eaad2383d75e3e6273 |
|
BLAKE2b-256 | 0cb1dc7c361d07e0b63a81043755ca18ed5dc3c47786051cfb1464b698850866 |