Automatic segmentation of epilepsy neurosurgery resection cavity.
Project description
RESSEG
Automatic segmentation of postoperative brain resection cavities from magnetic resonance images (MRI) using a convolutional neural network (CNN) trained with PyTorch 1.7.1.
Installation
It's recommended to use conda
and install your desired PyTorch version before
installing resseg
.
A 6-GB GPU is large enough to segment an image in the MNI space.
conda create -n resseg python=3.8 ipython -y && conda activate resseg # recommended
pip install resseg
Usage
Below are two examples of cavity segmentation for tumor and epilepsy surgery. The epilepsy example includes registration to the MNI space. Both examples can be run online using Google Colab:
BITE
Example using an image from the Brain Images of Tumors for Evaluation database (BITE).
BITE=`resseg-download bite`
resseg $BITE -o bite_seg.nii.gz
EPISURG
Example using an image from the EPISURG dataset.
Segmentation works best when images are in the MNI space, so resseg
includes a tool
for this purpose (requires ANTsPy).
pip install antspyx
EPISURG=`resseg-download episurg`
resseg-mni $EPISURG -t episurg_to_mni.tfm
resseg $EPISURG -o episurg_seg.nii.gz -t episurg_to_mni.tfm
Trained model
The trained model can be used without installing resseg
, but you'll need to install unet
first:
pip install unet==0.7.7
Then, in Python:
import torch
repo = 'fepegar/resseg'
model_name = 'ressegnet'
model = torch.hub.load(repo, model_name, pretrained=True)
Credit
If you use this library for your research, please cite our MICCAI 2020 paper:
And the EPISURG dataset, which was used to train the model:
See also
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
File details
Details for the file resseg-0.3.6.tar.gz
.
File metadata
- Download URL: resseg-0.3.6.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 677eb61c4d4dfef0730614647611b65f948c91fe95ff7f23c9bedc2c885d60a9 |
|
MD5 | 06a0aab10d0537718c4986cfa064fb2e |
|
BLAKE2b-256 | 6aea73e841de780bef9b313bdea1a0a9430e9339803d55f8526812159ecd3f2d |
File details
Details for the file resseg-0.3.6-py2.py3-none-any.whl
.
File metadata
- Download URL: resseg-0.3.6-py2.py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e2eeeafa5e9824f5e1e0fe226d5279aef50207003c5ab3340126323a5e379d4 |
|
MD5 | 500143f84171694d8f6f70c8eb8aa5e5 |
|
BLAKE2b-256 | bffb3335923c389472d4b8d9933d7829e5133d4b20633eec395da6dca98a8958 |