Skip to content

Commit

Permalink
Fixed never-ending loop in TissueSegmentation
Browse files Browse the repository at this point in the history
  • Loading branch information
smistad committed Feb 3, 2025
1 parent 926dc6c commit 810365a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ void TissueSegmentation::runNeuralNetwork(SpatialDataObject::pointer image) {
// If level is not specified, automatically find an OK level to use.
int useLevel = wsi->getNrOfLevels()-1;
while(useLevel >= 0) {
if(wsi->getLevelWidth(useLevel) < width || wsi->getLevelHeight(useLevel) < height) {
// Go further down
--useLevel;
} else if(wsi->getLevelWidth(useLevel) >= 8192 || wsi->getLevelHeight(useLevel) >= 8192) {
if(wsi->getLevelWidth(useLevel) >= 8192 || wsi->getLevelHeight(useLevel) >= 8192) {
// Go back
++useLevel;
break;
} else {
// Go further down
--useLevel;
}
}
if(useLevel < 0)
Expand Down

0 comments on commit 810365a

Please sign in to comment.