ivadomed / model_seg_mouse-sc_wm-gm_t1

White and grey matter segmentation on T1-weighted exvivo mouse spinal cord
MIT License
2 stars 1 forks source link

Metrics measurement based on model output #45

Open plbenveniste opened 9 months ago

plbenveniste commented 9 months ago

Using this issue to summarize a discussion with Benjamin.

The objectives are to extract:

These steps require the use of SCT (these were done on v6.1):

To do so, use the following steps on the predicted file file_pred.nii.gz:

  1. Divide the image in two files, one for GM and one for WM: For WM : sct_maths -i ~/file_pred.nii.gz -bin 1 -o ~/file_pred_WM.nii.gz For GM : sct_maths -i ~/file_pred.nii.gz -sub ~/file_pred_WM.nii.gz -o ~/file_pred_GM.nii.gz sct_maths -i ~/file_pred_GM.nii.gz -sub ~/file_pred_WM.nii.gz -o ~/file_pred_GM.nii.gz (need to do it twice because WM value is 2)

  2. To obtain a Spinal cord segmentation (both WM and GM voxel are equal to 1): sct_maths -i ~/file_pred.nii.gz -bin 0.5 -o ~/file_pred_sc.nii.gz

  3. To measure AP and RL diameters (for each slice): sct_process_segmentation -i ~/file_pred_sc.nii.gz -o ~/output_diameters.csv -perslice 1 The information is stored in column MEAN(diameter_AP) and MEAN(diameter_RL)

  4. To measure SC area (for each slice): sct_process_segmentation -i ~/file_pred_sc.nii.gz -o ~/output_sc_area.csv -perslice 1 The information is stored in MEAN(area)

  5. To measure WM area (for each slice): sct_process_segmentation -i ~/file_pred_WM.nii.gz -o ~/output_wm_area.csv -perslice 1 The information is stored in MEAN(area)

  6. To measure GM area (for each slice): sct_process_segmentation -i ~/file_pred_GM.nii.gz -o ~/output_gm_area.csv -perslice 1 The information is stored in MEAN(area)

Furthermore, it is recommanded to do apply sct_proces_segmentation on the original image and not the straightened one, as straightening might bias the results.