Commit 454b24fc authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

STYLE: no space before ;

parent 8a2c2a5a
......@@ -88,7 +88,7 @@ class ITK_EXPORT BinaryImageDensityFunction :
{
IndexType index;
this->ConvertContinuousIndexToNearestIndex( cindex, index );
return this->EvaluateAtIndex( index ) ;
return this->EvaluateAtIndex( index );
}
/** Get/Set the radius of the neighborhood over which the
......
......@@ -94,9 +94,9 @@ BinaryImageDensityFunction<TInputImage,TCoordRep>
}
const RealType num = static_cast<RealType>( size );
var = sum/num ;
var = sum/num ;
return var ;
return var;
}
......
......@@ -70,7 +70,7 @@ BinaryImageMinimalBoundingRegionCalculator<TInputImage>
fit.SetFirstDirection( !axis );
fit.SetSecondDirection( axis );
fit.GoToBegin();
;
;
// Walk through the two images line by line
while (!fit.IsAtEnd())
{
......
......@@ -73,7 +73,7 @@ public:
/** Main computation method */
virtual void ThreadedGenerateData( const InputImageRegionType &outputRegionForThread, int threadId ) ;
virtual void ThreadedGenerateData( const InputImageRegionType &outputRegionForThread, int threadId );
virtual void BeforeThreadedGenerateData();
virtual void GenerateInputRequestedRegion();
......
......@@ -45,7 +45,7 @@ public:
/** Standard class typedefs. */
typedef EdgeDensityImageFilter Self;
typedef itk::ImageToImageFilter<TInputImage,TOutputImage> Superclass ;
typedef itk::ImageToImageFilter<TInputImage,TOutputImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
......
......@@ -116,7 +116,7 @@ EstimateInnerProductPCAImageFilter<TInputImage,TOutputImage>
for(unsigned int img_number = 0; img_number < numberOfTrainingImages; img_number++ )
{
unsigned int indexNumberOfTrainingImages = numberOfTrainingImages-1;
for( unsigned int vec_number = 0 ; vec_number < m_NumberOfPrincipalComponentsRequired; vec_number++, indexNumberOfTrainingImages-- )
for( unsigned int vec_number = 0 ; vec_number < m_NumberOfPrincipalComponentsRequired; vec_number++, indexNumberOfTrainingImages-- )
{
outputPixel[vec_number] += static_cast<OutputInternalPixelType>( static_cast<double>(inputPixel[img_number]) * static_cast<double>(m_EigenVectorsOfInnerProductMatrix[img_number][indexNumberOfTrainingImages]));
}
......
......@@ -59,7 +59,7 @@ FunctionWithNeighborhoodToImageFilter<TInputImage,TOutputImage,TFunction>
}
m_Function->SetInputImage(inputPtr);
for(unsigned int i = 0 ; i<static_cast<unsigned int>(this->GetNumberOfThreads()); i++)
for(unsigned int i = 0; i<static_cast<unsigned int>(this->GetNumberOfThreads()); i++)
{
FunctionPointerType func = m_Function;
m_FunctionList.push_back( func );
......
......@@ -44,7 +44,7 @@ public:
/** Standard class typedefs. */
typedef KeyPointDensityImageFilter Self;
typedef itk::ImageToImageFilter<TInputImage,TOutputImage> Superclass ;
typedef itk::ImageToImageFilter<TInputImage,TOutputImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
......
......@@ -62,7 +62,7 @@ KeyPointDensityImageFilter<TInputImage, TOutputImage, TDetector >
typename Superclass::OutputImagePointer outputImage = this->GetOutput();
InputImagePointerType ptr = const_cast<InputImageType *>(this->GetInput());
if (!ptr)
return ;
return;
/** Detector*/
m_Detector->SetInput(ptr);
......
......@@ -54,17 +54,17 @@ public:
typedef itk::SmartPointer<const Self> ConstPointer;
/** Run-time type information (and related methods). */
itkTypeMacro(ListSampleToHistogramListGenerator, Object) ;
itkTypeMacro(ListSampleToHistogramListGenerator, Object);
/** Method for creation through the object factory. */
itkNewMacro(Self) ;
itkNewMacro(Self);
/** Type needed for defining the limits of the histogram bins */
typedef typename itk::NumericTraits
< THistogramMeasurement >::RealType HistogramMeasurementRealType;
typedef itk::Statistics::Histogram< HistogramMeasurementRealType,1,
TFrequencyContainer > HistogramType ;
typedef typename HistogramType::SizeType HistogramSizeType ;
TFrequencyContainer > HistogramType;
typedef typename HistogramType::SizeType HistogramSizeType;
typedef typename TListSample::MeasurementVectorType MeasurementVectorType;
typedef ObjectList<HistogramType> HistogramListType;
typedef typename HistogramListType::Pointer HistogramListPointerType;
......@@ -72,11 +72,11 @@ public:
/** plug in the ListSample object */
void SetListSample(const TListSample* list)
{
m_List = list ;
m_List = list;
}
void SetMarginalScale(float scale)
{ m_MarginalScale = scale ; }
{ m_MarginalScale = scale; }
void SetNumberOfBins(unsigned int size)
{
......@@ -84,10 +84,10 @@ public:
}
HistogramListType* GetOutput() const
{ return m_HistogramList ; }
{ return m_HistogramList; }
void Update()
{ this->GenerateData() ; }
{ this->GenerateData(); }
itkSetMacro(AutoMinMax,bool);
itkGetConstReferenceMacro(AutoMinMax,bool);
......@@ -106,21 +106,21 @@ public:
protected:
ListSampleToHistogramListGenerator() ;
ListSampleToHistogramListGenerator();
virtual ~ListSampleToHistogramListGenerator() {}
void GenerateData() ;
void GenerateData();
void PrintSelf(std::ostream& os, itk::Indent indent) const;
private:
const TListSample* m_List ;
const TListSample* m_List;
HistogramSizeType m_Size;
float m_MarginalScale ;
float m_MarginalScale;
MeasurementVectorType m_HistogramMin;
MeasurementVectorType m_HistogramMax;
bool m_AutoMinMax;
HistogramListPointerType m_HistogramList;
} ; // end of class
}; // end of class
} // end of namespace itk
......
......@@ -36,7 +36,7 @@ ListSampleToHistogramListGenerator< TListSample,
TFrequencyContainer >
::ListSampleToHistogramListGenerator() : m_List(), m_Size(), m_MarginalScale(100), m_HistogramMin(), m_HistogramMax(), m_AutoMinMax(true), m_HistogramList()
{
m_HistogramList = HistogramListType::New() ;
m_HistogramList = HistogramListType::New();
m_Size.Fill(255);
}
......@@ -77,18 +77,18 @@ ListSampleToHistogramListGenerator< TListSample,
if( m_AutoMinMax && m_List->Size() != 0 )
{
FindSampleBound(m_List, m_List->Begin(),
m_List->End(), lower, upper) ;
float margin ;
m_List->End(), lower, upper);
float margin;
for ( unsigned int i = 0 ; i < m_List->GetMeasurementVectorSize() ; i++ )
for ( unsigned int i = 0; i < m_List->GetMeasurementVectorSize(); i++ )
{
if ( !itk::NumericTraits< THistogramMeasurement >::is_integer )
{
margin =
( (THistogramMeasurement)(upper[i] - lower[i]) /
(THistogramMeasurement) m_Size[0] ) /
(THistogramMeasurement) m_MarginalScale ;
h_upper[i] = (THistogramMeasurement) (upper[i] + margin) ;
(THistogramMeasurement) m_MarginalScale;
h_upper[i] = (THistogramMeasurement) (upper[i] + margin);
if(h_upper[i] <= upper[i])
{
// an overflow has occurred therefore set upper to upper
......@@ -103,7 +103,7 @@ ListSampleToHistogramListGenerator< TListSample,
else
{
h_upper[i] = ((THistogramMeasurement) upper[i]) +
itk::NumericTraits< THistogramMeasurement >::One ;
itk::NumericTraits< THistogramMeasurement >::One;
if(h_upper[i] <= upper[i])
{
// an overflow has occurred therefore set upper to upper
......@@ -115,7 +115,7 @@ ListSampleToHistogramListGenerator< TListSample,
// computation and clearly the user intended to include min and max.
}
}
h_lower[i] = ( THistogramMeasurement) lower[i] ;
h_lower[i] = ( THistogramMeasurement) lower[i];
}
}
else
......@@ -128,7 +128,7 @@ ListSampleToHistogramListGenerator< TListSample,
m_HistogramList->Clear();
// For each dimension
for(unsigned int comp = 0; comp<m_List->GetMeasurementVectorSize() ;++comp)
for(unsigned int comp = 0; comp<m_List->GetMeasurementVectorSize();++comp)
{
// initialize the Histogram object using the sizes and
// the upper and lower bound from the FindSampleBound function
......@@ -141,11 +141,11 @@ ListSampleToHistogramListGenerator< TListSample,
// Create a new histogrma for this component
m_HistogramList->PushBack(HistogramType::New());
m_HistogramList->Back()->SetClipBinsAtEnds(clipBinsAtEnds);
m_HistogramList->Back()->Initialize(m_Size, comp_lower, comp_upper) ;
m_HistogramList->Back()->Initialize(m_Size, comp_lower, comp_upper);
typename TListSample::ConstIterator iter = m_List->Begin() ;
typename TListSample::ConstIterator last = m_List->End() ;
typename HistogramType::IndexType index ;
typename TListSample::ConstIterator iter = m_List->Begin();
typename TListSample::ConstIterator last = m_List->End();
typename HistogramType::IndexType index;
typename HistogramType::MeasurementVectorType hvector;
while (iter != last)
......@@ -161,9 +161,9 @@ ListSampleToHistogramListGenerator< TListSample,
// bin value.
// If the index isn't valid, we don't increase the frequency.
// See the comments in Histogram->GetIndex() for more info.
m_HistogramList->Back()->IncreaseFrequency(index, 1) ;
m_HistogramList->Back()->IncreaseFrequency(index, 1);
}
++iter ;
++iter;
}
}
otbMsgDebugMacro(<<"ListSampleToHistogramListGenerator::GenerateData(): Leaving");
......
......@@ -59,38 +59,38 @@ public:
typedef itk::SmartPointer<const Self> ConstPointer;
/** Run-time type information (and related methods). */
itkTypeMacro(ListSampleToVariableDimensionHistogramGenerator, Object) ;
itkTypeMacro(ListSampleToVariableDimensionHistogramGenerator, Object);
/** Method for creation through the object factory. */
itkNewMacro(Self) ;
itkNewMacro(Self);
/** Type needed for defining the limits of the histogram bins */
typedef typename itk::NumericTraits< THistogramMeasurement >::RealType
HistogramMeasurementRealType;
typedef itk::Statistics::VariableDimensionHistogram< HistogramMeasurementRealType,
TFrequencyContainer > HistogramType ;
TFrequencyContainer > HistogramType;
typedef typename HistogramType::SizeType HistogramSizeType ;
typedef typename HistogramType::SizeType HistogramSizeType;
typedef typename HistogramType::MeasurementVectorType MeasurementVectorType;
/** plug in the ListSample object */
void SetListSample(const TListSample* list)
{
m_List = list ;
m_List = list;
}
void SetMarginalScale(float scale)
{ m_MarginalScale = scale ; }
{ m_MarginalScale = scale; }
void SetNumberOfBins(HistogramSizeType sizes)
{ m_Sizes = sizes ; }
{ m_Sizes = sizes; }
HistogramType* GetOutput() const
{ return m_Histogram ; }
{ return m_Histogram; }
void Update()
{ this->GenerateData() ; }
{ this->GenerateData(); }
itkSetMacro(AutoMinMax,bool);
itkGetConstReferenceMacro(AutoMinMax,bool);
......@@ -109,21 +109,21 @@ public:
protected:
ListSampleToVariableDimensionHistogramGenerator() ;
ListSampleToVariableDimensionHistogramGenerator();
virtual ~ListSampleToVariableDimensionHistogramGenerator() {}
void GenerateData() ;
void GenerateData();
void PrintSelf(std::ostream& os, itk::Indent indent) const;
private:
const TListSample* m_List ;
typename HistogramType::Pointer m_Histogram ;
HistogramSizeType m_Sizes ;
float m_MarginalScale ;
const TListSample* m_List;
typename HistogramType::Pointer m_Histogram;
HistogramSizeType m_Sizes;
float m_MarginalScale;
MeasurementVectorType m_HistogramMin;
MeasurementVectorType m_HistogramMax;
bool m_AutoMinMax;
} ; // end of class
}; // end of class
} // end of namespace itk
......
......@@ -35,8 +35,8 @@ ListSampleToVariableDimensionHistogramGenerator< TListSample,
TFrequencyContainer >
::ListSampleToVariableDimensionHistogramGenerator()
{
m_Histogram = HistogramType::New() ;
m_MarginalScale = 100 ;
m_Histogram = HistogramType::New();
m_MarginalScale = 100;
m_AutoMinMax = true;
}
......@@ -81,18 +81,18 @@ ListSampleToVariableDimensionHistogramGenerator< TListSample,
if( m_AutoMinMax && m_List->Size() != 0 )
{
FindSampleBound(m_List, m_List->Begin(),
m_List->End(), lower, upper) ;
float margin ;
m_List->End(), lower, upper);
float margin;
for ( unsigned int i = 0 ; i < m_List->GetMeasurementVectorSize() ; i++ )
for ( unsigned int i = 0; i < m_List->GetMeasurementVectorSize(); i++ )
{
if ( !itk::NumericTraits< THistogramMeasurement >::is_integer )
{
margin =
( (THistogramMeasurement)(upper[i] - lower[i]) /
(THistogramMeasurement) m_Sizes[i] ) /
(THistogramMeasurement) m_MarginalScale ;
h_upper[i] = (THistogramMeasurement) (upper[i] + margin) ;
(THistogramMeasurement) m_MarginalScale;
h_upper[i] = (THistogramMeasurement) (upper[i] + margin);
if(h_upper[i] <= upper[i])
{
// an overflow has occurred therefore set upper to upper
......@@ -107,7 +107,7 @@ ListSampleToVariableDimensionHistogramGenerator< TListSample,
else
{
h_upper[i] = ((THistogramMeasurement) upper[i]) +
itk::NumericTraits< THistogramMeasurement >::One ;
itk::NumericTraits< THistogramMeasurement >::One;
if(h_upper[i] <= upper[i])
{
// an overflow has occurred therefore set upper to upper
......@@ -119,7 +119,7 @@ ListSampleToVariableDimensionHistogramGenerator< TListSample,
// computation and clearly the user intended to include min and max.
}
}
h_lower[i] = ( THistogramMeasurement) lower[i] ;
h_lower[i] = ( THistogramMeasurement) lower[i];
}
}
else
......@@ -132,22 +132,22 @@ ListSampleToVariableDimensionHistogramGenerator< TListSample,
// the upper and lower bound from the FindSampleBound function
otbMsgDevMacro(<<"ListSampleToVariableDimensionHistogramGenerator::GenerateData(): Intializing histogram with (sizes= "<<m_Sizes<<", lower = "<<h_lower<<", upper = "<<h_upper<<")");
m_Histogram->Initialize(m_Sizes, h_lower, h_upper) ;
m_Histogram->Initialize(m_Sizes, h_lower, h_upper);
otbMsgDevMacro(<<"ListSampleToVariableDimensionHistogramGenerator::GenerateData(): Histogram initialized");
typename TListSample::ConstIterator iter = m_List->Begin() ;
typename TListSample::ConstIterator last = m_List->End() ;
typename HistogramType::IndexType index(m_List->GetMeasurementVectorSize()) ;
typename TListSample::MeasurementVectorType lvector(m_List->GetMeasurementVectorSize()) ;
typename HistogramType::MeasurementVectorType hvector(m_List->GetMeasurementVectorSize()) ;
typename TListSample::ConstIterator iter = m_List->Begin();
typename TListSample::ConstIterator last = m_List->End();
typename HistogramType::IndexType index(m_List->GetMeasurementVectorSize());
typename TListSample::MeasurementVectorType lvector(m_List->GetMeasurementVectorSize());
typename HistogramType::MeasurementVectorType hvector(m_List->GetMeasurementVectorSize());
unsigned int i;
otbMsgDevMacro(<<"ListSampleToVariableDimensionHistogramGenerator::GenerateData(): Filling the histogram");
while (iter != last)
{
lvector = iter.GetMeasurementVector() ;
for ( i = 0 ; i < m_List->GetMeasurementVectorSize() ; i++)
lvector = iter.GetMeasurementVector();
for ( i = 0; i < m_List->GetMeasurementVectorSize(); i++)
{
hvector[i] = (THistogramMeasurement) lvector[i] ;
hvector[i] = (THistogramMeasurement) lvector[i];
}
m_Histogram->GetIndex(hvector,index);
......@@ -159,9 +159,9 @@ ListSampleToVariableDimensionHistogramGenerator< TListSample,
// bin value.
// If the index isn't valid, we don't increase the frequency.
// See the comments in Histogram->GetIndex() for more info.
m_Histogram->IncreaseFrequency(index, 1) ;
m_Histogram->IncreaseFrequency(index, 1);
}
++iter ;
++iter;
}
otbMsgDebugMacro(<<"ListSampleToVariableDimensionHistogramGenerator::GenerateData(): Leaving");
......
......@@ -40,7 +40,7 @@ public:
{
double value(0.);
if( inPix.Size() <= 0) return static_cast<TOutputValue> (0.);
for (unsigned int i = 0 ; i <inPix.Size() ; i++)
for (unsigned int i = 0; i <inPix.Size(); i++)
{
value += static_cast<double>(inPix[i]);
}
......
......@@ -71,7 +71,7 @@ NormalizeInnerProductPCAImageFilter<TInputImage,TOutputImage>
cov.Cols() << ") is incompatible with mean vector with size" << means.Size() );
}
m_CoefNorm.SetSize(means.Size());
for(unsigned int i=0 ; i<m_CoefNorm.Size() ; i++)
for(unsigned int i=0; i<m_CoefNorm.Size(); i++)
{
m_CoefNorm[i] = (1./vcl_sqrt(NbPixels*(cov[i][i] + means[i]*means[i])));
}
......
......@@ -92,7 +92,7 @@ PointSetToDensityImageFilter< TInputPointSet , TOutputImage>
}
typename OutputImageType::RegionType region;
IndexType start ;
IndexType start;
start.Fill(0);
region.SetSize(this->GetSize());
......
......@@ -93,7 +93,7 @@ protected:
virtual ~DrawLineSpatialObjectListFilter() {};
void PrintSelf(std::ostream& os, itk::Indent indent) const;
virtual void ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, int threadId ) ;
virtual void ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, int threadId );
/**
* compute the intersection of the segment to draw with the region
......
......@@ -83,7 +83,7 @@ DrawLineSpatialObjectListFilter<TInputImage, TOutputImage>
outputIt.GoToBegin();
inputIt.GoToBegin();
for (outputIt.GoToBegin(); !outputIt.IsAtEnd() ; ++outputIt,++inputIt)
for (outputIt.GoToBegin(); !outputIt.IsAtEnd() ; ++outputIt,++inputIt)
outputIt.Set( static_cast<OutputPixelType>(inputIt.Get()) );
/** Draw the lines in the ouput image using lineIterator*/
......@@ -179,7 +179,7 @@ DrawLineSpatialObjectListFilter<TInputImage, TOutput>
double origin = (*otherIndex)[1] - (slope * (*otherIndex)[0]);
(*indexToCrop)[0] = static_cast<unsigned int>(size[0]-1);
(*indexToCrop)[1] = static_cast<unsigned int>(slope *(*indexToCrop)[0] + origin +0.5) ;
(*indexToCrop)[1] = static_cast<unsigned int>(slope *(*indexToCrop)[0] + origin +0.5);
}
/**
......
......@@ -54,7 +54,7 @@ namespace otb
itkTypeMacro(Rectangle, itk::Object);
/** Derived typedefs */
typedef itk::ContinuousIndex<ValueType,2> ContinuousIndexType ;
typedef itk::ContinuousIndex<ValueType,2> ContinuousIndexType;
typedef ContinuousIndexType VertexType;
typedef itk::VectorContainer<unsigned, VertexType> VertexListType;
typedef typename VertexListType::Pointer VertexListPointerType;
......
......@@ -85,7 +85,7 @@ Rectangle<TValue>
double yp = p[1];
double SegmentLength = vcl_sqrt((Xq1-Xq2)* (Xq1-Xq2) + (Yq1-Yq2) *(Yq1-Yq2));
double CrossProduct = Xq1*Yq2 - Xq2*Yq1 ;
double CrossProduct = Xq1*Yq2 - Xq2*Yq1;
double Num = vcl_abs(xp*(Yq1-Yq2) + yp*(Xq2-Xq1) + CrossProduct);
/** distance from Point P to Segment Q1Q2*/
......@@ -117,20 +117,20 @@ Rectangle<TValue>
VertexListPointerType cornersVertex = VertexListType::New();
VertexType tempCorner;
tempCorner[0] = p1[0] + dy* halfWidth ;
tempCorner[1] = p1[1] - dx* halfWidth ;
tempCorner[0] = p1[0] + dy* halfWidth;
tempCorner[1] = p1[1] - dx* halfWidth;
cornersVertex->InsertElement(cornersVertex->Size(),tempCorner);
tempCorner[0] = p1[0] - dy* halfWidth ;
tempCorner[1] = p1[1] + dx* halfWidth ;
tempCorner[0] = p1[0] - dy* halfWidth;
tempCorner[1] = p1[1] + dx* halfWidth;
cornersVertex->InsertElement(cornersVertex->Size(),tempCorner);
tempCorner[0] = p2[0] + dy* halfWidth ;
tempCorner[1] = p2[1] - dx* halfWidth ;
tempCorner[0] = p2[0] + dy* halfWidth;
tempCorner[1] = p2[1] - dx* halfWidth;
cornersVertex->InsertElement(cornersVertex->Size(),tempCorner);
tempCorner[0] = p2[0] - dy* halfWidth ;
tempCorner[1] = p2[1] + dx* halfWidth ;
tempCorner[0] = p2[0] - dy* halfWidth;
tempCorner[1] = p2[1] + dx* halfWidth;
cornersVertex->InsertElement(cornersVertex->Size(),tempCorner);
/** Compute the bounding region*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment