Hi,

 

You can fix this by implementing a masked smoothing operation that effectively only uses values from the non-zero voxels.  This just requires a couple of steps:

1)      smooth your image as normal and save that

2)      create a binary mask for the non-zero voxels (-bin in fslmaths will do this) and smooth this in the same way and save that

3)      divide the result from step 1 by the result from step 2 and save this

 

The result from step 3 is a masked smoothing that takes into account when the initial smoothing was using zero values and compensates for this.

 

All the best,

            Mark

 

From: FSL - FMRIB's Software Library <[log in to unmask]> on behalf of Evgeny Chumin <[log in to unmask]>
Reply-To: FSL - FMRIB's Software Library <[log in to unmask]>
Date: Monday, 3 October 2016 at 19:44
To: "[log in to unmask]" <[log in to unmask]>
Subject: [FSL] using fslmaths to smooth a zero background epi image

 

Dear FSL Experts,

 

I was trying to use fslmaths to smooth a brain masked epi image and I am running into a problem where the masked image has shrunk. The degree of the shrinking seems to depend on the sigma value I choose, with larger sigma values resulting in more shrinkage.

 

I think this may be because the epi image I am smoothing has a zero background (e.g. brain masked). If a use a raw epi (unmasked) everything works fine.

 

Here is an example of the syntax I used:

 

fslmaths input_epi.nii.gz -kernel gauss 5 -fmean smoothed_epi.nii.gz

 

Is there a way to resolve this without resulting to smoothing the unmasked image?

 

Any thoughts?

 

Many Thanks in Advance,

Evgeny