You are here : matlabImage Processingimgaussfilt3

imgaussfilt3() - Image Processing

B = imgaussfilt3(A) filters
3-D image A with a 3-D Gaussian smoothing kernel
with standard deviation of 0.5.B = imgaussfilt3(A,sigma) filters
3-D image A with a 3-D Gaussian smoothing kernel
with standard deviation specified by sigma. B = imgaussfilt3(___,Name,Value,...) filters
3-D image A with a 3-D     Gaussian smoothing
kernel with Name-Value pairs used to control aspects of the filtering.examplegpuarrayB= imgaussfilt3(gpuarrayA,___) performs
the filtering operation on a GPU. The input image must be a gpuArray.
The function returns a gpuArray. This syntax requires Parallel Computing Toolbox™.


Syntax

B = imgaussfilt3(A) exampleB = imgaussfilt3(A,sigma)B = imgaussfilt3(___,Name,Value,...)gpuarrayB= imgaussfilt3(gpuarrayA,___) example


Example

Smooth MRI volume with 3-D Gaussian filterOpen This Example
Load MRI data and display it.vol = load('mri');
figure
montage(vol.D)
title('Original image volume')

Smooth the image with a 3-D Gaussian filter.siz = vol.siz;
vol = squeeze(vol.D);
sigma = 2;

volSmooth = imgaussfilt3(vol, sigma);

figure
montage(reshape(volSmooth,siz(1),siz(2),1,siz(3)))
title('Gaussian filtered image volume')

Smooth MRI Volume with 3-D Gaussian Filter on a GPU
This example shows how to perform a 3-D Gaussian
smoothing operation on a GPU.
Load MRI data to be filtered.vol = load('mri');
figure, montage(vol.D), title('Original image volume')
Create a gpuArray containing the volume data and perform
Gaussian smoothing.siz = vol.siz;
vol = gpuArray(squeeze(vol.D));   
sigma = 2; 

volSmooth = imgaussfilt3(vol, sigma);
Collect the smoothed data from the GPU (using the gather function)
and display all the results for comparison.figure, montage(reshape(gather(volSmooth),siz(1),siz(2),1,siz(3)))
title('Gaussian filtered image volume')


Output / Return Value


Limitations


Alternatives / See Also


Reference