Commit 231a23d9 authored by OTB Bot's avatar OTB Bot

STYLE

parent 2ab61527

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -26,9 +26,9 @@
namespace otb
{
namespace Functor
{
/**
namespace Functor
{
/**
* \class AmplitudePhaseToRGBFunctor
* \brief Function object to compute a color representation of a radar image.
*
......@@ -42,10 +42,10 @@ namespace otb
* and itk::ComplexToPhaseImageFilter for example.
*
*/
template< class TInput1, class TInput2=TInput1, class TInput3=TInput1, class TOutput=TInput1>
class ITK_EXPORT AmplitudePhaseToRGBFunctor
{
public:
template<class TInput1, class TInput2 = TInput1, class TInput3 = TInput1, class TOutput = TInput1>
class ITK_EXPORT AmplitudePhaseToRGBFunctor
{
public:
typedef TOutput RGBPixelType;
typedef typename RGBPixelType::ValueType RGBComponentType;
typedef HSVToRGBFunctor<RGBPixelType> HSVToRGBFunctorType;
......@@ -56,7 +56,7 @@ namespace otb
m_Minimum = 0;
m_Maximum = itk::NumericTraits<ScalarType>::max();
};
~AmplitudePhaseToRGBFunctor(){};
~AmplitudePhaseToRGBFunctor(){}
void SetMaximum(ScalarType max)
{
......@@ -68,20 +68,20 @@ namespace otb
this->m_Minimum = min;
}
inline TOutput operator()( const TInput1 & amplitude, const TInput2 & coherence, const TInput3 & phase) const
inline TOutput operator ()(const TInput1& amplitude, const TInput2& coherence, const TInput3& phase) const
{
// std::cout << amplitude << " - " << phase << std::endl;
double hinc, sinc, vinc;
hinc=0.6/(CONST_2PI);
sinc=0.0;
vinc=0.0;
hinc = 0.6 / (CONST_2PI);
sinc = 0.0;
vinc = 0.0;
double hue, sat, val;
hue = 0.6 - (phase+CONST_PI)*hinc;
sat = 0.6*coherence+0.3;
val = itk::NumericTraits<RGBComponentType>::max()/2
* ( (amplitude-m_Minimum)/(m_Maximum-m_Minimum)+1.0);
hue = 0.6 - (phase + CONST_PI) * hinc;
sat = 0.6 * coherence + 0.3;
val = itk::NumericTraits<RGBComponentType>::max() / 2
* ((amplitude - m_Minimum) / (m_Maximum - m_Minimum) + 1.0);
if (amplitude < m_Minimum)
{
......@@ -95,12 +95,12 @@ namespace otb
return m_HSVToRGBFunctor(hue, sat, val);
}
private:
private:
ScalarType m_Maximum;
ScalarType m_Minimum;
HSVToRGBFunctorType m_HSVToRGBFunctor;
};
}
};
}
}
#endif
......@@ -36,12 +36,12 @@ namespace otb
*/
template <class TInputImage, class TOutputImage>
class ITK_EXPORT BSplineDecompositionImageFilter :
public itk::ImageToImageFilter<TInputImage,TOutputImage>
public itk::ImageToImageFilter<TInputImage, TOutputImage>
{
public:
/** Standard class typedefs. */
typedef BSplineDecompositionImageFilter Self;
typedef itk::ImageToImageFilter<TInputImage,TOutputImage> Superclass;
typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
......@@ -49,7 +49,7 @@ public:
itkTypeMacro(BSplineDecompositionImageFilter, ImageToImageFilter);
/** New macro for creation of through a Smart Pointer */
itkNewMacro( Self );
itkNewMacro(Self);
/** Inherit input and output image types from Superclass. */
typedef typename Superclass::InputImageType InputImageType;
......@@ -58,7 +58,7 @@ public:
typedef typename Superclass::OutputImagePointer OutputImagePointer;
/** Dimension underlying input image. */
itkStaticConstMacro(ImageDimension, unsigned int,TInputImage::ImageDimension);
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(OutputImageDimension, unsigned int,
TOutputImage::ImageDimension);
......@@ -72,24 +72,23 @@ public:
protected:
BSplineDecompositionImageFilter();
virtual ~BSplineDecompositionImageFilter() {};
virtual ~BSplineDecompositionImageFilter() {}
void PrintSelf(std::ostream& os, itk::Indent indent) const;
void GenerateData( );
void GenerateData();
/** These are needed by the smoothing spline routine. */
std::vector<double> m_Scratch; // temp storage for processing of Coefficients
typename TInputImage::SizeType m_DataLength; // Image size
unsigned int m_SplineOrder; // User specified spline order (3rd or cubic is the default)
double m_SplinePoles[3];// Poles calculated for a given spline order
double m_SplinePoles[3]; // Poles calculated for a given spline order
int m_NumberOfPoles; // number of poles
double m_Tolerance; // Tolerance used for determining initial causal coefficient
unsigned int m_IteratorDirection; // Direction for iterator incrementing
private:
BSplineDecompositionImageFilter( const Self& ); //purposely not implemented
void operator=( const Self& ); //purposely not implemented
BSplineDecompositionImageFilter(const Self &); //purposely not implemented
void operator =(const Self&); //purposely not implemented
/** Determines the poles given the Spline Order. */
virtual void SetPoles();
......@@ -111,14 +110,13 @@ private:
void CopyImageToImage();
/** Copies a vector of data from the Coefficients image to the m_Scratch vector. */
void CopyCoefficientsToScratch( OutputLinearIterator & );
void CopyCoefficientsToScratch(OutputLinearIterator&);
/** Copies a vector of data from m_Scratch to the Coefficients image. */
void CopyScratchToCoefficients( OutputLinearIterator & );
void CopyScratchToCoefficients(OutputLinearIterator&);
};
} // namespace itk
#ifndef OTB_MANUAL_INSTANTIATION
......@@ -126,4 +124,3 @@ private:
#endif
#endif
......@@ -40,7 +40,6 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
this->SetSplineOrder(SplineOrder);
}
/**
* Standard "PrintSelf" method
*/
......@@ -51,12 +50,11 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
std::ostream& os,
itk::Indent indent) const
{
Superclass::PrintSelf( os, indent );
Superclass::PrintSelf(os, indent);
os << indent << "Spline Order: " << m_SplineOrder << std::endl;
}
template <class TInputImage, class TOutputImage>
bool
BSplineDecompositionImageFilter<TInputImage, TOutputImage>
......@@ -100,7 +98,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
// anticausal initialization
this->SetInitialAntiCausalCoefficient(m_SplinePoles[k]);
// anticausal recursion
for ( int n = m_DataLength[m_IteratorDirection] - 2; 0 <= n; n--)
for (int n = m_DataLength[m_IteratorDirection] - 2; 0 <= n; n--)
{
m_Scratch[n] = m_SplinePoles[k] * (m_Scratch[n + 1] - m_Scratch[n]);
}
......@@ -109,7 +107,6 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
}
template <class TInputImage, class TOutputImage>
void
BSplineDecompositionImageFilter<TInputImage, TOutputImage>
......@@ -125,7 +122,6 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
}
template <class TInputImage, class TOutputImage>
void
BSplineDecompositionImageFilter<TInputImage, TOutputImage>
......@@ -165,14 +161,13 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
default:
// SplineOrder not implemented yet.
itk::ExceptionObject err(__FILE__, __LINE__);
err.SetLocation( ITK_LOCATION);
err.SetDescription( "SplineOrder must be between 0 and 5. Requested spline order has not been implemented yet." );
err.SetLocation(ITK_LOCATION);
err.SetDescription("SplineOrder must be between 0 and 5. Requested spline order has not been implemented yet.");
throw err;
break;
}
}
template <class TInputImage, class TOutputImage>
void
BSplineDecompositionImageFilter<TInputImage, TOutputImage>
......@@ -189,7 +184,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
zn = z;
if (m_Tolerance > 0.0)
{
horizon = (long)vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z)));
horizon = (long) vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z)));
}
if (horizon < m_DataLength[m_IteratorDirection])