Skip to content

RSIP-Vision/medio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

medio

Medical images I/O python package

This package unifies the io engines of itk, nibabel, and pydicom packages in a simple and comprehensive interface. It includes translation between the metadata conventions, reorientations, affine matrix computation.

Installation

Download the whl file and install it with:

(<env-name>) C:\Users\<username>\Downloads>pip install medio-0.1.0-py3-none-any.whl

This will install the medio python package and its dependencies in your environment.

Requirements

The dependencies are:

  • numpy
  • itk (itk-io, itk-filtering)
  • nibabel
  • pydicom + dicom-numpy

A conda environment yml is in the project's root.

Usage

There are 3 main functions in medio: read_img, save_img and save_dir.

from medio import read_img, save_img
# read a dicom series from a folder
img_arr, metadata = read_img('data/dicom-folder/', desired_ornt='IAR')
# do your stuff and save in any format
save_img('ct.nii.gz', img_arr, metadata, backend='nib')