Main Content

merge

Merge two or more groundTruthMedical objects

    Description

    example

    gTruthMerged = merge(gTruth1,gTruth2,...,gTruthn) merges two or more groundTruthMedical objects into a new groundTruthMedical object, gTruthMerged.

    Examples

    collapse all

    Merge two compatible groundTruthMedical objects present in the MATLAB® workspace.

    The ground truth objects, gTruthMed1 and gTruthMed2, specify the volumetric data source and label image for the CT lung volumes, lung_001.nii.gz and lung_003.nii.gz, respectively.

    gTruthMed1
    gTruthMed1 = 
    
      groundTruthMedical with properties:
    
              DataSource: [1×1 medical.labeler.loading.VolumeSource]
               LabelData: "C:\Merge\Label Data\lung_001.nii.gz"
        LabelDefinitions: [1×3 table]
    gTruthMed2
    gTruthMed2 = 
    
      groundTruthMedical with properties:
    
              DataSource: [1×1 medical.labeler.loading.VolumeSource]
               LabelData: "C:\Merge\Label Data\lung_003.nii.gz"
        LabelDefinitions: [1×3 table]

    Merge the groundTruthMedical objects. The merged object specifies both lung CT volumes.

    gTruthMerged = merge(gTruthMed1,gTruthMed2)
    gTruthMerged = 
    
      groundTruthMedical with properties:
    
              DataSource: [1×1 medical.labeler.loading.VolumeSource]
               LabelData: [2×1 string]
        LabelDefinitions: [1×3 table]

    Input Arguments

    collapse all

    Ground truth data to merge, specified as a comma-separated list of two or more groundTruthMedical objects. You can export the groundTruthMedical objects from the Medical Image Labeler app or create them programmatically by using the groundTruthMedical function.

    The specified groundTruthMedical objects must all have the same data source type, specified by the DataSource property. For example, if one object has a data source of type VolumeSource, all groundTruthMedical objects you merge it with must also have a data source of type VolumeSource.

    You cannot merge groundTruthMedical objects that have one or more DataSource entries pointing to the same file location. Each groundTruthMedical object must specify a unique set of image sequences or image volumes

    If the LabelDefinition properties of two or more objects specify the same label name, they must also specify the same color and pixel label ID for that label name. The label name, color, and pixel label ID are specified by the LabelName, LabelColor, and PixelLabelID columns of the LabelDefinition property.

    Output Arguments

    collapse all

    Merged ground truth data, returned as a groundTruthMedical object. The DataSource property of gTruthMerged is the same as that of the input groundTruthMedical objects.

    Version History

    Introduced in R2022b