mnoergaard / petprep_hmc

PETPrep head motion correction workflow
Apache License 2.0
7 stars 5 forks source link

PyPI Docker Hub DOI

PETPrep Head Motion Correction workflow (BIDS App)

This BIDS App provides a pipeline for preprocessing and head motion correction of Positron Emission Tomography (PET) data following the Brain Imaging Data Structure (BIDS) standard.

Features

Requirements (for more info see the environment.yml file)

Installation

Clone the repository and install the required packages:

git clone https://github.com/mnoergaard/petprep_hmc.git
cd petprep_hmc
pip install -e .

The package is also pip installable and can be installed using the following command

pip install petprep-hmc

Usage

To run the PETPrep Head Motion Correction BIDS App, use the following command:

python3 run.py --bids_dir /path/to/bids_input --output_dir /path/to/bids_output --analysis_level participant [--participant_label PARTICIPANT_LABEL]

For example, to process participant sub-01, use the following command:

python3 run.py --bids_dir /data/bids_input --output_dir /data/bids_output --participant_label 01

Outputs

Preprocessed PET data along with the estimated motion parameters (confounds) and motion plots will be stored in the directory specified by --output_dir or, if no output directory is specified, in <bids_dir>/derivatives/petprep_hmc following the BIDS Derivatives standard.

Installation and Running the Code using Docker

Prerequisites

To run petprep_hmc workflow using Docker, you must first have Docker installed on your system. You can download and install Docker from https://www.docker.com/.

Pulling the Docker Image

Once you have Docker installed, you can pull the petprep_hmc Docker image from Docker Hub by running the following command:

docker pull martinnoergaard/petprep_hmc:latest

Running the Docker Container

To run the petprep_hmc Docker container, use the following command:

docker run -it --rm \
    -v /path/to/bids_input:/data/input \
    -v /path/to/bids_output:/data/output \
    -v /path/to/freesurfer_license:/opt/freesurfer/license.txt \
    martinnoergaard/petprep_hmc:latest \
    --bids_dir /data/input --output_dir /data/output --analysis_level participant [--participant_label PARTICIPANT_LABEL]

This command mounts your local input and output directories, as well as the FreeSurfer license file, to the Docker container. The petprep_hmc script is then executed within the container, processing the input data and saving the results to the specified output directory.

singularity exec -e --bind license.txt:/opt/freesufer/license.txt docker://martinnoergaard/petprep_hmc:latest python3 /opt/petprep_hmc/run.py