Main Content

ImageSource

Source of 2-D medical image data for groundTruthMedical object

Since R2022b

Description

An 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.

Creation

When you export labels from a Medical Image Labeler app image session, the DataSource property of the exported groundTruthMedical object contains an ImageSource object.

To create an ImageSource object programmatically, such as when programmatically creating a groundTruthMedical object, use the medical.labeler.loading.ImageSource function.

Description

imgSource = medical.labeler.loading.ImageSource(source) creates an ImageSource object for loading the 2-D medical image data stored in the files specified by source.

example

imgSeqSource = medical.labeler.loading.ImageSource(sourceTable) creates an ImageSource object for loading the image files specified in a table, sourceTable, returned by the dicomCollection function.

example

Input Arguments

expand all

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 file in one of these formats.

  • DICOM file.

  • MAT file containing a medicalImage object.

  • Any graphics file format listed in the imformats registry.

Data Types: string | cell

Table of source file names, specified as a table returned by the dicomCollection function. Each row in sourceTable 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 dicomCollection.

Data Types: table

Properties

expand all

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.

Data Types: string

Examples

collapse all

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");

Create an 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.

imgSource.Source;

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 dicomCollection function.

sourceTable = dicomCollection(dataFolder);

Create an ImageSource object that specifies the files in sourceTable.

imgSource = medical.labeler.loading.ImageSource(sourceTable);

Verify that each element of the Source property contains a filename from the Filenames column of sourceTable.

imgSource.Source;

Version History

Introduced in R2022b

expand all