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

Prototype of processing pipeline #3

Open
2 of 5 tasks
jcohenadad opened this issue Nov 13, 2024 · 6 comments
Open
2 of 5 tasks

Prototype of processing pipeline #3

jcohenadad opened this issue Nov 13, 2024 · 6 comments

Comments

@jcohenadad
Copy link
Member

jcohenadad commented Nov 13, 2024

Let's get started with the dummy dataset #1

subsequent issues:

  • - segment lesion
  • - normalize CSA with PAM50 (see work of Sandrine and Jan)
  • - replace vertebral labeling with TotalSpineSeg
  • - compute lesion occupancy within lateral CST
  • - define strategy to compute local atrophy at lesion levels (consider other metrics than CSA)
@plbenveniste
Copy link
Collaborator

I investigated the detection of local atrophy in the spinal cord on the data that we have received. I was planning on using the following method:

  • if locally the CSA or the R-L diameter is less than 80% of the above and lower vertebral level, then there is local atrophy.

However, as we can see on the figure below, because there is quite a lot of variability of both the CSA and the R-L diameter, this method wouldn't work.

plot1
plot2

Moving on, atrophy should be detected by measuring deviance between the subject CSA and/or R-L diameter and average CSA or R-L diameter of a population.
Some questions emerge from this:

  • Do we have a template/atlas of the evolution of the CSA and/or R-L diameter?
  • If not, we should build one. Should we use the data given in this project in order to work on the same contrast ?
  • Should we differentiate men and women ?

Maybe these questions could be raised during next meeting.

@jcohenadad
Copy link
Member Author

jcohenadad commented Nov 26, 2024

Moving on, atrophy should be detected by measuring deviance between the subject CSA and/or R-L diameter and average CSA or R-L diameter of a population.
Some questions emerge from this:
Do we have a template/atlas of the evolution of the CSA and/or R-L diameter?

Hence my comment above "see work of Sandrine and Jan" 😉 have a chat with @valosekj @sandrinebedard, they can show you how

EDIT 20241125_211019: Ah! It seems like you are already aware:

-perslice 1 -o "${PATH_RESULTS}"/"${SUBJECT}"_CSA.csv -append 1 -normalize-PAM50 1

@valosekj
Copy link
Member

Nice figures, @plbenveniste. Just fyi, if you need to show both PAM50 slices and vert levels on a single x-axis, you could use this script, or its parts. It generates the following figure:

image

The figure shows single-subject morphometrics for two sessions. Together with normative values computed from spine-generic (see this repo for one CSV file for each subject from the spine-generic dataset). The normative values can be filtered by sex.


what is the ref for the method you mentioned?

if locally the CSA or the R-L diameter is less than 80% of the above and lower vertebral level, then there is local atrophy.

@plbenveniste
Copy link
Collaborator

Thanks for your comment @valosekj. If I understand correctly, you don't have an average CSV file of the entire cohort. You only have one CSV file per subject.
So if I were to use your data, I would have to get all CSV files, average the CSA or R-L diameter per sex so that I could use it as a standard reference. Is that correct ?

what is the ref for the method you mentioned?

No method in particular, just my idea of how to solve this. It proved to be a failure.

@sandrinebedard
Copy link
Member

So if I were to use your data, I would have to get all CSV files, average the CSA or R-L diameter per sex so that I could use it as a standard reference. Is that correct ?

yes, we provide it per subject, to allow custom filtering (like per sex),

this is what we use in sct_compute_compression -normalize-hc 1 (https://spinalcordtoolbox.com/stable/user_section/command-line/sct_compute_compression.html)

@valosekj
Copy link
Member

So if I were to use your data, I would have to get all CSV files,

"all CSV files" from the PAM50-normalized-metrics are automatically downloaded during SCT installation (to $SCT_DIR/data/PAM50_normalized_metrics folder) because we use them for sct_compute_compression as mentioned by Sandrine.
You can load all the CSV files into a single dataframe using this function.

average the CSA or R-L diameter per sex so that I could use it as a standard reference. Is that correct ?

Once you load all the CSV files into a single dataframe, you can plot them as mean and std directly using sns.lineplot errorbar='sd', see this line. i.e., no need to average them manually

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

No branches or pull requests

4 participants