Skip to content

Commit b4c1358

Browse files
committed
BUG: Support legacy .dream3d files in OOC backfill
backfillReadOnlyOocStores hardcoded "DataStructure" as the root HDF5 group name. Legacy DREAM3D 6.5/6.6 files use "DataContainers" instead. Fall back to "DataContainers" when "DataStructure" is not found.
1 parent 2237443 commit b4c1358

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/simplnx/Filter/Actions/ImportH5ObjectPathsAction.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,17 @@ Result<> backfillReadOnlyOocStores(DataStructure& dataStructure, const std::vect
6060
return {};
6161
}
6262

63-
auto dsGroup = fileReader.openGroup("DataStructure");
63+
// Support both NX format ("DataStructure") and legacy DREAM3D 6.5/6.6 format ("DataContainers")
64+
std::string rootGroupName = "DataStructure";
65+
auto dsGroup = fileReader.openGroup(rootGroupName);
6466
if(!dsGroup.isValid())
6567
{
66-
return MakeErrorResult(-6210, "backfillReadOnlyOocStores: No 'DataStructure' group in HDF5 file");
68+
rootGroupName = "DataContainers";
69+
dsGroup = fileReader.openGroup(rootGroupName);
70+
if(!dsGroup.isValid())
71+
{
72+
return MakeErrorResult(-6210, "backfillReadOnlyOocStores: No 'DataStructure' or 'DataContainers' group in HDF5 file");
73+
}
6774
}
6875

6976
const auto filePath = fileReader.getFilePath();
@@ -144,7 +151,7 @@ Result<> backfillReadOnlyOocStores(DataStructure& dataStructure, const std::vect
144151
auto dataset = currentGroup->openDataset(pathComponents.back());
145152
auto chunkDims = dataset.getChunkDimensions();
146153

147-
std::string hdf5Path = "DataStructure/" + childPath.toString();
154+
std::string hdf5Path = rootGroupName + "/" + childPath.toString();
148155
auto tupleShape = iDataStore->getTupleShape();
149156
auto componentShape = iDataStore->getComponentShape();
150157

0 commit comments

Comments
 (0)