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

Add lumbar data and steps from future lumbar registration tutorial #17

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions single_subject/batch_single_subject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,37 @@ sct_compute_compression -i t2_compressed_seg.nii.gz -vertfile t2_compressed_seg_



# Registering lumbar data to the PAM50 template
# ======================================================================================================================
cd ../t2_lumbar

# Crop full-body image to isolate the lumbar region (lowest 200 axial slices)
sct_crop_image -i t2.nii.gz -zmax 200

# Use lumbar-specific `sct_deepseg` model to segment the spinal cord
sct_deepseg -i t2_crop.nii.gz -task seg_lumbar_sc_t2w


# Generate labels for the 2 spinal cord landmarks: cauda equinea ('99') and T9-T10 disc ('17')
# Note: Normally this would be done manually using fsleyes' "Edit mode -> Create mask" functionality. (Uncomment below)
#
# fsleyes t2.nii.gz &
#
# However, since this is an automated script with example data, we will place the labels at known locations for the
# sake of reproducing the results in the tutorial.
sct_label_utils -i t2_crop.nii.gz -create 27,80,80,60 -o t2_crop_label.nii.gz
sct_label_utils -i t2_crop_label.nii.gz -create-add 27,76,187,17 -o t2_crop_label.nii.gz

# Register the image to the template using segmentation and labels
# TODO: Uncomment when https://github.com/spinalcordtoolbox/PAM50/pull/27 gets merged and a new PAM50 release is made.
#sct_register_to_template -i t2_crop.nii.gz \
# -s t2_crop_seg.nii.gz \
# -ldisc t2_crop_label.nii.gz \
# -c t2 -qc qc \
# -param step=1,type=seg,algo=centermassrot:step=2,type=seg,algo=bsplinesyn,metric=MeanSquares,iter=3,slicewise=0:step=3,type=im,algo=syn,metric=CC,iter=3,slicewise=0
Comment on lines +170 to +176
Copy link
Member Author

@joshuacwnewton joshuacwnewton Oct 10, 2023

Choose a reason for hiding this comment

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

Note: The actual registration step causes an error, because the PAM50 release used in SCT's master branch does not yet have the cauda equinea label (60), see:

So it has been commented out for now. (Thankfully, this command is not strictly necessary in order for this PR to be merged, since none of the generated files need to be packaged up.)




# Registering additional MT data to the PAM50 template
# ======================================================================================================================

Expand Down
Binary file added single_subject/data/t2_lumbar/t2.nii.gz
Binary file not shown.
1 change: 1 addition & 0 deletions tutorial-datasets.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ data_vertebral-labeling,single_subject/data/t2/t2_seg.nii.gz
data_template-registration,single_subject/data/t2/t2.nii.gz
data_template-registration,single_subject/data/t2/t2_seg.nii.gz
data_template-registration,single_subject/data/t2/t2_labels_vert.nii.gz
data_lumbar-registration,single_subject/data/t2_lumbar/t2.nii.gz
data_shape-metric-computation,single_subject/data/t2/t2_seg.nii.gz
data_shape-metric-computation,single_subject/data/t2/label/template/PAM50_levels.nii.gz
data_compression,single_subject/data/t2_compression/t2_compressed.nii.gz
Expand Down
Loading