Skip to content

Python tools to read and write raw and image MR data in different formats.

License

Notifications You must be signed in to change notification settings

INFN-MRI/mrbabel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mrbabel: MRI Data Reading and Sorting

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.

Key Features

  • 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

Installation

You can install mrbabel using pip:

pip install mrbabel

Requirements

  • Python >= 3.10
  • numpy
  • pydicom
  • nibabel
  • ismrmrd

Documentation

The full documentation is available at: https://github.com/INFN-MRI/mrbabel

Quickstart

Here’s a quick example of how to use mrbabel:

  1. Read k-space data from an MRD file:

    from mrbabel.io import read_mrd_acquisitions
    
    header, acquisitions = read_mrd_acquisitions("data.mrd")
  2. Sort the acquisitions for reconstruction:

    from mrbabel.data import sort_acquisitions
    
    sorted_data, sorted_traj, sorted_headers = sort_acquisitions(acquisitions)
  3. Write the sorted data back to an MRD file:

    from mrbabel.io import write_mrd
    
    write_mrd("sorted_data.mrd", acquisitions, header)

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests on our GitHub page.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Credits

mrbabel is developed and maintained by:

  • Matteo Cencini (Author/Maintainer)

Acknowledgments

This project builds on tools and ideas from:

  • ismrmrd
  • mrd::python
  • pydicom
  • nibabel
  • pyvoxel
  • pymapvbvd

About

Python tools to read and write raw and image MR data in different formats.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages