Skip to content

Commit 98e0c70

Browse files
committed
BUG: Skip single pixel textures
fixes #68
1 parent 1d684ae commit 98e0c70

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

include/itkCoocurrenceTextureFeaturesImageFilter.hxx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,14 @@ CoocurrenceTextureFeaturesImageFilter<TInputImage, TOutputImage, TMaskImage>
228228
++hist[currentInNeighborhoodPixelIntensity][pixelIntensity];
229229
}
230230
}
231-
// Compute the run length features
232-
this->ComputeFeatures( hist, totalNumberOfFreq, outputPixel);
233-
outputIt.Set(outputPixel);
231+
232+
// No coocurrences means we are computing the texture of a single pixel, which is undefined
233+
if ( totalNumberOfFreq != 0 )
234+
{
235+
// Compute the run length features
236+
this->ComputeFeatures( hist, totalNumberOfFreq, outputPixel);
237+
outputIt.Set(outputPixel);
238+
}
234239

235240
++inputNIt;
236241
++outputIt;

0 commit comments

Comments
 (0)