Giving credit

4.2.1.2. nilearn.image.smooth

nilearn.image.smooth(niimgs, fwhm)

Smooth images by applying a Gaussian filter.

Apply a Gaussian filter along the three first dimensions of arr. In all cases, non-finite values in input image are replaced by zeros.

Parameters :

niimgs: niimgs or iterable of niimgs :

One or several niimage(s), either 3D or 4D.

fwhm: scalar or numpy.ndarray :

Smoothing strength, as a Full-Width at Half Maximum, in millimeters. If a scalar is given, width is identical on all three directions. A numpy.ndarray must have 3 elements, giving the FWHM along each axis. If fwhm is None, no filtering is performed (useful when just removal of non-finite values is needed)

Returns :

filtered_img: nibabel.Nifti1Image or list of. :

Input image, filtered. If niimgs is an iterable, then filtered_img is a list.