medicalSegmentAnythingModel
Pretrained Medical Segment Anything Model (MedSAM) for medical image segmentation
Since R2024b
Description
The Medical Segment Anything Model (MedSAM) is a Segment Anything Model (SAM)
fine-tuned for medical image segmentation on a large-scale medical image data set. Use the
medicalSegmentAnythingModel
object and its object functions to
interactively segment objects in 2-D medical images using visual prompts. A
medicalSegmentAnythingModel
object configures MedSAM for semantic
segmentation of objects in a medical image without retraining the model. To segment an image,
you must first use the extractEmbeddings
object function to extract the image embeddings from the
MedSAM image encoder. Then, use the segmentObjectsFromEmbeddings
object function to segment objects from the image
embeddings using the mask decoder.
Note
This functionality requires Deep Learning Toolbox™, Computer Vision Toolbox™, and the Medical Imaging Toolbox™ Model for Medical Segment Anything Model. You can install the Medical Imaging Toolbox Model for Medical Segment Anything Model from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
Creation
Description
loads a pretrained Medical Segment Anything Model. To use this model to interactively
segment objects in medical images using visual prompts, specify it to the medsam
= medicalSegmentAnythingModel
extractEmbeddings
object function to extract image embeddings, and then use
the segmentObjectsFromEmbeddings
object function on the embeddings along with a
visual prompt.
Object Functions
extractEmbeddings | Extract image embeddings from Medical Segment Anything Model (MedSAM) encoder |
segmentObjectsFromEmbeddings | Segment objects in medical image using Medical Segment Anything Model (MedSAM) image embeddings |
Examples
References
[1] Ma, Jun, Yuting He, Feifei Li, Lin Han, Chenyu You, and Bo Wang. “Segment Anything in Medical Images.” Nature Communications 15, no. 1 (January 22, 2024): 654. https://doi.org/10.1038/s41467-024-44824-z.
Version History
Introduced in R2024b