+ if( !( this->IsInsideBuffer( index ) ) )
+ return( false );
+
+ const I* image = this->GetInputImage( );
+ double w2 = this->m_Window / double( 2 );
+ double min = this->m_Level - w2;
+ double max = this->m_Level + w2;
+ unsigned char val = double( 0 );
+ double x = double( image->GetPixel( index ) );
+ double m = double( 100 ) / this->m_Window;
+ double b = ( this->m_Window - ( double( 2 ) * this->m_Level ) );
+ b *= double( 50 ) / this->m_Window;
+ if( x > min && x < max )
+ val = ( unsigned char )( ( m * x ) + b );
+
+ if( this->m_Start )
+ {
+ this->m_StartValue = val;
+ this->m_Start = false;
+ return( true );
+ }
+ else
+ return( std::abs( this->m_StartValue - val ) <= 2 );