mrbabel is a Python package for reading, processing, and writing MRI data in various formats. The package supports both k-space and image-space data, enabling seamless integration with common acquisition and reconstruction pipelines.
- Read and Write Multiple Formats: - K-space data: ISMRMRD/MRD, Siemens, GE - Image data: DICOM, NIfTI
- Unsorted and Sorted Data Handling: - Unsorted: acquisition-like streams - Sorted: organized arrays ready for reconstruction
- Serialization: - Convert between formats for both k-space and image data
- Metadata Handling: - Global headers and per-readout/image headers - Format-specific metadata parsing
- Interoperability: - Vendor-specific parsing and conversion utilities
You can install mrbabel using pip:
pip install mrbabel
- Python >= 3.10
- numpy
- pydicom
- nibabel
- ismrmrd
The full documentation is available at: https://github.com/INFN-MRI/mrbabel
Here’s a quick example of how to use mrbabel:
Read k-space data from an MRD file:
from mrbabel.io import read_mrd_acquisitions header, acquisitions = read_mrd_acquisitions("data.mrd")
Sort the acquisitions for reconstruction:
from mrbabel.data import sort_acquisitions sorted_data, sorted_traj, sorted_headers = sort_acquisitions(acquisitions)
Write the sorted data back to an MRD file:
from mrbabel.io import write_mrd write_mrd("sorted_data.mrd", acquisitions, header)
Contributions are welcome! Please feel free to submit issues or pull requests on our GitHub page.
This project is licensed under the MIT License. See the LICENSE file for details.
mrbabel is developed and maintained by:
- Matteo Cencini (Author/Maintainer)
This project builds on tools and ideas from:
- ismrmrd
- mrd::python
- pydicom
- nibabel
- pyvoxel
- pymapvbvd