Skip to content

Conversation

valosekj
Copy link
Member

@valosekj valosekj commented Sep 29, 2025

Description

This PR aim is to update the script to the new sct v7.2 version. New metric computation were added: Spinal cord metrics (CSA, AP, RL), Canal metrics (CSA, AP, RL), Lesion metrics and aSCOR. Adapting to the new folder organization having different time points per individual, default is set as baseline (ses-M0).

How to test:

Test on sub-001 with default session.

sct_run_batch -path-data ~/datasets/dcm-zurich/ -path-out ~/process_results/dcm-zurich_kahina -script scripts/process_data_dcm-zurich.sh -jobs 1 -include sub-001

Version of SCT : git-master-1e16eb489497137b0f2ce52c08663e4accdb270f

Version of dcm_zurich dataset : 34a6393d74

TODO:

  • Jan: review the PR

@KahinaBch KahinaBch marked this pull request as ready for review October 1, 2025 17:59
@sandrinebedard
Copy link
Member

thanks @KahinaBch maybe put the following information in the body of the PR instead of just commenting!

This PR aim is to update the script to the new sct v7.2 version. New metric computation were added: Spinal cord metrics (CSA, AP, RL), Canal metrics (CSA, AP, RL), Lesion metrics and aSCOR. To be tested using dcm_zurich data.

You could also add what command to run to test it out.

Here is an example of a PR body: spinalcordtoolbox/spinalcordtoolbox#4948
(look at description, how to test, linked issue sections)

@sct-pipeline sct-pipeline deleted a comment from KahinaBch Oct 1, 2025
@KahinaBch KahinaBch self-assigned this Oct 1, 2025
Copy link
Member

@sandrinebedard sandrinebedard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the PR running the command on the updated version of dcm-zurich:

sct_run_batch -path-data ~/datasets/dcm-zurich/ -path-out ~/process_results/dcm-zurich_kahina -script scripts/process_data_dcm-zurich.sh -jobs 1 -include sub-001

And got the following error:

1/ses-M0_*T2w.*' .
sending incremental file list
rsync: [sender] link_stat "/home/GRAMES.POLYMTL.CA/sebeda/datasets/dcm-zurich/sub-001/ses-M0/anat/sub-001/ses-M0_*T2w.*" failed: No such file or directory (2)

sent 19 bytes  received 12 bytes  62.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
Error: Processing of subject sub-001 failed

I think is because we did not have session in the previous version of dcm-zurich, on what version is the script for?

@sandrinebedard sandrinebedard self-requested a review October 1, 2025 19:25
Copy link
Member

@sandrinebedard sandrinebedard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for these updates @KahinaBch ! I left some small comments,

We could also consider computing the compression metrics on the spinal canal too (sct_compute_compression)

# Note: Updated to use sct_label_vertebrae -discfile instead of deprecated sct_label_utils -disc
# Context: https://github.com/spinalcordtoolbox/spinalcordtoolbox/pull/4072
sct_label_utils -i ${file_t2_ax_seg}.nii.gz -disc ${file_t2_ax_labels}.nii.gz -o ${file_t2_ax_seg}_labeled.nii.gz
sct_label_vertebrae -i ${file_t2_ax}.nii.gz -s ${file_t2_ax_seg}.nii.gz -discfile ${file_t2_ax_labels}.nii.gz -c t2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migth also be worth testing using totalspineseg directly on the axial image and compare results!


# Check if vertebral-level metrics CSV already exists to avoid reprocessing
# WOUld this name be the standard name for vertebral-level metrics CSV?
vertebral_metrics_csv="${PATH_RESULTS}/vertebral_level_metrics.csv"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this variable is never used

@KahinaBch
Copy link

thanks @KahinaBch maybe put the following information in the body of the PR instead of just commenting!

This PR aim is to update the script to the new sct v7.2 version. New metric computation were added: Spinal cord metrics (CSA, AP, RL), Canal metrics (CSA, AP, RL), Lesion metrics and aSCOR. To be tested using dcm_zurich data.

You could also add what command to run to test it out.

Here is an example of a PR body: spinalcordtoolbox/spinalcordtoolbox#4948 (look at description, how to test, linked issue sections)

I just committed a new version that should take new folder format into consideration. The default option is baseline and it should be able to consider a specified timepoints when passed as argument.

@sandrinebedard
Copy link
Member

@KahinaBch I just retested the PR on SCT 7.0, and the argument discfile doesn't exist for sct_process_segmentation, is it 7.1 that your script is up-to-date?

I would suggest to describe exactly how to test the script with following details in the PR body:

  • What branch
  • Command to run
  • Which SCT version
  • What version of the dataset to use

It would make it easier and making sure I am testing the right thing 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants