Extract_metrics with slice-direction partial volumes

Hello,

When using sct_extract_metrics, what is the preferred way to deal with partial volume effects in the slice direction for slices and/or per-level data? That is, if the DTI slice coverage is C2:C6 for example, when in template space the top- and bottom-most levels will have only partial overlap with the available data as in the figure included. The middle two levels are obviously ok, but the levels overlapping the edge of the slice field of view appear to average true values with the 0 values without real data.

  • One method would be to exclude voxels with 0 values similar to fslstats (-M) flag. In sct, negative values can be excluded with -discard-neg-val flag, but seemingly not 0 voxels.
  • The alternative is to mask the input per-level masks with a mask that covers the DTI slice coverage, as an example, although that includes an additional per-subject step.

I am curious what the sct team recommends to deal with this?

thanks,
matt

#Additional commands used to demonstrate effects:
sct_extract_metric -i FA_reg.nii
-f {SCT_DIR}/data/PAM50/template/PAM50_levels.nii.gz
-method wa -perlevel 1
-vert 2:9
-vertfile ${SCT_DIR}/data/PAM50/template/PAM50_levels.nii.gz

#partial output:
…“PAM50_levels”,47220,0.2035233735461865
…“PAM50_levels”,47190,0.3026320017920616
…“PAM50_levels”,43000,0.45205885150531344
…,“PAM50_levels”,29481,0.24826158435652138

#if using fslstats in the same way, we get the same values (reordered for consistency w/sct):
fslstats -K ${SCT_DIR}/data/PAM50/template/PAM50_levels.nii.gz FA_reg.nii -m
#output:
0.203523
0.302632
0.452059
0.248262

#if using fslstats with non-zero mean, we get more appropriate values for the ‘edge’ levels, but the mid-levels are unchanged:
fslstats -K ${SCT_DIR}/data/PAM50/template/PAM50_levels.nii.gz FA_reg.nii -M
#output:
0.431152
0.302632
0.452059
0.454653

Hi @mbudde,

My deepest apologies for the late response. I am writing to let you know that @jcohenadad is currently out of office, and will return on August 28th.

I will check in with other members of the lab to see if they can provide insight into your question. But, otherwise, I thank you for patience until Julien returns. :blush:

Kind regards,
Joshua

One thing I will say, though, is that this seems like an excellent suggestion, and relatively easy for us to implement given the existence of -discard-neg-val as you mention. Thank you for the suggestion! I’ll open a ticket for this feature request. :slightly_smiling_face:

Kind regards,
Joshua

1 Like

Hi Matt! Thanks for reaching out. Agreed with @joshuacwnewton about leveraging the already existing flag. I don’t see any other “easy” solution.

thanks for the response, gents.

As a workaround, I tried to subtract small values from the input image:
sct_maths -i FAin.nii.gz -sub 1e-16 -o FAout.nii.gz
and ran sct_extract_metric again with -discard-neg-val flag enabled. However, it didn’t seem to have any effect. (tried other less-small values too).

I see you opened the Advanced options in a subsequent issue, so I’ll find a different workaround for now. Thanks and regards!

Interesting. So it suggests a bug with this flag. @joshuacwnewton could you please look into this? Thanks!

Of course! Two issues have been opened on the SCT repo, and I will look into them promptly:

Kind regards,
Joshua

1 Like