Skip to content

Commit 810365a

Browse files
committed
Fixed never-ending loop in TissueSegmentation
1 parent 926dc6c commit 810365a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/FAST/Algorithms/TissueSegmentation/TissueSegmentation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ void TissueSegmentation::runNeuralNetwork(SpatialDataObject::pointer image) {
167167
// If level is not specified, automatically find an OK level to use.
168168
int useLevel = wsi->getNrOfLevels()-1;
169169
while(useLevel >= 0) {
170-
if(wsi->getLevelWidth(useLevel) < width || wsi->getLevelHeight(useLevel) < height) {
171-
// Go further down
172-
--useLevel;
173-
} else if(wsi->getLevelWidth(useLevel) >= 8192 || wsi->getLevelHeight(useLevel) >= 8192) {
170+
if(wsi->getLevelWidth(useLevel) >= 8192 || wsi->getLevelHeight(useLevel) >= 8192) {
174171
// Go back
175172
++useLevel;
176173
break;
174+
} else {
175+
// Go further down
176+
--useLevel;
177177
}
178178
}
179179
if(useLevel < 0)

0 commit comments

Comments
 (0)