Skip to main content

Tools for working with 3D medical images and segmentations - registration, brain skull-stripping, etc.

Project description

mrid

mrid is a library for preprocessing of 3D images, particularly medical images.

It provide interfaces for many medical image processing tools such as SimpleElastix, HD-BET, SynthStrip, CTSeg. Note that those libraries are not bundled with mrid, I've included installation instructions in all notebooks.

Installation

Either run

pip install mrid-python

or

pip install git+https://github.com/inikishev/mrid

Basics

The images you pass to all functions in mrid can be path to a .nii.gz file, DICOM directory, sitk.Image, numpy array or torch tensor. All functions return results as sitk.Image. If you need a numpy array, you can use mrid.tonumpy(sitk_image).

Registering images with SimpleITK-SimpleElastix

SimpleElastix is a robust tool for image registration which works really well out-of-the-box. It works on both Windows and Linux.

See this notebook for how to install and use it. image

Skullstripping MRI scans with HD-BET

HD-BET is a model that performs skullstripping of pre- and post-constrast T1, T2 and FALIR MRIs. It works on both Windows and Linux.

See this notebook for how to install and use it image

Skullstripping with SynthStrip

SynthStrip is a skull-stripping tool that works with many different image types and modalities, including MRI, DWI, CT, PET, etc.

See this notebook for how to install and use it image

Skullstripping and segmentation of CT images with CTseg

CTseg can skull-strip CT images and perform their segmentation, it also registers them to a common space (see its README). Note that it can be very slow for 512x512 series (can take few hours), but you can downsample to 256x256. If you only need to quickly skullstrip CT scans without warping them you can use SynthStrip.

TODO!!!

Example workflow - preprocessing MRIs to BraTS format

Many BraTS datasets are provided as skullstripped images in SRI24 space. See this notebook for how to process raw scans to this format.

image

(T1n image looks weird because that's just how it is in the dataset)

References

The MRIs for all images above are from https://zenodo.org/records/7213153.

Colin Vanden Bulcke. (2022). Open-Access DICOM MRI session (1.0) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7213153

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

mrid_python-0.1.4.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mrid_python-0.1.4-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file mrid_python-0.1.4.tar.gz.

File metadata

  • Download URL: mrid_python-0.1.4.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mrid_python-0.1.4.tar.gz
Algorithm Hash digest
SHA256 cdefce92647ba200051bc1552e734108ccad86e5f4ba7889f27f08e40328b652
MD5 dd304180833d34d307609b42c7e40bd8
BLAKE2b-256 6d3f4a9f9dc91544343e51d04c90393eee89a5c8dc46e636d274107deb1136d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mrid_python-0.1.4.tar.gz:

Publisher: python-publish.yml on inikishev/mrid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mrid_python-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: mrid_python-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mrid_python-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2166060f2e0625f9d2d7ee9262c0d1391c5fa9de6fdeee78c7847806a398df94
MD5 a2a5b9c2bd2f25ec65c5015618769be5
BLAKE2b-256 1631558c7717cdd3ae47e12885efc521443f75f5b3dfa2937c147918506668c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mrid_python-0.1.4-py3-none-any.whl:

Publisher: python-publish.yml on inikishev/mrid

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page