spinalcordtoolbox / manual-correction

Scripts for the manual correction of spinal cord labels
MIT License
4 stars 0 forks source link

Manual correction

This repository contains scripts for the manual correction of spinal cord labels.

Currently supported labels are:

[!NOTE] We greatly appreciate feedback and suggestions for improvement. Feel free to open an issue and report bugs, suggest new features or ask questions.

Table of content

1. Dependencies

2. Installation

Download the repository:

git clone https://github.com/spinalcordtoolbox/manual-correction.git
cd manual-correction

Create a virtual environment and install the required packages:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Alternatively, you can use existing SCT's conda environment:

source ${SCT_DIR}/python/etc/profile.d/conda.sh
conda activate venv_sct

3. Usage

[!Important] All scripts currently assume BIDS-compliant data. For more information about the BIDS standard, please visit http://bids.neuroimaging.io.


manual_correction.py

This script loops across subjects listed in the YAML file and opens a viewer to correct the labels (segmentations, disc labels, etc.).

python manual_correction.py -path-img <INPUT_PATH> -config <CONFIG_FILE>

For full help, please run: python manual_correction.py -h.


package_for_correction.py

If the manual correction is done by someone else than the person doing the processing, this script packages the processed images and existing labels (segmentation, disc labels, etc.) and creates a single ZIP file that can conveniently be sent to collaborators.

python package_for_correction.py -path-in <INPUT_PATH> -config <CONFIG_FILE>

For full help, please run: python package_for_correction.py -h.


copy_files_to_derivatives.py

This script copies manually corrected labels (segmentations, disc labels, etc.) from your local derivatives/labels folder to the already existing dataset's derivatives/labels folder.

python copy_files_to_derivatives.py -path-in <INPUT_PATH> -path-out <OUTPUT_PATH>

For full help, please run: python copy_files_to_derivatives.py -h.

4. Examples

See wiki