APRL
The APRL pipeline (Automated Detection of Paramagnetic Rim Lesion) integrates an automated technique for paramagnetic rim lesion (PRL) detection, developed by Dr. Carolyn Lou. It provides processed T1-weighted, T2-FLAIR, and T2star-phase images, as well as white matter lesion masks and the probability of each lesion being a PRL. (The current pipeline uses a pre-trained MIMoSA model and APRL model).
Usage
This pipeline contains three stages: 1) Preprocessing: processes MRI images to prepare for PRL probability calculation, 2) PRL Probability Calculation: calculates the probability of each lesion being a PRL, and 3) Consolidation: consolidates all participants' PRL results.
Because MIMoSA, ACVS, and APRL follow similar preprocessing steps, their outputs are stored in the same directories. To avoid overwriting files when running any combination of these pipelines on the same data, each pipeline will create only files that were not generated by a previously run pipeline.
This pipeline can be run with or without a container. For containerized usage, Singularity can be used on a cluster or Docker locally. This pipeline can be run in individual or batch mode, meaning you can specify a certain subject and session or run the pipeline for all subjects in the folder, respectively.
These examples will run the pipeline in batch mode on the cluster. To run individually or locally/with a container, set --mode individual, or -c local/-c singularity/-c docker, respectively. Only Steps 1 and 2 have the option of individual or batch; Step 3 will always run in batch mode.
Step 1. Preprocessing
This step processes raw T1, T2-FLAIR, and T2star-phase images to prepare for PRL probability calculation. By default, it runs bias correction, HD-BET skullstripping, registration to FLAIR space, WhiteStripe normalization, MIMoSA, registration to EPI space, lesion dilation, and splitting and labeling of confluent lesions.
Required flags:
-m or --mainpath: path to parent data folder
-t or --t1: T1 sequence name
-f or --flair: FLAIR sequence name
--phase: unwrapped EPI-phase sequence name
--toolpath: path to pipeline folder
Other flags:
-p or --participant: participant ID (only needed for individual mode)
--ses: session ID (only needed for individual mode)
-n or --n4: run N4 bias correction. Default is TRUE
-s or --skullstripping: run skullstripping. Default is TRUE
--stype: skullstripping method: hdbet, fslbet. Default is hdbet
-r or --registration: run registration. Default is TRUE
-w or --whitestripe: run WhiteStripe normalization. Default is TRUE
--mimosa: run MIMoSA segmentation. Default is TRUE
--threshold: threshold for generating MIMoSA mask. Default is 0.2
--dilation: dilate lesion. Default is TRUE
--step: step of pipeline - preparation, PRL_run, consolidation. Default is preparation
--mode: run pipeline individually or batch. Default is batch
-c or --container: which container to use: singularity, docker, local, cluster. Default is cluster
--sinpath: path to singularity image (only needed if using singularity container - don't need to specify if using takim cluster)
--dockerpath: path to docker image (only needed if using docker container)
-h or --help: show help message
bash /path/to/PennSIVE_neuro_pip/pipelines/PRL/code/bash/PRL -m /path/to/data -t "*T1w*.nii.gz" -f "*FLAIR*.nii.gz" --phase "*UNWRAPPED*.nii.gz" --toolpath /path/to/PennSIVE_neuro_pip
Step 2. PRL Probability Calculation
This step calculates the probability of each lesion being a PRL from the preprocessed images.
Required flags:
-m or --mainpath: path to parent data folder
--step: step of pipeline - preparation, PRL_run, consolidation. Default is preparation. This step is PRL_run
--toolpath: path to pipeline folder
Other flags:
-p or --participant: participant ID (only needed for individual mode)
--ses: session ID (only needed for individual mode)
--mode: run pipeline individually or batch. Default is batch
-c or --container: which container to use: singularity, docker, local, cluster. Default is cluster
--sinpath: path to singularity image (only needed if using singularity container - don't need to specify if using takim cluster)
--dockerpath: path to docker image (only needed if using docker container)
-h or --help: show help message
bash /path/to/PennSIVE_neuro_pip/pipelines/PRL/code/bash/PRL.sh -m /path/to/data --step PRL_run --toolpath /path/to/PennSIVE_neuro_pip
Step 3. Consolidation
This step consolidates the PRL results for all participants and sessions.
Required flags:
-m or --mainpath: path to parent data folder
--step: step of pipeline - preparation, PRL_run, consolidation. Default is preparation. This step is consolidation
--toolpath: path to pipeline folder
Other flags:
-c or --container: which container to use: singularity, docker, local, cluster. Default is cluster
--sinpath: path to singularity image (only needed if using singularity container - don't need to specify if using takim cluster)
--dockerpath: path to docker image (only needed if using docker container)
-h or --help: show help message
bash /path/to/PennSIVE_neuro_pip/pipelines/PRL/code/bash/PRL.sh -m /path/to/data --step consolidation --toolpath /path/to/PennSIVE_neuro_pip