ivadomed / model-spinal-rootlets

Deep-learning based segmentation of the spinal nerve rootlets
5 stars 2 forks source link

Compare spinal level prediction with articles (Cadotte et al 2015) #10

Open tzebre opened 1 year ago

tzebre commented 1 year ago

To evaluate the model I had the idea to predict spinal level from the nerve segmentation and compare it to the value of Cadotte et al, 2015. The final goal is to reproduce with the same subject this graph:

Capture d’écran 2023-07-31 à 18 30 22

For the moment I only compute the length between the most rostral and caudal rootlets.

To do this first I dilate the SC segmentation by 2 with sct_maths -i XXX -o XXX -dilate 2. After I get the intersection voxel between the rootlet segmentation and the dilated SC. Finally, I create an SC mask with an estimated spinal level and compute its length.

I have made different scripts to do this :

Thanks to this script I have created different visualization.

Cadotte et al values :

Comparison of spinal level from model prediction vs manual labeling vs distribution with the Cadotte et al, 2015 mean and std

Capture d’écran 2023-07-31 à 18 44 35

Predicted spinal level length:

Capture d’écran 2023-07-31 à 18 54 41

Comparison of spinal level prediction on spine-generic vs distribution with the Cadotte et al, 2015 mean and std

Capture d’écran 2023-07-31 à 18 48 14

Predicted spinal level length:

Capture d’écran 2023-07-31 à 18 48 51

Discussion

Some SC segmentation failed during the process, and the resulting spinal level prediction failed. One solution can be to use manually corrected SC segmentation. Spinal level lengths are under-estimated, one of the solutions can be to dilate 3 instead of 2. But this solution is possibly going to shift the prediction along the SC.

TODO

tzebre commented 1 year ago
Capture d’écran 2023-07-31 à 18 48 14

New version of the notebook to produce graph : plot_distance.ipynb

Plot without faking a distribution from Cadotte (dot = mean, line = std):

Capture d’écran 2023-08-08 à 18 13 03

I have also kept a version with all subjects on the graph because it can help identify outliers :

Capture d’écran 2023-08-08 à 18 15 10
jcohenadad commented 1 year ago

@tzebre instead of comparing the mean across subjects, why don't you compare subject-wise? Eg: you plot the location from PMJ (and/or length) as a difference between predicted and cadotte, for each subject.

tzebre commented 1 year ago

@tzebre instead of comparing the mean across subjects, why don't you compare subject-wise? Eg: you plot the location from PMJ (and/or length) as a difference between predicted and cadotte, for each subject.

Yes, that was the initial plan. However, I started creating these graphs before obtaining the Cadotte images. Later, I tried using the Cadotte images, but the model's predictions for these images turned out to be inaccurate #11.

My current plan involves manually correcting some of the Cadotte predictions and then comparing my results (nerve segmentation to spinal level conversion script) with the values presented in the article. The objective is to validate the methodology used for the conversion.