Extract pixel data for one frame of 2-D medical image series
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);
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)
medImage — Medical image
Medical image, specified as a
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
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
output matrix is the same data type as the
Pixels property of
Introduced in R2022b