Skip to content

Commit 2a28f7b

Browse files
committed
Fix issue with updating progress when no .json file
1 parent e391cc5 commit 2a28f7b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

visualization/VisualizationContainer.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2231,6 +2231,8 @@ void VisualizationContainer::ExtractRegions(const std::vector<RegionInfo>& metad
22312231
// XXX: THIS IS CLEARING ALL VOXELS IN THE LABEL DATA
22322232
regions->RemoveAll();
22332233

2234+
int regionCount = 0;
2235+
22342236
// First try metadata
22352237
for (int i = 0; i < (int)metadata.size(); i++) {
22362238
Region* region = new Region(metadata[i], labels);
@@ -2252,7 +2254,9 @@ void VisualizationContainer::ExtractRegions(const std::vector<RegionInfo>& metad
22522254
delete region;
22532255
}
22542256

2255-
qtWindow->updateProgress((double)(i + 1) / maxLabel);
2257+
regionCount++;
2258+
2259+
qtWindow->updateProgress((double)(regionCount + 1) / maxLabel);
22562260
}
22572261

22582262
// Add any remaining
@@ -2266,6 +2270,10 @@ void VisualizationContainer::ExtractRegions(const std::vector<RegionInfo>& metad
22662270
else {
22672271
delete region;
22682272
}
2273+
2274+
regionCount++;
2275+
2276+
qtWindow->updateProgress((double)(regionCount + 1) / maxLabel);
22692277
}
22702278
}
22712279

0 commit comments

Comments
 (0)