The value of FA.nii.gz

Dear experts
I have a simple question. I use the command dwi2tensor data.mif - -mask mask.mif | tensor2metric - -fa FA.nii to get FA.nii ,but I find the some value of FA.nii are beyond 1 and some are nan.
Is there something wrong ?


Hi Liyuan,

From my point of view, looks like those higher FA valued that you are showing are non-brain tissue, I think you could solve this problem by eroding the mask a couple of voxels.


Agreed, those regions with FA > 1 are overwhelming around the edge of the brain, and most likely due to background noise. You may chose to remove them using a more aggressive mask, but it’s by no means a requirements - it simply makes the images nicer to display.

Just to explain how you can get FA > 1: one way of defining FA is as the ratio of the variance in the eigenvalues of the tensor to their root-mean-square value, scaled such that the maximum physically possible FA value is 1. But what happens in noisy regions is that the b=0 and DW intensities are similar, so that the ratio of DWI to b=0 can be greater than 1, which leads to a negative ADC value. This is clearly non-physical, but nonetheless allowed by the fitting procedure. When this happens, it will lead to a greater variance than expected, and consequently an FA value greater than 1. While some fitting routines do constrain the eigenvalues to be positive, this requires expensive non-linear fitting routines, and we don’t see a huge benefit to using them since the problem is largely confined to non-brain regions anyway…

Thanks for your reply!
Why the value is NaN? Is it reasonable to replace the NaN with zero ?

Thank you very much !

Which value are you referring to? Neither dwi2tensor nor tensor2metric should output NaN as far as I can tell…?

Depending on your application, yes. The only thing to bear in mind is that an FA value of zero is physically possible (although unlikely), so if your application interprets FA=0 as non-brain, there is the potential of getting it wrong in rare cases. This wouldn’t be a problem with NaN, but does rely on downstream applications handling these values appropriately - but as I mentioned above, you shouldn’t be getting NaNs outside the mask currently, so I’m confused as to why you’re raising the issue…

I get the reason.
This is the data.nii,the value of position(7,40,15) is 0 (all volume).

I use the command dwi2mask to get the mask.nii ,the value of the position is 1.

Why the mask.nii is bigger than the data.nii in some positions ? So at the position,the dt.nii is Nan

Thanks in advance

Ah, OK, if the original data were zero, then the result of the tensor calculation is indeed NaN. The mismatch between the mask and original data is most likely due to the use of a median filter in the dwi2mask process, which would tend to fill in holes and indentations like this. It all makes sense now.

We could ‘fix’ this by making sure the data in the voxel is non-zero, although I’m not sure how often that situation would arise? It’s rare to encounter raw data that have already been masked like this. Really in such a situation, you shouldn’t need to derive a new mask at all, presumably just finding non-zero voxels in the raw data would give you the exact mask that was originally applied? So something like this:

mrmath dwi.nii sum -axis 3 - | mrcalc - 0 -neq mask.nii

should give you that exact mask?