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.
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
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
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.
(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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdefce92647ba200051bc1552e734108ccad86e5f4ba7889f27f08e40328b652
|
|
| MD5 |
dd304180833d34d307609b42c7e40bd8
|
|
| BLAKE2b-256 |
6d3f4a9f9dc91544343e51d04c90393eee89a5c8dc46e636d274107deb1136d6
|
Provenance
The following attestation bundles were made for mrid_python-0.1.4.tar.gz:
Publisher:
python-publish.yml on inikishev/mrid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrid_python-0.1.4.tar.gz -
Subject digest:
cdefce92647ba200051bc1552e734108ccad86e5f4ba7889f27f08e40328b652 - Sigstore transparency entry: 753472783
- Sigstore integration time:
-
Permalink:
inikishev/mrid@685eec1e3fa2dcc5caef109abcc08e7da4c46302 -
Branch / Tag:
refs/tags/0.1.4 - Owner: https://github.com/inikishev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@685eec1e3fa2dcc5caef109abcc08e7da4c46302 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2166060f2e0625f9d2d7ee9262c0d1391c5fa9de6fdeee78c7847806a398df94
|
|
| MD5 |
a2a5b9c2bd2f25ec65c5015618769be5
|
|
| BLAKE2b-256 |
1631558c7717cdd3ae47e12885efc521443f75f5b3dfa2937c147918506668c1
|
Provenance
The following attestation bundles were made for mrid_python-0.1.4-py3-none-any.whl:
Publisher:
python-publish.yml on inikishev/mrid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mrid_python-0.1.4-py3-none-any.whl -
Subject digest:
2166060f2e0625f9d2d7ee9262c0d1391c5fa9de6fdeee78c7847806a398df94 - Sigstore transparency entry: 753472794
- Sigstore integration time:
-
Permalink:
inikishev/mrid@685eec1e3fa2dcc5caef109abcc08e7da4c46302 -
Branch / Tag:
refs/tags/0.1.4 - Owner: https://github.com/inikishev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@685eec1e3fa2dcc5caef109abcc08e7da4c46302 -
Trigger Event:
push
-
Statement type: