Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update batch_single_subject.sh and process_data.sh to match changes to 2024 SCT Course Slides #25

Merged
merged 41 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
614f2a8
`batch_single_subject.sh`: `sct_deepseg_sc` -> `sct_deepseg`
joshuacwnewton Nov 26, 2024
3d98151
`batch_single_subject.sh`: Move `sct_label_utils` to registration sec…
joshuacwnewton Nov 26, 2024
fdaf976
`batch_single_subject.sh`: Move new features to end of script
joshuacwnewton Nov 26, 2024
ad7880c
`batch_single_subject.sh`: Add missing `-normalize-PAM50` command
joshuacwnewton Nov 26, 2024
3989683
`batch_single_subject.sh`: Update Compression title
joshuacwnewton Nov 26, 2024
51ab7ac
`batch_single_subject.sh`: Add missing registration commands
joshuacwnewton Nov 26, 2024
78e10b1
`batch_single_subject.sh`: Replace `sct_deepseg_sc` with contrast agn…
joshuacwnewton Nov 26, 2024
d9bab73
`batch_single_subject.sh`: Remove algo=dl section (no longer in course)
joshuacwnewton Nov 26, 2024
70e1482
`batch_single_subject.sh`: Fix GM-informed MT1 reg comments
joshuacwnewton Nov 26, 2024
3c7323d
`batch_single_subject.sh`: Add missing `sct_analyze_lesion -f` command
joshuacwnewton Nov 26, 2024
04234a8
`batch_single_subject.sh`: Add missing totalspineseg command
joshuacwnewton Nov 26, 2024
4e9553a
`batch_single_subject.sh`: Add missing MS lesion commands
joshuacwnewton Nov 26, 2024
576828a
`batch_single_subject.sh`: Add missing canal seg command
joshuacwnewton Nov 26, 2024
dea569b
`batch_single_subject.sh`: Comment out -f command (needs reg)
joshuacwnewton Nov 26, 2024
bb812ed
`process_data.sh`: Replace `sct_deepseg_sc` with `sct_deepseg`
joshuacwnewton Nov 27, 2024
abbc08d
`batch_single_subject.sh`: Apply rewording suggestions for comments
joshuacwnewton Nov 28, 2024
9ade09f
`batch_single_subject.sh`: `t2_seg.nii.gz` -> `t2_rootlets.nii.gz`
joshuacwnewton Nov 28, 2024
7708ee2
Added missing `-vertfile` flag
SomeoneInParticular Nov 28, 2024
3ecf314
batch_single_subject.sh; updated lumbar-specific label_utils target p…
SomeoneInParticular Nov 28, 2024
73e874c
batch_single_subject.sh: Removed '-f cylinder' which is no longer use…
SomeoneInParticular Nov 28, 2024
a6d684c
batch_single_subject.sh: Added missing second-pass segmentation using…
SomeoneInParticular Nov 28, 2024
ce7466d
`process_data.sh`: Preserve `-p sct_deepseg_sc`
joshuacwnewton Nov 29, 2024
1a104c4
`process_data.sh`: Remove now-unneeded `contrast` argument
joshuacwnewton Nov 29, 2024
d54a612
`batch_single_subject.sh`: Remove rootlets/lesion sections
joshuacwnewton Nov 29, 2024
ee5d8dd
`batch_single_subject.sh`: Fix `-qc qc` -> `-qc ~/qc_singleSubj`
joshuacwnewton Nov 29, 2024
4034ad1
`batch_single_subject.sh`: Add missing `-qc ~/qc_singleSubj`
joshuacwnewton Nov 29, 2024
255ecf4
`batch_single_subject.sh`: Update "test" command to match slides
joshuacwnewton Dec 6, 2024
35acbd6
`batch_single_subject.sh`: Update section titles
joshuacwnewton Dec 6, 2024
0ade35a
`batch_single_subject.sh`: Compress lumbar reg command to 1 line
joshuacwnewton Dec 6, 2024
fba69f5
`batch_single_subject.sh`: Update `-sub` command to use `-thr 0`
joshuacwnewton Dec 6, 2024
4893e6f
`batch_single_subject.sh`: Update dmri/fmri reg to use T2 warps
joshuacwnewton Dec 6, 2024
07bd03d
`batch_single_subject.sh`: Add TSNR QC commands
joshuacwnewton Dec 6, 2024
953db59
`batch_single_subject.sh`: Move lesion analysis after MS seg
joshuacwnewton Dec 6, 2024
c286c24
`batch_single_subject.sh`: Reorder the "new features" section
joshuacwnewton Dec 6, 2024
23da235
`run_batch_script.yml`: Temporarily allow warnings
joshuacwnewton Dec 6, 2024
f0370b9
`batch_single_subject.sh`: Revert fMRI back to PAM50_t2.nii.gz
joshuacwnewton Dec 7, 2024
0897e68
`batch_single_subject.sh`: Change script version to v6.5
joshuacwnewton Dec 7, 2024
feff833
`data_multi_subject.sh`: Add note about commented-out commands
joshuacwnewton Dec 7, 2024
263189b
`run_batch_script.yml`: Split error checking into multiple steps
joshuacwnewton Dec 7, 2024
81d0f6a
`run_batch_script.yml`: Fix `grep` checks by adding `!`
joshuacwnewton Dec 7, 2024
0338ba6
`batch_single_subject.sh`: Add missing qc commands to lumbar sec.
joshuacwnewton Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/workflows/run_batch_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,26 @@ jobs:
fi
done

- name: Check that script executed without error
- name: Check results (no error logs)
if: always()
run: |
cd "${{ github.event.repository.name }}/multi_subject/output/log"
[ "$(compgen -G "process_data_sub-0*.log")" ] # Log files should exist

- name: Check results (no error logs)
if: always()
run: |
cd "${{ github.event.repository.name }}/multi_subject/output/log"
[ ! "$(compgen -G "err.process_data_sub-0*.log")" ] # Error files should NOT exist
grep -iF "warning" process_data_sub-01.log
grep -iF "error" process_data_sub-01.log

- name: Check results (warnings in log)
if: always()
run: |
cd "${{ github.event.repository.name }}/multi_subject/output/log"
# ! grep -iF "warning" process_data_sub-01.log

- name: Check results (errors in log)
if: always()
run: |
cd "${{ github.event.repository.name }}/multi_subject/output/log"
! grep -iF "error" process_data_sub-01.log
11 changes: 5 additions & 6 deletions multi_subject/process_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ segment_if_does_not_exist() {
# This allows you to add manual segmentations on a subject-by-subject basis without disrupting the pipeline.
###
local file="${1}"
local contrast="${2}"
# Update global variable with segmentation file name
FILESEG="${file}"_seg
FILESEGMANUAL="${PATH_DATA}"/derivatives/labels/"${SUBJECT}"/anat/"${FILESEG}".nii.gz
Expand All @@ -84,7 +83,7 @@ segment_if_does_not_exist() {
else
echo "Not found. Proceeding with automatic segmentation."
# Segment spinal cord
sct_deepseg_sc -i "${file}".nii.gz -c "${contrast}" -qc "${PATH_QC}" -qc-subject "${SUBJECT}"
sct_deepseg -task seg_sc_contrast_agnostic -i "${file}".nii.gz -qc "${PATH_QC}" -qc-subject "${SUBJECT}"
fi
}

Expand All @@ -111,8 +110,8 @@ rsync -avzh "${PATH_DATA}"/"${SUBJECT}" .
# ======================================================================================================================
cd "${SUBJECT}"/anat/
file_t2="${SUBJECT}"_T2w
# Segment spinal cord (only if it does not exist)
segment_if_does_not_exist "${file_t2}" "t2"
# Segment spinal cord (only if it does not exist) using contrast-agnostic model
segment_if_does_not_exist "${file_t2}"
file_t2_seg="${FILESEG}"
# Create labels in the cord at C2 and C5 mid-vertebral levels (only if it does not exist)
label_if_does_not_exist "${file_t2}" "${file_t2_seg}"
Expand All @@ -132,8 +131,8 @@ sct_process_segmentation -i "${file_t2_seg}".nii.gz -vert 2:3 -vertfile label_T2
# ======================================================================================================================
file_mt1="${SUBJECT}"_acq-MTon_MTS
file_mt0="${SUBJECT}"_acq-MToff_MTS
# Segment spinal cord
segment_if_does_not_exist "${file_mt1}" "t2s"
# Segment spinal cord using contrast-agnostic model
segment_if_does_not_exist "${file_mt1}"
file_mt1_seg="${FILESEG}"
# Create mask
sct_create_mask -i "${file_mt1}".nii.gz -p centerline,"${file_mt1_seg}".nii.gz -size 45mm
Expand Down
Loading
Loading