Snakemake workflow for fetal bold brain segmentation
If you don't have AFNI and FSL installed, you need to use the --use-singularity
option when running snakemake
.
Training is best with a GPU, but inference can be done reasonably fast with CPU only.
- Create a new github repository using this workflow as a template.
- Clone the newly created repository to your local system, into the place where you want to perform the data analysis.
Configure the workflow according to your needs via editing config.yml
file, specifically the paths to your nifti images.
You should install your dependencies in a virtual environment. Once you have activated your virtual environment, you can install the dependencies with pip install .
A recommended alternative that also takes care of creating a virtual environment is to use Poetry. On OSX or Linux can be installed with:
curl -sSL https://install.python-poetry.org | python3 -
Once you have poetry installed you can simply use the following to install dependencies into a virtual environment, then activate it:
cd nnunet-fetalbrain
poetry install
poetry shell
To run inference on your test datasets, use:
snakemake all_test --cores all
By default, the trained model in the config will be downloaded and applied.
If you want to train a new model, set the use_downloaded
config variable to one that is not in the download_model
, then use:
snakemake all_train --cores all