designer.preprocessing.smoothing.nansmooth(imgslice, fwhm)

Smooths an image slice while ignoring NaNs

Parameters
  • imgslice ((X x Y) img_like or array_like object) – 2D image to be smoothed

  • fwhm (float) – The full width half max to be used for smoothing

Returns

smoothslice – 2D smoothed image

Return type

(X x Y) array_like object

Notes

This is done because a masked dataset will contain NaNs. In typical operations and filtering, the NaNs will propagate instead of being ignored (which is the desired behavior). During runtime, divide by 0 warnings are suppressed due to the high probability of its occuring. The operation to avoid this is as follows:

designer.preprocessing.smoothing.smooth(dwi, csfmask=None, width=1.25)

Smooths a DWI dataset

Parameters
  • dwi ((X x Y x Z x N) img_like object) – Image to be smoothed, where N is the number of volumes in the DWI acquisition.

  • csfmask ((S) img_like object) – The mask of CSF that will be applied to each volume in DWI

  • width (float, optional) – The full width half max in voxels to be smoothed. Default: 1.25

Returns

smoothed – The smoothed version of dwi

Return type

(X x Y x Z x N) array_like or img_like object

Notes

This is done mainly to reduce the Gibbs ringing. It might be recommended to only smooth the high SNR (or b-valued) data in order not to alter the Rice distribution of the low SNR data. This is important to maintain the high accuracy of WLLS. If a CSF mask is given as an additional argument, CSF infiltration in microstructural signal is avoided during smoothing.

designer.preprocessing.smoothing.smooth_image(dwiname, csfname=None, outname='dwism.nii', width=1.2)

Smooths a DWI dataset

Parameters
  • dwiname (str) – Filename of image to be smoothed

  • csfname (str) – Filename of CSF mask

  • outname (str) – Filename to be written out

  • width (float) – The full width half max in voxels to be smoothed. Default: 1.25

Returns

Return type

None; writes out file

See also

smooth(), csfmask(), width()