// If the file is in a totally different tree from the cwd,// then leave the path as absolute. Otherwise, override with the relative path.if relPath is not None and len(os.path.commonprefix([cwd, absPath])) > 1:
data_path = relPath
if DatasetInfo.fileHasInternalPaths(data_path):
datasetNames = DatasetInfo.getPossibleInternalPathsFor(absPath)
iflen(datasetNames)== 0:
raise RuntimeError(f"{file_extension} file {data_path} has no image datasets")