Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Pipeline v2

ANUJA NEGI edited this page Feb 17, 2022 · 1 revision

Setup

  1. Either download or clone the repository.
git clone https://github.com/printyourbrain/PrintYourBrain.git
  1. Change directory.
cd PrintYourBrain

For usage in a container

DISCLAIMER: You need ~4GB free storage space for this.

Pre-Requisites

Make sure you have your neurodocker image listed in docker images.

Getting Started

  1. Build the PYB image from this Dockerfile.
docker build --tag pyb - < pyb.Dockerfile
  1. Run an interative bash in your image, while mounting the PrintYourBrain folder and specifying your Freesurfer license file.
docker run --platform linux/x86_64 -it -v /path/to/PrintYourBrain:/PrintYourBrain -v /path/to/your/freesurfer/license.txt:/opt/freesurfer-6.0.0-min/license.txt pyb:latest

You can get your license file from here incase you don't have one!

  1. Make sure pip is installed.
python -m ensurepip --upgrade
  1. Configure your shell and restart it.
conda init bash
exec bash
  1. Activate the pyb conda environemnt within the container.
conda activate pyb

You are all set up to process your brain scans now! 🧠🚀

For usage in a conda environment

Pre-Requisites

Make sure to setup both your freesurfeer and ANTs environment variables.

Getting Started

  1. Create a conda environment from this environment file.
conda env create --file environment.yml
  1. Start your conda environment.
conda activate pyb

Processing Brain Scans

Now that you are in your docker container or the conda environment, you are ready to start processing your T1w brain images!

  1. Change directory.
cd PrintYourBrain
  1. Build the pyb package.
python -m pip install --upgrade build
python -m build
  1. CAUTION: Configure your project and update paths in pyb/config.py. The current config points to a 'data' folder inside PrintYourBrain directory for all files. Download Brain Templates for ANTs from here. The deafult template in the repo is NKI (can obviously be changed!).

  2. Run the pyb script!

python pyb.py -i <input NIfTI file> -o <output directory name> -s <subject_name>

Run python pyb.py -h for usage instructions!