Change the file paths to the data sources and pixel label data in a groundTruthMultisignal
object.
Load a groundTruthMultisignal
object containing ground truth data into the workspace. The data source and pixel label data of the object contain file paths corresponding to an image sequence showing a building. MATLAB® displays a warning that the path to the data source cannot be found.
Warning: The data source for the following source names could not be loaded. Update the data sources using <a href="matlab:doc('changeFilePaths')">changeFilePaths</a> method.
'C:\Sources\building'
Display the current path to the data source.
ans =
ImageSequenceSource with properties:
Name: "Image Sequence"
Description: "An image sequence reader"
SourceName: "C:\Sources\building"
SourceParams: [1×1 struct]
SignalName: "building"
SignalType: Image
Timestamp: {[5×1 duration]}
NumSignals: 1
Specify the current path to the data source and an alternative path and store these paths in a cell array. Use the changeFilePaths
function to update the data source path based on the paths in the cell array. Because the function does not find the pixel label data at the specified new path, it returns the current unresolved paths.
unresolvedPaths = 5×1 string
"C:\Pixels\Label_1.png"
"C:\Pixels\Label_2.png"
"C:\Pixels\Label_3.png"
"C:\Pixels\Label_4.png"
"C:\Pixels\Label_5.png"
Verify that the paths in the groundTruthMultisignal
object match the unresolved paths returned by the changeFilePaths
function. The unresolved paths are stored in the ROILabelData
property of the groundTruthMultisignal
object, in the PixelLabelData
column of the table for the building
image sequence signal.
ans = 5×1 cell
{'C:\Pixels\Label_1.png'}
{'C:\Pixels\Label_2.png'}
{'C:\Pixels\Label_3.png'}
{'C:\Pixels\Label_4.png'}
{'C:\Pixels\Label_5.png'}
Specify the current path and an alternative path for the pixel label files and change the file paths. The function updates the paths for all pixel labels. Because the function resolves all paths, it returns an empty array of unresolved paths.
unresolvedPaths =
0×0 empty string array
To view the new data source path, use the gTruth.DataSource
command. To view the new pixel label data paths, use the gTruth.ROILabelData.building.PixelLabelData
command.