Main Content

Segmentation

Medical image segmentation using deep learning and image processing algorithms

Image segmentation partitions an image into regions. You can perform medical image segmentation using the Medical Segment Anything Model (MedSAM), other deep learning networks, the interactive Medical Image Labeler app, or image processing algorithms. Deep learning networks require Deep Learning Toolbox™ and Computer Vision Toolbox™.

Apps

Medical Image LabelerInteractively explore, label, and publish animations of 2-D or 3-D medical image data (Since R2022b)

Functions

expand all

imbinarizeBinarize 2-D grayscale image or 3-D volume by thresholding
graythreshGlobal image threshold using Otsu's method
multithreshMultilevel image thresholds using Otsu’s method
otsuthreshGlobal histogram threshold using Otsu's method
adaptthreshAdaptive image threshold using local first-order statistics
grayconnectedSelect contiguous image region with similar gray values using flood-fill technique
watershedWatershed transform
activecontourSegment image into foreground and background using active contours (snakes) region growing technique
imsegfmmBinary image segmentation using fast marching method
gradientweightCalculate weights for image pixels based on image gradient
graydiffweightCalculate weights for image pixels based on grayscale intensity difference
imsegkmeansK-means clustering based image segmentation
imsegkmeans3K-means clustering based volume segmentation
superpixels2-D superpixel oversegmentation of images
superpixels33-D superpixel oversegmentation of 3-D image
medicalSegmentAnythingModelPretrained Medical Segment Anything Model (MedSAM) for medical image segmentation (Since R2024b)
extractEmbeddingsExtract image embeddings from Medical Segment Anything Model (MedSAM) encoder (Since R2024b)
segmentObjectsFromEmbeddingsSegment objects in medical image using Medical Segment Anything Model (MedSAM) image embeddings (Since R2024b)

Load and Prepare Training Data

groundTruthMedicalGround truth label data for medical images (Since R2022b)
changeFilePathsChange file paths in ground truth data for medical images (Since R2022b)
mergeMerge two or more groundTruthMedical objects (Since R2022b)
imageDatastoreDatastore for image data
pixelLabelDatastoreDatastore for pixel label data
randomPatchExtractionDatastoreDatastore for extracting random 2-D or 3-D random patches from images or pixel label images
combineCombine data from multiple datastores
transformTransform datastore

Import Network

importNetworkFromTensorFlowImport TensorFlow network as MATLAB network (Since R2023b)
importNetworkFromONNXImport ONNX network as MATLAB network (Since R2023b)

Design Networks

unetCreate U-Net convolutional neural network for semantic segmentation (Since R2024a)
unet3dCreate 3-D U-Net convolutional neural network for semantic segmentation of volumetric images (Since R2024a)
generalizedDiceGeneralized Sørensen-Dice similarity coefficient for image segmentation (Since R2021a)
dlnetworkDeep learning neural network
trainnetTrain deep learning neural network (Since R2023b)

Segment Images

semanticsegSemantic image segmentation using deep learning
labeloverlayOverlay label matrix regions on 2-D image
volshowDisplay volume
jaccardJaccard similarity coefficient for image segmentation
diceSørensen-Dice similarity coefficient for image segmentation
bfscoreContour matching score for image segmentation

Topics

Medical Segment Anything Model

Segmentation Using Deep Learning

Related Information

Featured Examples