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,81 +26,81 @@
namespace otb
{
namespace Functor
{
/**
* \class AmplitudePhaseToRGBFunctor
* \brief Function object to compute a color representation of a radar image.
*
* This class is useful for visualizing radar images with a combination of
* the phase and the amplitude at the same time.
*
* The amplitude is used to represent the intensity of the pixel and the phase
* to represent it's hue.
*
* Amplitude and phase can be obtained using the itk::ComplexToModulusImageFilter
* and itk::ComplexToPhaseImageFilter for example.
*
*/
template< class TInput1, class TInput2=TInput1, class TInput3=TInput1, class TOutput=TInput1>
class ITK_EXPORT AmplitudePhaseToRGBFunctor
namespace Functor
{
/**
* \class AmplitudePhaseToRGBFunctor
* \brief Function object to compute a color representation of a radar image.
*
* This class is useful for visualizing radar images with a combination of
* the phase and the amplitude at the same time.
*
* The amplitude is used to represent the intensity of the pixel and the phase
* to represent it's hue.
*
* Amplitude and phase can be obtained using the itk::ComplexToModulusImageFilter
* and itk::ComplexToPhaseImageFilter for example.
*
*/
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;
typedef TInput1 ScalarType;
AmplitudePhaseToRGBFunctor()
{
public:
typedef TOutput RGBPixelType;
typedef typename RGBPixelType::ValueType RGBComponentType;
typedef HSVToRGBFunctor<RGBPixelType> HSVToRGBFunctorType;
typedef TInput1 ScalarType;
AmplitudePhaseToRGBFunctor()
{
m_Minimum = 0;
m_Maximum = itk::NumericTraits<ScalarType>::max();
};
~AmplitudePhaseToRGBFunctor(){};
void SetMaximum(ScalarType max)
{
this->m_Maximum = max;
}
void SetMinimum(ScalarType min)
{
this->m_Minimum = min;
}
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;
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);
if (amplitude < m_Minimum)
{
val = 0;
}
if (amplitude > m_Maximum)
{
val = itk::NumericTraits<RGBComponentType>::max();
}
return m_HSVToRGBFunctor(hue, sat, val);
}
private:
ScalarType m_Maximum;
ScalarType m_Minimum;
HSVToRGBFunctorType m_HSVToRGBFunctor;
m_Minimum = 0;
m_Maximum = itk::NumericTraits<ScalarType>::max();
};
~AmplitudePhaseToRGBFunctor(){}
void SetMaximum(ScalarType max)
{
this->m_Maximum = max;
}
void SetMinimum(ScalarType min)
{
this->m_Minimum = min;
}
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;
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);
if (amplitude < m_Minimum)
{
val = 0;
}
if (amplitude > m_Maximum)
{
val = itk::NumericTraits<RGBComponentType>::max();
}
return m_HSVToRGBFunctor(hue, sat, val);
}
private:
ScalarType m_Maximum;
ScalarType m_Minimum;
HSVToRGBFunctorType m_HSVToRGBFunctor;
};
}
}
#endif
......@@ -36,29 +36,29 @@ 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::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef BSplineDecompositionImageFilter Self;
typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Run-time type information (and related methods). */
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;
typedef typename Superclass::InputImagePointer InputImagePointer;
typedef typename Superclass::InputImageType InputImageType;
typedef typename Superclass::InputImagePointer InputImagePointer;
typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
typedef typename Superclass::OutputImagePointer OutputImagePointer;
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
int m_NumberOfPoles; // number of poles
double m_Tolerance; // Tolerance used for determining initial causal coefficient
unsigned int m_IteratorDirection; // Direction for iterator incrementing
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
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();
......