extractFrame
Description
Examples
Extract Frame from Medical Image Series
Specify the name of an echocardiogram series stored as a DICOM file.
fileName = "heartUltrasoundSequence.dcm";
Create a medical image object for the echocardiogram series.
medImage = medicalImage(fileName);
Check the NumFrames
property value to determine the number of frames in the series. medImage
contains three frames.
numFrames = medImage.NumFrames
numFrames = 3
Extract the second frame in the image series. Display the extracted frame image.
X = extractFrame(medImage,2); imshow(X)
Input Arguments
medImage
— Medical image
medicalImage
object
Medical image, specified as a medicalImage
object.
frame
— Frame index
positive integer scalar in range [1, numFrames]
Frame index, specified as a positive integer scalar in the range [1,
numFrames], where numFrames is the number of
frames in the image or series of images in medImage
. The number of
frames is specified by the NumFrames
property of
medImage
.
Data Types: double
Output Arguments
X
— Pixel data of extracted frame
m-by-n numeric matrix
Pixel data of the extracted frame, returned as an
m-by-n numeric matrix, where
m and n are the first two dimensions of the
image frame extracted from medImage
. The X
output matrix is the same data type as the Pixels
property of
medImage
.
Version History
Introduced in R2022b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)