Main Content

3-D Volumetric Image Processing

3-D volumetric images, or volumes, represent the brightness or color of a scene sampled in three spatial dimensions: height, width, and depth. Volumes are used in a variety of fields, such as:

  • Medical imaging, which analyzes structures in the body to detect irregularities and measure tissue properties.

  • Manufacturing, which examines goods for quality and improves product design.

  • Geological imaging, which performs nondestructive testing of the environment and examines properties of rocks and fossils.

  • Archaeology and art restoration, which digitally preserve artifacts and conduct non-invasive analysis of archaeological findings.

Image Processing Toolbox™ represents volumes as multidimensional arrays with three spatial dimensions. Grayscale and binary volumes are typically 3-D arrays, where each (row, column, plane) index of the array corresponds to a single voxel in the volume. Color volumes are typically 4-D arrays, where the fourth dimension stores the intensity values of the color channels.

Note

Image Processing Toolbox also uses multidimensional arrays to represent image sequences. Unlike volumes, image sequences typically have a temporal dimension that stores samples of the scene over time. Some functions work for both volumetric images and image sequences, whereas other functions work for only one type of input. For more information, see Work with Image Sequences as Multidimensional Arrays.

This page provides a list of functions that support 3-D volumetric images in Image Processing Toolbox.

Volume Import and Export

FunctionDescription
Blocked Volumes
blockedImageBig or multiresolution image made from smaller discrete blocks
blockedImageDatastoreDatastore that reads blocks from blockedImage objects
makeMultiLevel3DCreate 3-D multilevel blocked image with different resolutions from a single level of a blocked image
Standard File Formats
dicomreadRead DICOM image
dicomreadVolumeCreate 4-D volume from set of DICOM images
dicomContoursExtract ROI data from DICOM-RT structure set
niftiinfoRead metadata from NIfTI file
niftiwriteWrite volume to file using NIfTI format
niftireadRead NIfTI image
tiffreadVolumeRead volume from TIFF file
medicalVolume (Medical Imaging Toolbox)3-D medical image voxel data and spatial referencing information (requires Medical Imaging Toolbox™)

Display

FunctionDescription
Interactively Display and Explore Volumes
Volume ViewerView volumetric data and labeled volumetric data, and interactively adjust display settings
Render Volumes in 3-D Space
viewer3dCreate 3-D viewer with scene-level controls
volshowDisplay volume in 3-D viewer
SurfaceDisplay surface in 3-D viewer
Display 2-D Cross Sections (Slices)
montageDisplay multiple image slices as rectangular montage
sliceViewerBrowse image slices in grayscale or RGB volume
orthosliceViewerBrowse orthogonal slices in grayscale or RGB volume
obliquesliceExtract oblique slice from volume

See these related examples:

Geometric Transformations and Registration

FunctionDescription
Resize, Rotate, and Crop Volumes
imresize3Resize 3-D grayscale volume
imrotate3Rotate 3-D grayscale volume
imcrop3Crop 3-D volume
Create and Apply 3-D Geometric Transformation
imwarpApply geometric transformation
transltform3d3-D translation geometric transformation
rigidtform3d3-D rigid geometric transformation
simtform3d3-D similarity geometric transformation
affinetform3d3-D affine geometric transformation
randomAffine3dRandomized 3-D affine geometric transformation
transformPointsForwardApply forward geometric transformation
transformPointsInverseApply inverse geometric transformation
Register 3-D Volumes
imregisterIntensity-based volume registration
imregdemonsEstimate displacement field that aligns two volumes
Medical Registration Estimator (Medical Imaging Toolbox)Interactively register volumes using the Medical Registration Estimator app (requires Medical Imaging Toolbox)
Store 3-D Spatial Referencing
imref3dReference volume to world coordinates
affineOutputViewSpatial extent of transformed volume

For an example, see Register Multimodal 3-D Medical Images.

Filtering and Enhancement

FunctionDescription
Apply Filter to Volume
imfilterApply N-D filter to multidimensional volumes
fspecial3Create predefined 3-D filter
medfilt33-D median filtering
imgaussfilt33-D Gaussian filtering
imboxfilt33-D box filtering
imnoiseAdd noise to volume
integralBoxFilter3Box filtering of 3-D integral volumes
integralImage33-D integral volume
fibermetricEnhance elongated or tubular structures in volume using Frangi vesselness filter
padarrayPad array
Adjust Contrast
histeqEnhance contrast using histogram equalization
imadjustnAdjust intensity values
imhistmatchnAdjust histogram of volume to match reference histogram
Deblur Volumes
deconvblindDeblur volume using blind deconvolution
deconvlucyDeblur volume using Lucy-Richardson method
deconvregDeblur volume using regularized filter
deconvwnrDeblur volume using Wiener filter
edgetaperTaper discontinuities along volume edges
otf2psfConvert optical transfer function to point-spread function
psf2otfConvert point-spread function to optical transfer function

Segmentation

For more information about image and volume segmentation techniques, see Get Started with Image Segmentation.

FunctionDescription
Segment Volume Interactively
Volume SegmenterInteractively segment objects in a volume and refine segmentation masks using the Volume Segmenter app
Medical Image Labeler (Medical Imaging Toolbox)Interactively label volumes using manual, semiautomated, and automated techniques including deep learning networks (requires Medical Imaging Toolbox)
Binary Volume Segmentation
activecontourSegment grayscale volume into foreground and background using active contours (snakes) region growing technique
lazysnappingSegment grayscale volume into foreground and background using graph-based segmentation
grabcutSegment grayscale volume into foreground and background using iterative graph-based segmentation
adaptthreshAdaptive volume threshold using local first-order statistics
graythreshGlobal volume threshold using Otsu's method
gradientweightCalculate weights for voxels based on volume gradient
graydiffweightCalculate weights for image pixels based on grayscale intensity difference
grayconnectedSelect contiguous volumetric region with similar gray values using flood-fill technique
imbinarizeBinarize volume by thresholding
imsegfmmBinary volume segmentation using fast marching method
Segment Volumes into Labeled Volumes
imsegkmeans3K-means clustering based volume segmentation
superpixels33-D superpixel oversegmentation of volume
watershedWatershed transform
Evaluate Segmentation Results
bfscoreContour matching score
diceSørensen-Dice similarity coefficient
jaccardJaccard similarity coefficient

See these related examples:

Morphology

To ensure a volume is processed as a volume and not an image sequence, use a 3-D structuring element.

FunctionDescription
Morphological Operations
bwmorph3Morphological operations on binary volume
imcloseMorphologically close volume
imdilateDilate volume
imerodeErode volume
imopenMorphologically open volume
imbothatBottom-hat filtering
imtophatTop-hat filtering
bwskelReduce all objects to lines in binary volume
bwhitmissBinary hit-miss operation
bwperimFind perimeter of objects in binary volume
imclearborderSuppress light structures connected to volume border
imkeepborderRetain light structures connected to volume border
bwulterodeUltimate erosion
imfillFill regions and holes in volume
padarrayPad volume
Morphological Reconstruction
imreconstructMorphological reconstruction
imregionalmaxRegional maxima
imregionalminRegional minima
imextendedmaxExtended-maxima transform
imextendedminExtended-minima transform
imhmaxSuppress regional maxima using H-maxima transform
imhminSuppress regional minima using H-minima transform
imimposeminImpose minima
Structuring Elements
strelMorphological structuring element for binary volumes
offsetstrelMorphological offset structuring element for grayscale volumes
conndefCreate connectivity array

Image and Object Analysis

FunctionDescription
Analyze Objects
regionprops3Measure properties of 3-D regions
bwselect3Select objects in binary volume
bwconncompFind and count connected components in binary volume
bwareaopenRemove small objects from binary volume
Evaluate Image Quality
immseMean-squared error
psnrPeak signal-to-noise ratio (PSNR)
ssimStructural similarity (SSIM) index
multissim3Multiscale structural similarity (MS-SSIM) index
Measure Image Properties
imhistHistogram of volume data
bwdistDistance transform of binary volume
bwdistgeodesicGeodesic distance transform of binary volume
graydistGray-weighted distance transform
Detect Edges
edge3Find edges in grayscale volume
imgradient3Find gradient magnitude and direction of volume
imgradientxyzFind directional gradients of volume
Measure Texture
entropyEntropy of grayscale volume
entropyfiltLocal entropy of grayscale volume
rangefiltLocal range of volume
stdfiltLocal standard deviation of volume

Deep Learning with Volumes

For more information, see Get Started with Image Preprocessing and Augmentation for Deep Learning (Computer Vision Toolbox) and Preprocess Volumes for Deep Learning (Deep Learning Toolbox).

FunctionDescription
Read and Preprocess Data for Deep Learning
blockedImageDatastoreDatastore that reads blocks from blockedImage objects
randomPatchExtractionDatastoreDatastore that extracts random 3-D patches from volumes or pixel label volumes
randomAffine3dRandomized 3-D affine transformation
centerCropWindow3dCentered cuboidal cropping window
randomCropWindow3dRandomized cuboidal cropping window
Create Deep Neural Networks
resize3dLayerResize 3-D layer in neural network (requires Deep Learning Toolbox™)
dlresizeResize spatial dimensions of dlarray object (requires Deep Learning Toolbox)

For an example, see 3-D Brain Tumor Segmentation Using Deep Learning.

Arithmetic

FunctionDescription
imabsdiffAbsolute difference of two volumes
imaddAdd two volumes or add constant to volume
imdivideDivide one volume into another or divide volume by constant
immultiplyMultiply two volumes or multiply volume by constant
imsubtractSubtract one volume from another or subtract constant from volume

See Also

Topics