]> Creatis software - cpPlugins.git/commitdiff
... v0.1
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 7 Mar 2017 16:50:07 +0000 (11:50 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 7 Mar 2017 16:50:07 +0000 (11:50 -0500)
lib/cpExtensions/Algorithms/DiscontinuityMapImageFilter.hxx

index 877edbc4c42754e88939e0a08ea5e8a711653999..f1786b4d6f43e43fa5bed4d68d424a85e00168b9 100644 (file)
@@ -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