ormir-mids package

Module contents

This is the muscle-bids base package providing basic I/O functionality for reading and writing DICOM and BIDS files. The python representation of the data is the MedicalVolume class, provided by pyvoxel, with added attributes for BIDS.

Specifically, the MedicalVolumes returned have four additional attributes:
  • omids_header: a dictionary containing the information contained in the BIDS header

  • patient_header: a dictionary containing patient information

  • extra_header: a dictionary containing raw DICOM tags that are not part of the BIDS header

  • meta_header: a dictionary containing the meta DICOM information

ormir_mids.MedicalVolume

alias of OMidsMedVolume

ormir_mids.find_omids(path, suffix)[source]

Finds an ORMIR-MIDS dataset with a specific suffix (e.g. mese).

Parameters:

path (str): Path to the root folder suffix (str): Suffix of the bids dataset

Returns:

list: List of paths to the bids datasets

ormir_mids.load_dicom(path, group_by=None)[source]

Loads all dicom files in a folder.

Parameters:

path (str): Path to the folder group_by (str): If not None, group the volumes by the specified header

Returns:

MedicalVolume with muscle-bids headers

ormir_mids.load_dicom_with_subfolders(path)[source]

Loads all dicom files in a folder and its subfolders.

Parameters:

path (str): Path to the root folder

Returns:

list: List of dicom volumes

ormir_mids.save_dicom(path, medical_volume, new_series=True)[source]

Saves a volume to a folder.

Parameters:

path (str): Path to the folder medical_volume (MedicalVolume): The volume to save new_series (bool): If True, a new series is created

Returns:

None

ormir_mids.save_omids(nii_file, medical_volume, save_patient_json=True, save_extra_json=True)[source]

Saves a volume to a nifti file and its corresponding json files.

Parameters:

nii_file (str): Path to the nifti file medical_volume (MedicalVolume): The volume to save

Returns:

None