Extracting metrics from lesion masks


#1

Hello,

I have binarised cervical cord lesion masks that I manually segmented and which are currently in t2 space. I also have cervical cord MTR and diffusion data (which I have already processed). I now would like to extract the mean MTR and mean FA/MD of the lesional tissue. Is there a way of doing this using SCT?

Thank you very much!

Best,
Romina


#2

Hi Romina,

You can use sct_analyze_lesion, which takes as input the lesion mask, the cord segmentation and the metric of interest (e.g., MTR image) and which outputs a lesion mask with each lesion labeled (1, 2, 3, …) as well as an Excel file with the metrics for each lesion.

Here is an example, where I created a mask with three dummy squares on a T2w image:
screenshot

Running this command:

sct_analyze_lesion -m t2_mask.nii.gz -i t2.nii.gz -s t2_seg.nii.gz

produces the labeled lesion mask:

screenshot2

and the associated metrics:
07%20PM

Cheers,
Julien


#3

Hi Julien,

Great, thank you very much! Quick additional questions - if you have your t2 lesion mask and want to extract the mean MTR, which images would you input for each command and/or are there any additional registration steps that you need to run beforehand?

Many thanks!

Best,
Romina


#4

You would need to co-register the T2 and the MTR, and then apply the transformation to the T2 lesion mask. So, something like this:

sct_register_multimodal -i T2 -d MTR
sct_apply_transfo -i T2_MASK -d MTR -w warp_T2toMTR
sct_analyze_lesion -i MTR -s MTR_seg -m T2_MASK_reg

Alternatively, you can work in the PAM50 space: register your T2 and MTR with the PAM50 template, apply the transformation of the lesion mask to the PAM50, and then extract metrics in the PAM50 space.

Cheers,
Julien


#5

Hello,

Further to the above I would now like to subtract the lesion masks from the metric image and then calculate the mean metric of the non-lesional tissue.

I attempted to use fslmaths to subtract my lesion mask from the metric image but when I run sct_extract_metric on this new image I get an error “label/atlas does not exist”. I assume I am either entering the wrong input or that I need to run an additional step on the new image prior to running sct_extract_metric?

Assistance with this would be greatly appreciated!

Best wishes,
Romina


#6

Hi Romina,

to use sct_extract_metric, you either need to provide a binary (or weighted) mask within which to average your metric (flag -f), or register the PAM50 atlas to your metric and then run sct_warp_template, which will automatically create the label/atlas folder which the function is asking for.

Cheers,
Julien