Fast brain extraction using neural networks
Project description
This is the official implementation of the deepbet paper.
deepbet is a neural network based tool which achieves state-of-the-art results for brain extraction of T1w MR images of healthy adults while taking ~1 second per image.
Usage
After installation, there are three ways to use deepbet
deepbet-gui
runs the Graphical User Interface (GUI)
deepbet-cli
runs the Command Line Interface (CLI)
- Run deepbet directly in Python
from deepbet import run_bet
input_paths = ['path/to/sub_1/t1.nii.gz', 'path/to/sub_2/t1.nii.gz']
brain_paths = ['path/to/sub_1/brain.nii.gz', 'path/to/sub_2/brain.nii.gz']
mask_paths = ['path/to/sub_1/mask.nii.gz', 'path/to/sub_2/mask.nii.gz']
tiv_paths = ['path/to/sub_1/tiv.csv', 'path/to/sub_2/tiv.csv']
run_bet(input_paths, brain_paths, mask_paths, tiv_paths, threshold=.5, n_dilate=0, no_gpu=False)
Besides the input paths
and the output paths
brain_paths
: Destination filepaths of input nifti files with brain extraction appliedmask_paths
: Destination filepaths of brain mask nifti filestiv_paths
: Destination filepaths of .csv-files containing the total intracranial volume (TIV) in cm³- Simpler than it sounds: TIV = Voxel volume * Number of 1-Voxels in brain mask
you can additionally do
- Fine adjustments via
threshold
: deepbet internally predicts values between 0 and 1 for each voxel and then includes each voxel which is above 0.5. You can change this threshold (e.g. to 0.1 to include more voxels). - Coarse adjustments via
n_dilate
: Enlarges/shrinks mask by successively adding/removing voxels adjacent to mask surface.
and choose if you want to use GPU (NVIDIA and Apple M1/M2 support) for speedup
no_gpu
: deepbet automatically uses NVIDIA GPU or Apple M1/M2 if available. If you do not want that set no_gpu=True.
Installation
pip install deepbet
conda install -c anaconda pyqt=5.15.7
Citation
If you find this code useful in your research, please consider citing:
@inproceedings{deepbet,
Author = {Lukas Fisch, Stefan Zumdick, Carlotta Barkhau, Daniel Emden, Jan Ernsting, Ramona Leenings, Kelvin Sarink, Nils R. Winter, Udo Dannlowski, Tim Hahn},
Title = {fastbet: Fast brain extraction of T1-weighted MRI using Convolutional Neural Networks},
Journal = {Imaging Neuroscience},
Year = {2023}
}
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
Built Distribution
File details
Details for the file deepbet-0.0.1.tar.gz
.
File metadata
- Download URL: deepbet-0.0.1.tar.gz
- Upload date:
- Size: 10.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.12 Linux/5.15.0-78-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12948a7b793c5f5e9da3e8655c8ab546ad252f474aacbb6b1ffe00cf23911223 |
|
MD5 | bb5ab863321af22a4ac5995db1c18272 |
|
BLAKE2b-256 | b6346caec6b8dcfe7121627048f9c50a693189280dedbe39ecc961950117c847 |
File details
Details for the file deepbet-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: deepbet-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.12 Linux/5.15.0-78-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 012d12a4eaae949261631ea344adc6880ecd1246d92f6f752a7aa141b3f2817a |
|
MD5 | 6b9e2f21bfcd183d6a01b16a5d87ac49 |
|
BLAKE2b-256 | c550ddb5c44e00157ebbfe5432a6a19e7c5f5c9067b9b974784b687f05e32b9f |