From 61b3659afe961ed248f30e26f9ca8f28fcfafddc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Tue, 7 Mar 2017 11:50:07 -0500 Subject: [PATCH] ... --- .../Algorithms/DiscontinuityMapImageFilter.hxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/cpExtensions/Algorithms/DiscontinuityMapImageFilter.hxx b/lib/cpExtensions/Algorithms/DiscontinuityMapImageFilter.hxx index 877edbc..f1786b4 100644 --- a/lib/cpExtensions/Algorithms/DiscontinuityMapImageFilter.hxx +++ b/lib/cpExtensions/Algorithms/DiscontinuityMapImageFilter.hxx @@ -57,7 +57,7 @@ ThreadedGenerateData( const TRegion& region, itk::ThreadIdType threadId ) for( fit = faceList.begin( ); fit != faceList.end( ); ++fit ) { bit = itk::ConstNeighborhoodIterator< TInputImage >( this->GetRadius( ), input, *fit ); - neighborhoodSize = bit.Size( ); + neighborhoodSize = TOutputPixel( bit.Size( ) ); it = itk::ImageRegionIterator< TOutputImage >( output, *fit ); bit.OverrideBoundaryCondition( &nbc ); bit.GoToBegin( ); @@ -71,10 +71,9 @@ ThreadedGenerateData( const TRegion& region, itk::ThreadIdType threadId ) sum1 += v; sum2 += v * v; } - TOutputPixel mean = ( sum1 / TOutputPixel( neighborhoodSize ) ); TOutputPixel var = - ( sum2 - ( ( sum1 * sum1 ) / TOutputPixel( neighborhoodSize ) ) ) / - ( TOutputPixel( neighborhoodSize ) - TOutputPixel( 1 ) ); + ( sum2 - ( ( sum1 * sum1 ) / neighborhoodSize ) ) / + ( neighborhoodSize - TOutputPixel( 1 ) ); if( this->m_UseSquareRoot ) it.Set( std::sqrt( double( var ) ) ); else -- 2.47.1