sct-pipeline / contrast-agnostic-softseg-spinalcord

Contrast-agnostic spinal cord segmentation project with softseg
MIT License
4 stars 3 forks source link

Compute CSA on GT and output prediction mask #23

Closed sandrinebedard closed 11 months ago

sandrinebedard commented 2 years ago

Context

We want to compute CSA on the GT (hard and soft labels) in order to get the initial variability and also on the output prediction mask. In order to do so, we need also need the discs labels to compute CSA at the same levels on all contrast. Therefore, vertebral levels need to be identified on an anatomical image (T1w or T2w) and propagated on the other contrasts. Since we have the warping fields of all contrast to T2w, it is possible.

Proposed method:

For CSA on GT, in process_data.sh

For CSA on prediction mask (create a new processing script to compute CSA):

naga-karthik commented 1 year ago

@sandrinebedard any updates on this?

Currently, in the plots I am generating, I am using the .csv files found in the results folder of the data_processed_clean folder. BUT, the issue is that these csv files contain the CSAs for all the subjects and we're plotting it along with the model prediction CSAs which only contain subjects from the test set. Basically, it is not an apples-to-apples comparison.

Do you have any suggestion on how we can generate the GT csv data only for the subjects in the test set?

valosekj commented 1 year ago

Maybe we could load all CSV files (the ones with all the subjects and the ones containing only subjects from the test set) as Pandas DataFrames, and we could use test subjects to filter out subjects from all the subjects.

sandrinebedard commented 1 year ago

I would go with @valosekj's suggestion, to do the filetring inside the script

naga-karthik commented 11 months ago

Seems like this has also been completed since we now have plots with CSA on the GT segmentations. @sandrinebedard could you please link to script or part of the code where this is computed now? Thanks!

sandrinebedard commented 11 months ago

Is done in https://github.com/sct-pipeline/contrast-agnostic-softseg-spinalcord/blob/e4171e8ce39bafbb592f1263481107071f8bf3e8/csa_generate_figures/analyse_csa_all_models.py#L295-L297