Skip to content
Snippets Groups Projects
Commit ea27ec5b authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

STYLE : changes thanks to luc review

parent 9db24bc9
No related branches found
No related tags found
No related merge requests found
......@@ -110,8 +110,8 @@ protected :
typename InputImageType::IndexType index);
private :
ApplyGainFilter(const Self &); //purposely not implemented
void operator =(const Self&); //purposely not implemented
ApplyGainFilter(const Self &) = delete ;
void operator =(const Self&) = delete ;
InputPixelType m_NoData;
InputPixelType m_Min;
......
......@@ -131,20 +131,22 @@ void ApplyGainFilter < TInputImage , TLut , TOutputImage >
unsigned int pixelLutValue(0);
float gain(0.0);
InputPixelType currentPixel(0);
while ( !oit.IsAtEnd() )
{
if( ( it.Get() == m_NoData && m_NoDataFlag ) ||
it.Get() > m_Max || it.Get() < m_Min )
currentPixel = it.Get();
if( !(( currentPixel == m_NoData && m_NoDataFlag ) ||
currentPixel > m_Max || currentPixel < m_Min ))
{
oit.Set( static_cast<OutputPixelType>( it.Get() ) );
oit.Set( static_cast<OutputPixelType>( currentPixel ) );
++it;
++oit;
continue;
}
pixelLutValue = static_cast< unsigned int > (
std::round( ( it.Get() - m_Min ) / m_Step ) );
std::round( ( currentPixel - m_Min ) / m_Step ) );
gain = InterpolateGain( lut , pixelLutValue , it.GetIndex() );
oit.Set( static_cast<OutputPixelType>( gain * it.Get() ) );
oit.Set( static_cast<OutputPixelType>( gain * currentPixel ) );
++it;
++oit;
}
......
......@@ -69,8 +69,8 @@ protected:
itk::ThreadIdType itkNotUsed(threadId) ) override{}
private:
BufferFilter(const Self &); //purposely not implemented
void operator =(const Self&); //purposely not implemented
BufferFilter(const Self &) = delete ;
void operator =(const Self&) = delete ;
};
......
......@@ -107,8 +107,8 @@ protected:
bool IsValid(const HistoType & inputHisto ) ;
private:
ComputeGainLutFilter(const Self &) ; //purposely not implemented
void operator =(const Self&) ; //purposely not implemented
ComputeGainLutFilter(const Self &) = delete ;
void operator =(const Self&) = delete ;
double m_Min;
double m_Max;
......
......@@ -173,9 +173,7 @@ bool ComputeGainLutFilter < TInputImage , TOutputImage >
{
acc+= inputHisto[i] ;
}
if ( acc < 0.5 * m_NbPixel )
return false;
return true;
return acc >= (0.5 * m_NbPixel);
}
/**
......
......@@ -133,8 +133,8 @@ protected:
unsigned int total );
private:
ComputeHistoFilter(const Self &); //purposely not implemented
void operator =(const Self&); //purposely not implemented
ComputeHistoFilter(const Self &) = delete ;
void operator =(const Self&) = delete ;
std::vector< typename OutputImageType::PixelType > m_HistoThread;
InputPixelType m_Min;
......
......@@ -268,17 +268,19 @@ void ComputeHistoFilter < TInputImage , TOutputImage >
typename itk::ImageRegionConstIterator < InputImageType >
it( input ,region );
it.GoToBegin();
InputPixelType currentPixel(0);
while ( !it.IsAtEnd() )
{
if( ( it.Get() == m_NoData && m_NoDataFlag ) ||
it.Get() > m_Max || it.Get() < m_Min )
currentPixel = it.Get();
if( ( currentPixel == m_NoData && m_NoDataFlag ) ||
currentPixel > m_Max || currentPixel < m_Min )
{
++it;
continue;
}
pixel = static_cast< unsigned int >(
std::round( ( it.Get() - m_Min ) / m_Step ) );
std::round( ( currentPixel - m_Min ) / m_Step ) );
++m_HistoThread[threadIndex + nthHisto][pixel];
++it;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment