Skip to content

Conversation

@joshuacwnewton
Copy link
Member

@joshuacwnewton joshuacwnewton commented Nov 5, 2025

Context

In preparation for the upcoming SCT Course, we need to test all of the commands in the SCT Course slide deck.

My approach to testing the commands is to:

  1. Ensure that batch_single_subject.sh contains exactly the same commands as the SCT Course slide deck.
  2. Run the automated tests on the scripts to ensure everything passes.
  3. Manually look over the generated QC report and CSV files to make sure everything looks good and matches the visualizations in the slides.

PR description

To make "step 1" easier, this PR adds:

  • A new workflow that extracts the sct_ commands (from both the slides and the scripts) and compares them.
    • To get the commands from the slides, we just need to download the slide text.
    • Go to SCT Course -> File -> Download -> Plain text (.txt)
      image

@joshuacwnewton joshuacwnewton marked this pull request as draft November 5, 2025 18:15
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch from bf444c4 to de70c96 Compare November 5, 2025 18:27
@joshuacwnewton joshuacwnewton changed the title Update batch scripts to match SCT Course commands Update batch_single_subject.sh for the 2025 SCT Course Nov 18, 2025
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch 4 times, most recently from a3cc1fa to f6c9550 Compare November 19, 2025 15:04
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch from f6c9550 to 3a44440 Compare November 19, 2025 16:26
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch from 3a44440 to 53665c3 Compare November 19, 2025 16:31
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch from 2ed41f0 to bfe9286 Compare November 19, 2025 16:42
@joshuacwnewton joshuacwnewton self-assigned this Nov 19, 2025
Keeping the old syntax will be better for ensuring backwards compatibility with the course data .zips, since we package up the _gmseg and _wmseg files to be used in other tutorials.
CSV generation will fail due to missing labeled seg file.
@joshuacwnewton joshuacwnewton marked this pull request as ready for review November 20, 2025 15:54
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch from 9cc5975 to 1284fd9 Compare November 28, 2025 18:54
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch from 1284fd9 to 8719e48 Compare November 28, 2025 19:22
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch 2 times, most recently from b21d177 to 4edd73c Compare December 2, 2025 18:08
@joshuacwnewton joshuacwnewton force-pushed the jn/update-for-2025-sct-course branch from 4edd73c to 93cddf5 Compare December 2, 2025 18:21
Copy link
Member

@mguaypaq mguaypaq left a comment

Choose a reason for hiding this comment

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

Amazing work, thanks!

@joshuacwnewton joshuacwnewton merged commit 63e59c1 into master Dec 4, 2025
2 checks passed
@joshuacwnewton
Copy link
Member Author

I'll follow up by creating a new dataset release and updating the link in the SCT repo.

Comment on lines 147 to +151
# Register t2->template with modified parameters (advanced usage of `-param`)
sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -l t2_labels_vert.nii.gz -qc ~/qc_singleSubj -ofolder advanced_param -c t2 -param step=1,type=seg,algo=rigid:step=2,type=seg,metric=CC,algo=bsplinesyn,slicewise=1,iter=3:step=3,type=im,metric=CC,algo=syn,slicewise=1,iter=2
sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -ldisc t2_labels_vert.nii.gz -qc ~/qc_singleSubj -ofolder advanced_param -c t2 -param step=1,type=seg,algo=rigid:step=2,type=seg,metric=CC,algo=bsplinesyn,slicewise=1,iter=3:step=3,type=im,metric=CC,algo=syn,slicewise=1,iter=2

# Register t2->template with large FOV (e.g. C2-L1) using `-ldisc` option
# sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -ldisc t2_seg_labeled_discs.nii.gz -c t2
# sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -ldisc t2_totalspineseg_discs.nii.gz -c t2
Copy link
Member Author

Choose a reason for hiding this comment

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

Note to self re: spinalcordtoolbox/spinalcordtoolbox#5023 (comment): Not present in web tutorials? Add?

Copy link
Member Author

Choose a reason for hiding this comment

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

Update: No. (This corresponds to the -ldisc page that we removed from the course material due to duplication with the regular -ldisc, and so this should be removed, I think. Large FOVs are already covered by the "how many labels should I use" page?)

Comment on lines +440 to +442
# Compute aSCOR (Adapted Spinal Cord Occupation Ratio)
# i.e. Spinal cord to canal ratio using the canal seg
sct_compute_ascor -i-SC t2_seg.nii.gz -i-canal t2_canal_seg.nii.gz -perlevel 1 -o ascor.csv
Copy link
Member Author

Choose a reason for hiding this comment

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

Note to self re: spinalcordtoolbox/spinalcordtoolbox#5023 (comment): Not present in web tutorials? Add?

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