Commit a7e87a13 authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: make sure output iterator runs over the whole requested region

parent 3080885b
......@@ -260,8 +260,7 @@ ImageClassificationFilter<TInputImage, TOutputImage, TMaskImage>
typename TargetListSampleType::ConstIterator labIt = labels->Begin();
maskIt.GoToBegin();
for (outIt.GoToBegin(); labIt!=labels->End() && !outIt.IsAtEnd();
++outIt)
for (outIt.GoToBegin(); !outIt.IsAtEnd(); ++outIt)
{
double confidenceIndex = 0.0;
TargetValueType labelValue(m_DefaultLabel);
......@@ -270,7 +269,7 @@ ImageClassificationFilter<TInputImage, TOutputImage, TMaskImage>
validPoint = maskIt.Get() > 0;
++maskIt;
}
if (validPoint)
if (validPoint && labIt!=labels->End())
{
labelValue = labIt.GetMeasurementVector()[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment