Commit fdad5aa1 authored by Emmanuel Christophe's avatar Emmanuel Christophe

Style: removing tabulations

parent a8d56a26
......@@ -108,7 +108,7 @@ void
EuclideanDistanceWithMissingValuePow2< TVector >
::SetToMissingValue ( ValueType & v )
{
v = std::numeric_limits<ValueType>::signaling_NaN();
v = std::numeric_limits<ValueType>::signaling_NaN();
}
......
......@@ -64,37 +64,37 @@ public:
{
case MULTIPLICATION:
{
vInTmp *= static_cast<InternalInputPixelType>(inPix);
break;
vInTmp *= static_cast<InternalInputPixelType>(inPix);
break;
}
case ADDITION:
{
vInTmp += static_cast<InternalInputPixelType>(inPix);
break;
}
{
vInTmp += static_cast<InternalInputPixelType>(inPix);
break;
}
case DIVISON:
{
if(inPix!=0)
vInTmp /= static_cast<InternalInputPixelType>(inPix);
else
{
vInTmp.Fill(0);
}
break;
}
{
if(inPix!=0)
vInTmp /= static_cast<InternalInputPixelType>(inPix);
else
{
vInTmp.Fill(0);
}
break;
}
case SUBSTRACTION:
{
vInTmp -= static_cast<InternalInputPixelType>(inPix);
break;
}
{
vInTmp -= static_cast<InternalInputPixelType>(inPix);
break;
}
default:
{
}
{
}
}
for(unsigned int i=0; i<vInTmp.Size(); i++)
{
out[i] = static_cast<InternalInputPixelType>(vInTmp[i]);
out[i] = static_cast<InternalInputPixelType>(vInTmp[i]);
}
return out;
}
......@@ -121,11 +121,11 @@ public:
template <class TInputImage, class TVectorInputImage, class TOutputImage>
class ITK_EXPORT ImageAndVectorImageOperationFilter:
public itk::BinaryFunctorImageFilter<TInputImage,
TVectorInputImage,
TOutputImage,
Functor::ImageAndVectorImageOperationFunctor<ITK_TYPENAME TInputImage::PixelType,
ITK_TYPENAME TVectorInputImage::PixelType,
ITK_TYPENAME TOutputImage::PixelType > >
TVectorInputImage,
TOutputImage,
Functor::ImageAndVectorImageOperationFunctor<ITK_TYPENAME TInputImage::PixelType,
ITK_TYPENAME TVectorInputImage::PixelType,
ITK_TYPENAME TOutputImage::PixelType > >
//ImageToImageFilter< TVectorInputImage, TOutputImage >
{
public:
......@@ -135,7 +135,7 @@ public:
//typedef itk::ImageToImageFilter<TVectorInputImage, TOutputImage> Superclass;
typedef Functor::ImageAndVectorImageOperationFunctor<ITK_TYPENAME TInputImage::PixelType,
ITK_TYPENAME TVectorInputImage::PixelType,
ITK_TYPENAME TOutputImage::PixelType > FunctorType;
ITK_TYPENAME TOutputImage::PixelType > FunctorType;
typedef itk::BinaryFunctorImageFilter<TInputImage, TVectorInputImage, TOutputImage, FunctorType> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
......
......@@ -76,17 +76,17 @@ class ITK_EXPORT MaskFunctor
{
OutputPixelType outPix;
if( maskPix==m_BackgroundValue )
{
outPix.SetSize( inPix.Size() );
for(unsigned int i=0; i<outPix.Size(); i++)
{
outPix[i] = static_cast<OutputInternalPixelType>(inPix[i]);
}
}
{
outPix.SetSize( inPix.Size() );
for(unsigned int i=0; i<outPix.Size(); i++)
{
outPix[i] = static_cast<OutputInternalPixelType>(inPix[i]);
}
}
else
{
outPix = m_ObjectColor;
}
{
outPix = m_ObjectColor;
}
return outPix;
}
......@@ -195,7 +195,7 @@ public itk::ImageToImageFilter<TInputImage, otb::VectorImage<unsigned char, 2> >
{
if(chList.size() != 3)
{
itkExceptionMacro(<<"Invalid channel list, size is "<<chList.size()<<" instead of 3");
itkExceptionMacro(<<"Invalid channel list, size is "<<chList.size()<<" instead of 3");
}
m_ChannelList = chList;
this->Modified();
......
......@@ -111,13 +111,13 @@ PrintableImageFilter<TInputImage, TMaskImage>
typename InputImageType::ConstPointer inputPtr = this->GetInput();
if( !inputMaskPtr )
{
itkExceptionMacro(<<"No mask detected");
}
{
itkExceptionMacro(<<"No mask detected");
}
if( inputMaskPtr->GetLargestPossibleRegion().GetSize() != inputPtr->GetLargestPossibleRegion().GetSize())
{
itkExceptionMacro(<<"Input size ("<<inputPtr->GetLargestPossibleRegion().GetSize()<<") and Mask size ("<<inputMaskPtr->GetLargestPossibleRegion().GetSize()<<") must be the same");
}
{
itkExceptionMacro(<<"Input size ("<<inputPtr->GetLargestPossibleRegion().GetSize()<<") and Mask size ("<<inputMaskPtr->GetLargestPossibleRegion().GetSize()<<") must be the same");
}
}
}
......
......@@ -288,29 +288,29 @@ SpatialObjectToImageDrawingFilter<TInputSpatialObject,TOutputImage>
(*iter)->ComputeBoundingBox();
for (i=0;i<ObjectDimension;++i)
{
minimum[i]=(*iter)->GetBoundingBox()->GetMinimum()[i];
}
{
minimum[i]=(*iter)->GetBoundingBox()->GetMinimum()[i];
}
while (iter != end)
{
(*iter)->ComputeBoundingBox();
for (i=0;i<ObjectDimension;++i)
{
if ((*iter)->GetBoundingBox()->GetMinimum()[i] < minimum[i])
{
minimum[i]=(*iter)->GetBoundingBox()->GetMinimum()[i];
}
}
++iter;
}
{
(*iter)->ComputeBoundingBox();
for (i=0;i<ObjectDimension;++i)
{
if ((*iter)->GetBoundingBox()->GetMinimum()[i] < minimum[i])
{
minimum[i]=(*iter)->GetBoundingBox()->GetMinimum()[i];
}
}
++iter;
}
for (i=0;i<ObjectDimension;++i)
{
size[i] = (long unsigned int) (InputObject->GetBoundingBox()->GetMaximum()[i] - minimum[i])+1;
origine[i]=(long int) minimum[i];
originspecified = true;
}
{
size[i] = (long unsigned int) (InputObject->GetBoundingBox()->GetMaximum()[i] - minimum[i])+1;
origine[i]=(long int) minimum[i];
originspecified = true;
}
itkDebugMacro(<<"minx= "<<minimum[0]<<", miny= "<<minimum[0]<<", maxx= "<<InputObject->GetBoundingBox()->GetMaximum()[0]<<", maxy= "<<InputObject->GetBoundingBox()->GetMaximum()[1]);
}
......@@ -318,10 +318,10 @@ SpatialObjectToImageDrawingFilter<TInputSpatialObject,TOutputImage>
{
for (i=0;i<ObjectDimension;++i)
{
size[i] = (long int)(InputObject->GetBoundingBox()->GetMaximum()[i]
- InputObject->GetBoundingBox()->GetMinimum()[i]);
}
{
size[i] = (long int)(InputObject->GetBoundingBox()->GetMaximum()[i]
- InputObject->GetBoundingBox()->GetMinimum()[i]);
}
}
typename OutputImageType::IndexType index;
......@@ -337,8 +337,8 @@ SpatialObjectToImageDrawingFilter<TInputSpatialObject,TOutputImage>
{
if (m_Size[i] != 0)
{
specified = true;
break;
specified = true;
break;
}
}
......@@ -358,10 +358,10 @@ SpatialObjectToImageDrawingFilter<TInputSpatialObject,TOutputImage>
for (i = 0; i < OutputImageDimension; ++i)
{
if (m_Spacing[i] != 0)
{
specified = true;
break;
}
{
specified = true;
break;
}
}
if (specified)
......@@ -425,24 +425,24 @@ SpatialObjectToImageDrawingFilter<TInputSpatialObject,TOutputImage>
if ( m_InsideValue != 0 || m_OutsideValue != 0 )
{
if ( val)
{
if (m_UseObjectValue)
{
it.Set(static_cast<ValueType>(val));
}
else
{
it.Set(m_InsideValue);
}
}
{
if (m_UseObjectValue)
{
it.Set(static_cast<ValueType>(val));
}
else
{
it.Set(m_InsideValue);
}
}
else
{
it.Set(m_OutsideValue);
}
{
it.Set(m_OutsideValue);
}
}
else
{
it.Set(static_cast<ValueType>(val));
it.Set(static_cast<ValueType>(val));
}
++it;
}
......
......@@ -201,7 +201,7 @@ protected:
Superclass::PrintSelf( os, indent );
os << indent << "Attributes: "<< std::endl;
for(AttributesMapConstIteratorType it = m_Attributes.begin();
it!=m_Attributes.end();++it)
it!=m_Attributes.end();++it)
{
os<<indent<<indent<<it->first<<" = "<<it->second<<std::endl;
}
......
......@@ -38,7 +38,7 @@ namespace otb
template<class TImage>
class ITK_EXPORT AttributesMapOpeningLabelMapFilter
: public itk::AttributeOpeningLabelMapFilter<TImage,
Functor::AttributesMapLabelObjectAccessor<typename TImage::LabelObjectType> >
Functor::AttributesMapLabelObjectAccessor<typename TImage::LabelObjectType> >
{
public:
/** Standard class typedefs. */
......
......@@ -65,14 +65,14 @@ public:
typedef itk::Point<TPrecision , SpatialDimension > PointType;
typedef PolyLineParametricPathWithValue < TPrecision , SpatialDimension > LineType;
typedef typename LineType::Pointer LinePointerType;
typedef Polygon < TPrecision > PolygonType;
typedef typename PolygonType::Pointer PolygonPointerType;
typedef typename PolygonType::ConstPointer PolygonConstPointerType;
typedef ObjectList< PolygonType > PolygonListType;
typedef typename PolygonListType::Pointer PolygonListPointerType;
typedef typename PolygonListType::ConstPointer PolygonListConstPointerType;
typedef typename LineType::Pointer LinePointerType;
typedef Polygon < TPrecision > PolygonType;
typedef typename PolygonType::Pointer PolygonPointerType;
typedef typename PolygonType::ConstPointer PolygonConstPointerType;
typedef ObjectList< PolygonType > PolygonListType;
typedef typename PolygonListType::Pointer PolygonListPointerType;
typedef typename PolygonListType::ConstPointer PolygonListConstPointerType;
/** Acessors */
//itkStaticConstMacro(GISDimension, unsigned int, SpatialDimension);
......
......@@ -37,7 +37,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
bool resp = l2.GetIndex()[1]> l1.GetIndex()[1];
resp = resp
|| (l2.GetIndex()[1] == l1.GetIndex()[1]
&& (l1.GetIndex()[0]+ static_cast<long>(l1.GetLength())) < l2.GetIndex()[0]);
&& (l1.GetIndex()[0]+ static_cast<long>(l1.GetLength())) < l2.GetIndex()[0]);
return resp;
}
......@@ -103,217 +103,217 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
while(goesOn)
{
switch(m_CurrentState)
{
case UP_RIGHT:
{
// First candidate run
IndexType firstCandidateRun = Within(m_CurrentPoint,m_CurrentLine-1);
if(IsRunIndexValid(firstCandidateRun))
{
// Second candidate run
IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine,RightEnd(m_CurrentRun),firstCandidateRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Down-Right case
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
else
{
// Up-Right case
m_CurrentLine--;
m_CurrentRun = firstCandidateRun;
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
else
{
IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine-1,RightEnd(m_CurrentRun),m_CurrentRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Up-Left Case
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),polygon, m_CurrentState);
m_CurrentLine--;
m_CurrentRun = secondCandidateRun;
}
else
{
// Down-Left case
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
break;
}
case DOWN_LEFT:
{
// First candidate run
IndexType firstCandidateRun = Within(m_CurrentPoint,m_CurrentLine+1);
if(IsRunIndexValid(firstCandidateRun))
{
// Second candidate run
IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine,LeftEnd(m_CurrentRun),firstCandidateRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Up-Left case
m_CurrentRun = secondCandidateRun;
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
}
else
{
// Down-Left case
m_CurrentLine++;
m_CurrentRun = firstCandidateRun;
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
else
{
IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine+1,LeftEnd(m_CurrentRun),m_CurrentRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Down-Right case
m_CurrentRun = secondCandidateRun;
m_CurrentLine++;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
else
{
// Up-Right case
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
break;
}
case DOWN_RIGHT:
{
IndexType firstCandidateRun = Within(m_CurrentPoint,m_CurrentLine+1);
if(IsRunIndexValid(firstCandidateRun))
{
IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine,RightEnd(m_CurrentRun),firstCandidateRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Up-Left case
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
m_CurrentRun = secondCandidateRun;
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
}
else
{
// Down-Left case
m_CurrentLine++;
m_CurrentRun = firstCandidateRun;
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
else
{
IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine+1,LeftEnd(m_CurrentRun),m_CurrentRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Down-Right case
m_CurrentLine++;
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
else
{
// Up-Right case
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
break;
}
case UP_LEFT:
{
IndexType firstCandidateRun = Within(m_CurrentPoint,m_CurrentLine-1);
if(IsRunIndexValid(firstCandidateRun))
{
IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine,LeftEnd(m_CurrentRun),firstCandidateRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Down-Right case
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
else
{
// Up-Right case
m_CurrentLine--;
m_CurrentRun = firstCandidateRun;
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
else
{
IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine-1,RightEnd(m_CurrentRun),m_CurrentRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Up-Left case
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),polygon, m_CurrentState);
m_CurrentLine--;
m_CurrentRun = secondCandidateRun;
}
else
{
// Down-Left case
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
break;
}
}
{
case UP_RIGHT:
{
// First candidate run
IndexType firstCandidateRun = Within(m_CurrentPoint,m_CurrentLine-1);
if(IsRunIndexValid(firstCandidateRun))
{
// Second candidate run
IndexType secondCandidateRun = RightMostLeftEndInside(m_CurrentLine,RightEnd(m_CurrentRun),firstCandidateRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Down-Right case
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),polygon, m_CurrentState);
}
else
{
// Up-Right case
m_CurrentLine--;
m_CurrentRun = firstCandidateRun;
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),polygon, m_CurrentState);
}
}
else
{
IndexType secondCandidateRun = LeftMostRightEndInside(m_CurrentLine-1,RightEnd(m_CurrentRun),m_CurrentRun);
if(IsRunIndexValid(secondCandidateRun))
{
// Up-Left Case
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),polygon, m_CurrentState);
m_CurrentLine--;
m_CurrentRun = secondCandidateRun;
}