Hi Abir,
As I suggested above, the simplest way to deal with this is not to average (it looks like it wouldn’t be sensible anyway if these acquisitions don’t use the same gradient table), but to concatenate them to form a longer dataset, which can then be fed directly into e.g. dwi2mask
, e.g.:
dwicat acq1.mif acq2.mif acq3.mif acq4.mif - | dwi2mask - mask.mif
However, can I check how you did your processing? If you processed each of these 4 acquisitions separately, you will probably find some residual misalignment between them, which means you won’t be able to average them immediately – you might need to perform some additional registration to align them, which isn’t ideal as that will introduce additional interpolation errors. To avoid this, I think it would have been better to concatenate the 4 datasets right at the start of the processing chain (using dwicat
), and treat the whole thing as a single dataset.
Note that this assumes these 4 datasets were acquired in a single session – i.e. we’re not talking about 4 time points in a longitudinal study or something, in which case you’d obviously want to keep them separate.
However, if you want to go ahead with generating a mask from a single average, one approach would be to concatenate all 4 acquisitions, then average along the volume dimension to get a single overall mean over the entire dataset, and apply a simple thresholding on that:
mrcat acq1.mif acq2.mif acq3.mif acq4.mif -axis 3 - | mrthreshold - mask.mif
This might do a good enough job straight away, or you may need to tweak the threshold value to clean things up using the -abs
option to mrthreshold
. Or you could also feed that into FSL’s bet
tool, which also produces good results most of the time.
In any case, I hope this provides some useful pointers…
All the best,
Donald.