sct-pipeline / csa-atrophy

Evaluate the sensitivity of atrophy detection with SCT
https://csa-atrophy.readthedocs.io/
MIT License
1 stars 0 forks source link

csa-atrophy

csa-atrophy

Evaluate the sensitivity of atrophy detection with SCT. The algorithm works as follows:

How to run

This code has been tested using Python 3.7.

Download (or git clone) this repository:

git clone https://github.com/sct-pipeline/csa-atrophy.git
cd csa-atrophy

Installation: csa-atrophy requires specific python packages for computing statistics and processing images. If not already present on the computer's python environment such packages will automatically be installed by running pip command:

pip install -e .

Download the Spine Generic Multi-Subject dataset.

Edit the file config_sct_run_batch.yml according to your setup. Notable flags include:

See sct_run_batch -h to look at the available options.

Run the analysis:

sct_run_batch -config config_sct_run_batch.yml

:note: desired subjects using flag -include and in parallel processing using flag -jobs.

To output statistics, run in Dataset

csa_rescale_stat -i csa_atrophy_results/results -o csa_atrophy_results -config config_script.yml -fig

Quality Control

After running the analysis, check your Quality Control (QC) report by opening the file qc/index.html. Use the “Search” feature of the QC report to quickly jump to segmentations or labeling results. If you spot issues (wrong labeling), add their filenames in the 'config_correction.yml' file (see https://spine-generic.rtfd.io/en/latest/analysis-pipeline.html for further indications). Then, manually create labels in the cord at the level of inter-vertebral discs C1-C2, C2-C3, ..., C4-C5 with the command:

manual_correction -config config_correction.yml -path-in csa_atrophy_results/data_processed -path-out PATH_DATA

The bash script outputs all manual labelings to the derivatives directory in the dataset path defined in path_data. It is now possible to re-run the whole process. With the command below labeling will use the manual corrections that are present in the derivatives/ folder of the dataset, otherwise labeling will be done automatically.

sct_run_batch -config config_sct_run_batch.yml

Statistics

After everything is done, compute stats: Per-subject stat: Panda dataframe df_sub:

Across-subject stats: Panda dataframe df_rescale

Power analysis:

Plot results: