3-D box filtering of 3-D integral images
Filter 3-D MRI Volume with Box Filter
Load 3-D MRI data.
volData = load('mri'); vol = squeeze(volData.D);
Pad the image volume by the radius of the filter neighborhood.
filterSize = [5 5 3]; padSize = (filterSize-1)/2; volPad = padarray(vol, padSize, 'replicate', 'both');
Calculate the 3-D integral image of the padded input.
intVol = integralImage3(volPad);
Filter the 3-D integral image with a [5 5 3] filter.
volFilt = integralBoxFilter3(intVol, filterSize);
A — Integral image to be filtered
3-D numeric array
Integral image to be filtered, specified as a 3-D numeric array.
integralBoxFilter3 expects the
input integral image,
A, to be
an upright integral image computed using
integralBoxFilter3 does not
support rotated integral images. The first row,
column and plane of the integral image is assumed to
be padded, as returned by
filterSize — Size of box filter
3 (default) | positive, odd integer | 3-element vector of positive, odd integers
Size of box filter, specified as a positive odd integer or 3-element vector of positive, odd
uses a cube box filter.
normFactor — Normalization factor applied to box filter
Normalization factor applied to the box filter, specified as a numeric scalar.
By default, the normalization factor has the value
filterSize is a scalar, and
filterSize is a vector. The
default has the effect of a mean filter — the
pixels in the output image are the local means of
To get local area sums, set
1. To avoid overflow in such
circumstances, consider using double precision
images by converting the input image to data type
B — Filtered image
3-D numeric array
Filtered image, returned as a 3-D numeric array.
only the parts of the filtering that are computed
Introduced in R2015b