Source of 2-D medical image data for
ImageSource object defines the source of ground truth data for
medical images or series of images related by time, such as ultrasound data. Use this object
to specify the data sources for a
groundTruthMedical object. Each source must
be a single DICOM or NIfTI file.
When you export labels from a Medical Image Labeler app image session, the
DataSource property of the exported
object contains an
To create an
ImageSource object programmatically, such as when
programmatically creating a
groundTruthMedical object, use the
imgSource = medical.labeler.loading.ImageSource(
ImageSource object for loading the 2-D medical image data
stored in the files specified by
source — Source file names
n-by-1 string array | n-by-1 cell array of character vectors
Source file names, specified as an n-by-1 string array or an
n-by-1 cell array of character vectors. n is
the total number of images or series of images related by time to store in the
groundTruthMedical object. Each name specifies a single DICOM or
NIfTI file containing 2-D image data that is readable by a
sourceTable — Table of source file names
Table of source file names, specified as a table returned by the
dicomCollection function. Each row in
must specify a valid DICOM series that contains a 2-D image or series of images
related by time that is readable by a
medicalImage object. The file name for each DICOM series is stored in the
Filenames column of the table returned by
Source — Source of ground truth data
n-by-1 string array
This property is read-only.
Source of the ground truth data, specified as an n-by-1 string
array, where n is the total number of images or series of images
related by time to store in the
groundTruthMedical object. Each element
in the string array specifies the file name for one image or image series.
Create Medical Image Data Source from File
Specify the name of a 2-D X-ray image. The file is attached to this example as a supporting file.
filename = fullfile(pwd,"forearmXrayImage1.dcm");
ImageSource object that specifies the X-ray image.
imgSource = medical.labeler.loading.ImageSource(filename);
Verify that the filename is stored in the
Source property of the data source object.
Create Image Data Source from DICOM Collection
Specify the name of the directory containing this example, which includes three 2-D X-ray images of a forearm stored as DICOM files.
dataFolder = pwd;
Gather the details about the DICOM files in the directory into a table by using the
sourceTable = dicomCollection(dataFolder);
ImageSource object that specifies the files in
imgSource = medical.labeler.loading.ImageSource(sourceTable);
Verify that each element of the
Source property contains a filename from the
Filenames column of
Introduced in R2022b