%% Select Ground Truth Labels by Group Name
% Select ground truth labels from a
% |<docid:driving_ref#mw_42782d95-09f4-4844-91ee-44ddd8357f59
% groundTruthMultisignal>| object by specifying a group name.

% Copyright 2019 The MathWorks, Inc.

%% 
% Load a |groundTruthMultisignal| object containing ROI and scene label
% data for a video and corresponding lidar point cloud sequence. The helper
% function used to load this object is attached to the example as a
% supporting file.

gTruth = helperLoadGTruthVideoLidar;

%%
% Inspect the label definitions. The object contains label definitions in a
% |"Vehicles"| group. Ungrouped labels are in the group named |"None"|.

gTruth.LabelDefinitions

%%
% Create a new |groundTruthMultisignal| object that contains labels for
% only the |"Vehicles"| group.
groupNames = "Vehicles";
gtLabel = selectLabelsByGroupName(gTruth,groupNames);

%%
% For the original and new objects, inspect the ROI label data. Because
% |"Vehicles"| is the only group used for the ROI label data, the original
% and new object contain identical ROI label data.

gTruth.ROILabelData
gtLabel.ROILabelData

%%
% For the original and new objects, inspect the scene label data. The
% |"None"| group, which is used only in scene labels, was not selected.
% Therefore, the new object contains no scene label data.

gTruth.SceneLabelData
gtLabel.SceneLabelData