Skip to content

Commit 6d84971

Browse files
Add data and commands for sct_compute_compression tutorial (#16)
* Add new file: `t2_compressed.nii.gz` * `batch_single_subject.sh`: Update with compression metric steps * tutorial-datasets.csv: Update with compression data
1 parent ede52e5 commit 6d84971

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

single_subject/batch_single_subject.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,30 @@ sct_detect_pmj -i t2.nii.gz -c t2 -qc ~/qc_singleSubj
122122
sct_process_segmentation -i t2_seg.nii.gz -pmj t2_pmj.nii.gz -pmj-distance 64 -pmj-extent 30 -o csa_pmj.csv -qc ~/qc_singleSubj -qc-image t2.nii.gz
123123

124124

125+
126+
127+
# Computing normalized shape metrics for compressed data
128+
# ======================================================================================================================
129+
cd ../t2_compression
130+
# Segment the spinal cord of the compressed spine
131+
sct_deepseg_sc -i t2_compressed.nii.gz -c t2 -qc ~/qc_singleSubj
132+
# Label the vertebrae using the compressed spinal cord segmentation
133+
sct_label_vertebrae -i t2_compressed.nii.gz -s t2_compressed_seg.nii.gz -c t2 -qc ~/qc_singleSubj
134+
# Generate labels for each spinal cord compression site.
135+
# Note: Normally this would be done manually using fsleyes' "Edit mode -> Create mask" functionality. (Uncomment below)
136+
#
137+
# fsleyes t2_compressed.nii.gz &
138+
#
139+
# However, since this is an automated script with example data, we will place the labels at known locations for the
140+
# sake of reproducing the results in the tutorial.
141+
sct_label_utils -i t2_compressed.nii.gz -create 30,152,99,1.0:30,156,118,1.0:30,157,140,1.0:31,160,159,1.0 -o t2_compressed_labels-compression.nii.gz
142+
# Compute ratio between AP-diameter at level of compression vs. above/below
143+
sct_compute_compression -i t2_compressed_seg.nii.gz -vertfile t2_compressed_seg_labeled.nii.gz -l t2_compressed_labels-compression.nii.gz -metric diameter_AP -normalize-hc 0 -o ap_ratio.csv
144+
# Compute ratio of AP diameter, normalized with healthy controls using `-normalize-hc 1`.
145+
sct_compute_compression -i t2_compressed_seg.nii.gz -vertfile t2_compressed_seg_labeled.nii.gz -l t2_compressed_labels-compression.nii.gz -metric diameter_AP -normalize-hc 1 -o ap_ratio_norm_PAM50.csv
146+
147+
148+
125149
# Registering additional MT data to the PAM50 template
126150
# ======================================================================================================================
127151

15 MB
Binary file not shown.

tutorial-datasets.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ data_template-registration,single_subject/data/t2/t2_seg.nii.gz
77
data_template-registration,single_subject/data/t2/t2_labels_vert.nii.gz
88
data_shape-metric-computation,single_subject/data/t2/t2_seg.nii.gz
99
data_shape-metric-computation,single_subject/data/t2/label/template/PAM50_levels.nii.gz
10+
data_compression,single_subject/data/t2_compression/t2_compressed.nii.gz
11+
data_normalizing-morphometrics-compression,single_subject/data/t2_compression/t2_compressed_seg.nii.gz
12+
data_normalizing-morphometrics-compression,single_subject/data/t2_compression/t2_compressed_seg_labeled.nii.gz
13+
data_normalizing-morphometrics-compression,single_subject/data/t2_compression/t2_compressed_labels-compression.nii.gz
1014
data_coregistration,single_subject/data/t2/warp_template2anat.nii.gz
1115
data_coregistration,single_subject/data/mt/mt1.nii.gz
1216
data_mtr-computation,single_subject/data/mt/mt0.nii.gz

0 commit comments

Comments
 (0)