Skip to content

Commit e1e653a

Browse files
committed
BUG: Correction of the binarisation
the binarisation is now working with m_Min > 0
1 parent a13e986 commit e1e653a

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

include/itkCoocurrenceTextureFeaturesImageFilter.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,18 @@ class ITK_TEMPLATE_EXPORT CoocurrenceTextureFeaturesImageFilter:public ImageToIm
278278
inline typename DigitalisedImageType::PixelType operator()(const MaskPixelType & maskPixel,
279279
const PixelType & inputPixel) const
280280
{
281+
281282
if(maskPixel != m_MaskValue)
282283
{
283-
return this->m_Min - 10;
284+
return - 10;
284285
}
285286
else if (inputPixel < this->m_Min || inputPixel >= m_Max)
286287
{
287-
return m_Min - 1;
288+
return - 1;
288289
}
289290
else
290291
{
291-
return (inputPixel - m_Min)/((m_Max-m_Min)/ (float)m_NumberOfBinsPerAxis);
292+
return ((inputPixel - m_Min)/((m_Max-m_Min)/ (float)m_NumberOfBinsPerAxis));
292293
}
293294
}
294295

include/itkCoocurrenceTextureFeaturesImageFilter.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ CoocurrenceTextureFeaturesImageFilter<TInputImage, TOutputImage>
178178
while( !inputNIt.IsAtEnd() )
179179
{
180180
// If the voxel is outside of the mask, don't treat it
181-
if( inputNIt.GetCenterPixel() < (this->m_Min - 5) ) //the pixel is outside of the mask
181+
if( inputNIt.GetCenterPixel() < ( - 5) ) //the pixel is outside of the mask
182182
{
183183
progress.CompletedPixel();
184184
++inputNIt;
@@ -198,7 +198,7 @@ CoocurrenceTextureFeaturesImageFilter<TInputImage, TOutputImage>
198198
{
199199
// Test if the curent voxel is in the mask and is the range of the image intensity sepcified
200200
curentInNeighborhoodPixelIntensity = inputNIt.GetPixel(nb);
201-
if( curentInNeighborhoodPixelIntensity < this->m_Min )
201+
if( curentInNeighborhoodPixelIntensity < 0 )
202202
{
203203
continue;
204204
}
@@ -222,7 +222,7 @@ CoocurrenceTextureFeaturesImageFilter<TInputImage, TOutputImage>
222222

223223
// Test if the pointed voxel is in the mask and is the range of the image intensity sepcified
224224
pixelIntensity = inputNIt.GetPixel(tempOffset);
225-
if(pixelIntensity< this->m_Min )
225+
if(pixelIntensity< 0 )
226226
{
227227
continue;
228228
}

include/itkRunLengthTextureFeaturesImageFilter.hxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ RunLengthTextureFeaturesImageFilter<TInputImage, TOutputImage>
9191
{
9292
if( maskPointer && maskPointer->GetPixel( inputIt.GetIndex() ) != this->m_InsidePixelValue )
9393
{
94-
digitIt.Set(this->m_Min - 10);
94+
digitIt.Set(-10);
9595
}
9696
else if(inputIt.Get() < this->m_Min || inputIt.Get() >= this->m_Max)
9797
{
98-
digitIt.Set(this->m_Min - 1);
98+
digitIt.Set(-1);
9999
}
100100
else
101101
{
@@ -196,7 +196,7 @@ RunLengthTextureFeaturesImageFilter<TInputImage, TOutputImage>
196196
while( !inputNIt.IsAtEnd() )
197197
{
198198
// If the voxel is outside of the mask, don't treat it
199-
if( inputNIt.GetCenterPixel() < (this->m_Min - 5) ) //the pixel is outside of the mask
199+
if( inputNIt.GetCenterPixel() < ( - 5) ) //the pixel is outside of the mask
200200
{
201201
progress.CompletedPixel();
202202
++inputNIt;
@@ -224,7 +224,7 @@ RunLengthTextureFeaturesImageFilter<TInputImage, TOutputImage>
224224
curentInNeighborhoodPixelIntensity = inputNIt.GetPixel(nb);
225225
tempOffset = inputNIt.GetOffset(nb);
226226
// Cecking if the value is out-of-bounds or is outside the mask.
227-
if( curentInNeighborhoodPixelIntensity < this->m_Min || //the pixel is outside of the mask or outside of bounds
227+
if( curentInNeighborhoodPixelIntensity < 0 || //the pixel is outside of the mask or outside of bounds
228228
alreadyVisitedImage->GetPixel( boolCurentInNeighborhoodIndex + tempOffset) )
229229
{
230230
continue;

0 commit comments

Comments
 (0)