Commit 3ba66e74 authored by Emmanuel Christophe's avatar Emmanuel Christophe

STYLE: removing trailing spaces (Code)

parent fd444d90
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -35,7 +35,7 @@ namespace otb
* \ingroup ImageFilters
*/
template <class TInputImage, class TOutputImage>
class ITK_EXPORT BSplineDecompositionImageFilter :
class ITK_EXPORT BSplineDecompositionImageFilter :
public itk::ImageToImageFilter<TInputImage,TOutputImage>
{
public:
......@@ -47,7 +47,7 @@ public:
/** Run-time type information (and related methods). */
itkTypeMacro(BSplineDecompositionImageFilter, ImageToImageFilter);
/** New macro for creation of through a Smart Pointer */
itkNewMacro( Self );
......@@ -115,7 +115,7 @@ private:
/** Copies a vector of data from m_Scratch to the Coefficients image. */
void CopyScratchToCoefficients( OutputLinearIterator & );
};
......
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -48,7 +48,7 @@ template <class TInputImage, class TOutputImage>
void
BSplineDecompositionImageFilter<TInputImage, TOutputImage>
::PrintSelf(
std::ostream& os,
std::ostream& os,
itk::Indent indent) const
{
Superclass::PrintSelf( os, indent );
......@@ -61,13 +61,13 @@ template <class TInputImage, class TOutputImage>
bool
BSplineDecompositionImageFilter<TInputImage, TOutputImage>
::DataToCoefficients1D()
{
{
// See Unser, 1993, Part II, Equation 2.5,
// or Unser, 1999, Box 2. for an explaination.
// See Unser, 1993, Part II, Equation 2.5,
// or Unser, 1999, Box 2. for an explaination.
double c0 = 1.0;
double c0 = 1.0;
if (m_DataLength[m_IteratorDirection] == 1) //Required by mirror boundaries
{
return false;
......@@ -76,30 +76,30 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
// Compute overall gain
for (int k = 0; k < m_NumberOfPoles; k++)
{
// Note for cubic splines lambda = 6
// Note for cubic splines lambda = 6
c0 = c0 * (1.0 - m_SplinePoles[k]) * (1.0 - 1.0 / m_SplinePoles[k]);
}
// apply the gain
// apply the gain
for (unsigned int n = 0; n < m_DataLength[m_IteratorDirection]; n++)
{
m_Scratch[n] *= c0;
}
// loop over all poles
for (int k = 0; k < m_NumberOfPoles; k++)
// loop over all poles
for (int k = 0; k < m_NumberOfPoles; k++)
{
// causal initialization
// causal initialization
this->SetInitialCausalCoefficient(m_SplinePoles[k]);
// causal recursion
// causal recursion
for (unsigned int n = 1; n < m_DataLength[m_IteratorDirection]; n++)
{
m_Scratch[n] += m_SplinePoles[k] * m_Scratch[n - 1];
}
// anticausal initialization
// anticausal initialization
this->SetInitialAntiCausalCoefficient(m_SplinePoles[k]);
// anticausal recursion
// anticausal recursion
for ( int n = m_DataLength[m_IteratorDirection] - 2; 0 <= n; n--)
{
m_Scratch[n] = m_SplinePoles[k] * (m_Scratch[n + 1] - m_Scratch[n]);
......@@ -132,7 +132,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
::SetPoles()
{
/* See Unser, 1997. Part II, Table I for Pole values */
// See also, Handbook of Medical Imaging, Processing and Analysis, Ed. Isaac N. Bankman,
// See also, Handbook of Medical Imaging, Processing and Analysis, Ed. Isaac N. Bankman,
// 2000, pg. 416.
switch (m_SplineOrder)
{
......@@ -195,7 +195,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
{
/* accelerated loop */
sum = m_Scratch[0]; // verify this
for (unsigned int n = 1; n < horizon; n++)
for (unsigned int n = 1; n < horizon; n++)
{
sum += zn * m_Scratch[n];
zn *= z;
......@@ -224,11 +224,11 @@ void
BSplineDecompositionImageFilter<TInputImage, TOutputImage>
::SetInitialAntiCausalCoefficient(double z)
{
// this initialization corresponds to mirror boundaries
// this initialization corresponds to mirror boundaries
/* See Unser, 1999, Box 2 for explaination */
// Also see erratum at http://bigwww.epfl.ch/publications/unser9902.html
m_Scratch[m_DataLength[m_IteratorDirection] - 1] =
(z / (z * z - 1.0)) *
(z / (z * z - 1.0)) *
(z * m_Scratch[m_DataLength[m_IteratorDirection] - 2] + m_Scratch[m_DataLength[m_IteratorDirection] - 1]);
}
......@@ -266,7 +266,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
// Perform 1D BSpline calculations
this->DataToCoefficients1D();
// Copy scratch back to coefficients.
// Brings us back to the end of the line we were working on.
CIterator.GoToBeginOfLine();
......@@ -303,7 +303,7 @@ BSplineDecompositionImageFilter<TInputImage, TOutputImage>
++inIt;
++outIt;
}
}
......
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -41,11 +41,11 @@ namespace otb
* \ingroup ImageFunctions
*/
template <
class TImageType,
class TImageType,
class TCoordRep = double,
class TCoefficientType = double >
class ITK_EXPORT BSplineInterpolateImageFunction :
public itk::InterpolateImageFunction<TImageType,TCoordRep>
class ITK_EXPORT BSplineInterpolateImageFunction :
public itk::InterpolateImageFunction<TImageType,TCoordRep>
{
public:
/** Standard class typedefs. */
......@@ -57,7 +57,7 @@ public:
/** Run-time type information (and related methods). */
itkTypeMacro(BSplineInterpolateImageFunction, InterpolateImageFunction);
/** New macro for creation of through a Smart Pointer */
itkNewMacro( Self );
......@@ -87,25 +87,25 @@ typedef typename InputImageType::RegionType RegionType;
/** Internal Coefficient typedef support */
typedef TCoefficientType CoefficientDataType;
typedef itk::Image<CoefficientDataType,
typedef itk::Image<CoefficientDataType,
itkGetStaticConstMacro(ImageDimension)
> CoefficientImageType;
/** Define filter for calculating the BSpline coefficients */
typedef otb::BSplineDecompositionImageFilter<TImageType, CoefficientImageType>
typedef otb::BSplineDecompositionImageFilter<TImageType, CoefficientImageType>
CoefficientFilter;
typedef typename CoefficientFilter::Pointer CoefficientFilterPointer;
/** Evaluate the function at a ContinuousIndex position.
*
* Returns the B-Spline interpolated image intensity at a
* Returns the B-Spline interpolated image intensity at a
* specified point position. No bounds checking is done.
* The point is assume to lie within the image buffer.
*
* ImageFunction::IsInsideBuffer() can be used to check bounds before
* calling the method. */
virtual OutputType EvaluateAtContinuousIndex(
const ContinuousIndexType & index ) const;
virtual OutputType EvaluateAtContinuousIndex(
const ContinuousIndexType & index ) const;
/** Derivative typedef support */
typedef itk::CovariantVector<OutputType,
......@@ -113,13 +113,13 @@ typedef typename InputImageType::RegionType RegionType;
> CovariantVectorType;
CovariantVectorType EvaluateDerivative( const PointType & point ) const
{
{
ContinuousIndexType index;
this->GetInputImage()->TransformPhysicalPointToContinuousIndex( point, index );
return ( this->EvaluateDerivativeAtContinuousIndex( index ) );
}
}
CovariantVectorType EvaluateDerivativeAtContinuousIndex(
CovariantVectorType EvaluateDerivativeAtContinuousIndex(
const ContinuousIndexType & x ) const;
......@@ -133,7 +133,7 @@ typedef typename InputImageType::RegionType RegionType;
virtual void SetInputImage(const TImageType * inputData);
/** Update coefficients filter. Coefficient filter are computed over the buffered
/** Update coefficients filter. Coefficient filter are computed over the buffered
region of the input image. */
virtual void UpdateCoefficientsFilter(void);
......@@ -148,34 +148,34 @@ protected:
typename TImageType::SizeType m_DataLength; // Image size
unsigned int m_SplineOrder; // User specified spline order (3rd or cubic is the default)
typename CoefficientImageType::ConstPointer m_Coefficients; // Spline coefficients
typename CoefficientImageType::ConstPointer m_Coefficients; // Spline coefficients
private:
BSplineInterpolateImageFunction( const Self& ); //purposely not implemented
/** Determines the weights for interpolation of the value x */
void SetInterpolationWeights( const ContinuousIndexType & x,
const vnl_matrix<long> & EvaluateIndex,
vnl_matrix<double> & weights,
void SetInterpolationWeights( const ContinuousIndexType & x,
const vnl_matrix<long> & EvaluateIndex,
vnl_matrix<double> & weights,
unsigned int splineOrder ) const;
/** Determines the weights for the derivative portion of the value x */
void SetDerivativeWeights( const ContinuousIndexType & x,
const vnl_matrix<long> & EvaluateIndex,
vnl_matrix<double> & weights,
void SetDerivativeWeights( const ContinuousIndexType & x,
const vnl_matrix<long> & EvaluateIndex,
vnl_matrix<double> & weights,
unsigned int splineOrder ) const;
/** Precomputation for converting the 1D index of the interpolation neighborhood
/** Precomputation for converting the 1D index of the interpolation neighborhood
* to an N-dimensional index. */
void GeneratePointsToIndex( );
/** Determines the indicies to use give the splines region of support */
void DetermineRegionOfSupport( vnl_matrix<long> & evaluateIndex,
const ContinuousIndexType & x,
void DetermineRegionOfSupport( vnl_matrix<long> & evaluateIndex,
const ContinuousIndexType & x,
unsigned int splineOrder ) const;
/** Set the indicies in evaluateIndex at the boundaries based on mirror
/** Set the indicies in evaluateIndex at the boundaries based on mirror
* boundary conditions. */
void ApplyMirrorBoundaryConditions(vnl_matrix<long> & evaluateIndex,
void ApplyMirrorBoundaryConditions(vnl_matrix<long> & evaluateIndex,
unsigned int splineOrder) const;
......@@ -186,7 +186,7 @@ private:
CoefficientFilterPointer m_CoefficientFilter;
RegionType m_CurrentBufferedRegion;
};
} // namespace otb
......
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -26,12 +26,12 @@ namespace otb
/**
* \class BinaryImageMinimalBoundingRegionCalculator
* \brief This class compute the smallest region of the image
* containing every pixel with the foreground value.
* containing every pixel with the foreground value.
*
* This class is used for instance in the RCC8 calculator filter,
* where the input region used for computation has to be the smallest possible
* for costs reasons. The Pad arg allows the user to get a region of pad pixel larger
* at each bound in case a security margin has to be kept.
* at each bound in case a security margin has to be kept.
*
* \sa ImageToImageRCC8Calculator
*/
......@@ -60,7 +60,7 @@ public:
itkGetMacro(InsideValue,PixelType);
itkSetMacro(Pad,unsigned int);
itkGetMacro(Pad,unsigned int);
protected:
/** Constructor */
BinaryImageMinimalBoundingRegionCalculator();
......
......@@ -10,8 +10,8 @@
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -29,7 +29,7 @@ namespace otb
*/
template <class TInputImage>
BinaryImageMinimalBoundingRegionCalculator<TInputImage>
::BinaryImageMinimalBoundingRegionCalculator()
::BinaryImageMinimalBoundingRegionCalculator()
{
// The pad option is desactivated by default
m_Pad=0;
......@@ -51,7 +51,7 @@ template <class TInputImage>
void
BinaryImageMinimalBoundingRegionCalculator<TInputImage>
::GenerateData(void)
{
{
// Input images pointers
const InputImageType* image = this->GetInput();
// Iterator definition
......@@ -147,7 +147,7 @@ template <class TInputImage>
void
BinaryImageMinimalBoundingRegionCalculator<TInputImage>
::PrintSelf( std::ostream& os,itk::Indent indent ) const
{
{
Superclass::PrintSelf(os,indent);
}
......
......@@ -10,8 +10,8 @@ Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -36,18 +36,18 @@ class ITK_EXPORT ChangeLabelImageFilter
typedef itk::ChangeLabelImageFilter<TInputImage,TOutputImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Type macro */
itkNewMacro(Self);