-
Notifications
You must be signed in to change notification settings - Fork 1
Update spinal levels files generated by the University of Calgary's Phillips Lab based on the Mendez et al. paper #3
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
base: master
Are you sure you want to change the base?
Changes from 7 commits
9b7e3c0
b686796
ce64bdf
e854bba
d1520ca
6ad1a93
74cac59
b5a1870
bdfdd5f
1f588dc
2e5ee73
aacbfb3
93a9433
00b3c6c
d0b0099
6a2e221
558672a
8f6297f
5fe0d9a
80e8884
9d8e965
d5208ff
4b52a2b
95f796b
bb07efd
4bb585f
87d61b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| ### PAM50 Levels | ||
|
|
||
| These level files are a slightly modified copy of the [level files](https://github.com/PhillipsLab/pam50/tree/main/Spinal%20Cord%20Levels%20NIfTI) produced by the [Phillips Lab](https://github.com/PhillipsLab): | ||
joshuacwnewton marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Modifications include: | ||
|
|
||
| - Change data type from float64 to float32 | ||
| - Copy header from current PAM50/spinal_levels | ||
| - Rename files | ||
|
|
||
| To reproduce the modified files, please run `git checkout e854bbad9ab550fd93acabeaf43c97cf66b3a4e5`, then run the following script in your terminal: | ||
|
|
||
| ```bash | ||
| #!/bin/bash | ||
| # | ||
| # Process Phillips Lab PAM50 spinal levels to match existing PAM50 conventions. | ||
| # | ||
| # Usage: | ||
| # ./process_spinal_levels.sh | ||
| # 1. Clone https://github.com/spinalcordtoolbox/PAM50 | ||
| # 2. Checkout commit e854bbad9ab550fd93acabeaf43c97cf66b3a4e5 | ||
| # 3. Run inside /PAM50/spinal_levels_PhillipsLab/ | ||
| # Authors: Sandrine Bédard, Joshua Newton | ||
|
|
||
| set -x | ||
| # Immediately exit if error | ||
| set -e -o pipefail | ||
|
|
||
| # Exit if user presses CTRL+C (Linux) or CMD+C (OSX) | ||
| trap "echo Caught Keyboard Interrupt within script. Exiting now.; exit" INT | ||
|
|
||
| start=`date +%s` | ||
|
|
||
| # Add missing info to the `info_label.txt` file to account for newly-added levels | ||
| file_info_label=$(realpath "../spinal_levels/info_label.txt") | ||
| extra_spinal_levels="20, Spinal level L1, spinal_level_21.nii.gz | ||
| 21, Spinal level L2, spinal_level_22.nii.gz | ||
| 22, Spinal level L3, spinal_level_23.nii.gz | ||
| 23, Spinal level L4, spinal_level_24.nii.gz | ||
| 24, Spinal level L5, spinal_level_25.nii.gz" | ||
| if [[ $(tail -c 23 "$file_info_label") == "spinal_level_20.nii.gz" ]] | ||
| then | ||
| echo "$extra_spinal_levels" >> "$file_info_label" | ||
| fi | ||
|
|
||
| # Retrieve input params | ||
| PATH_IN=$PWD | ||
| PATH_OUT="$PATH_IN/spinal_levels_processed" | ||
| for FILE in *.nii.gz; do | ||
| file=${FILE/%".nii.gz"} | ||
| echo $file | ||
| mkdir -p $PATH_OUT/${file}_processed | ||
| rsync -avzh $FILE $PATH_OUT/${file}_processed | ||
| cd $PATH_OUT/${file}_processed | ||
| # Change file type | ||
| sct_image -i ${file}.nii.gz -type float32 -o ${file}_float32.nii.gz | ||
| file="${file}_float32" | ||
| # Copy header of SCT PAM50 template | ||
| sct_image -i $SCT_DIR/data/PAM50/spinal_levels/spinal_level_02.nii.gz -copy-header $file.nii.gz -o ${file}_header.nii.gz | ||
| file="${file}_header" | ||
joshuacwnewton marked this conversation as resolved.
Show resolved
Hide resolved
joshuacwnewton marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Rename the file to the filename corresponding to the level (specified by `info_label.txt`) | ||
| level=$(echo "$file" | cut -d '_' -f 3) | ||
| file_out=$(grep -F "$level," $file_info_label | cut -d "," -f 3) | ||
| cp $file.nii.gz $file_out | ||
| cd "$PATH_IN" | ||
| echo $PATH_IN | ||
| done | ||
|
|
||
| # Display useful info for the log | ||
| end=`date +%s` | ||
| runtime=$((end-start)) | ||
| echo | ||
| echo "~~~" | ||
| echo "SCT version: `sct_version`" | ||
| echo "Ran on: `uname -nsr`" | ||
| echo "Duration: $(($runtime / 3600))hrs $((($runtime / 60) % 60))min $(($runtime % 60))sec" | ||
| echo "~~~" | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Spinal levels labels - generated on 2016-11-28 | ||
| # Spinal levels labels - generated on 2023-02-13 | ||
| # Keyword=IndivLabels (Please DO NOT change this line) | ||
| # ID, name, file | ||
| 0, Spinal level C1, spinal_level_01.nii.gz | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blank C1 file
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The response from Aaron Phillips was as follows:
This partially answers the question, however we still need to decide whether or not we should remove the blank C1 file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
we definitely should. There is absolutely no point in having a 'label' file that contains only zeros. It is just confusing for everyone. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I'm in favor of removing the C1 file, as it would it help to avoid confusion such as this user on the forum: https://forum.spinalcordmri.org/t/c1-vertebral-level-labelling/1002/4?u=joshuacwnewton However, @jcohenadad has also promised that we would add coverage of the C1 vertebral level in https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/3997. So, is the idea that we would remove it just for this release, then re-add it once we have proper spinal level data? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong promise then 😅 , let's get rid of the file |
||
|
|
@@ -21,3 +21,8 @@ | |
| 17, Spinal level T10, spinal_level_18.nii.gz | ||
| 18, Spinal level T11, spinal_level_19.nii.gz | ||
| 19, Spinal level T12, spinal_level_20.nii.gz | ||
| 20, Spinal level L1, spinal_level_21.nii.gz | ||
| 21, Spinal level L2, spinal_level_22.nii.gz | ||
| 22, Spinal level L3, spinal_level_23.nii.gz | ||
| 23, Spinal level L4, spinal_level_24.nii.gz | ||
| 24, Spinal level L5, spinal_level_25.nii.gz | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sharp transition between level values (with no gradient/smoothness)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response from Aaron Phillips is as follows:
Email exchange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I don't understand from this diagram, is that the "mean" is not a single value in the absissa, but a range. I'm not sure how to interpret that... i'll answer in the email
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The email has been answered, and there has been some back and forth discussion as follows:
Email exchange
We are now waiting on a response from Aaron to confirm the methods used, and to potentially supply us with the raw data + processing code. Until then, I'm not sure if there is much we can do to proceed.