Skip to content
Snippets Groups Projects
Commit b012e56d authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

STYLE

parent e24e45a5
Branches
Tags
No related merge requests found
......@@ -59,19 +59,19 @@ public:
itkTypeMacro(DrawPathListFilter,ImageToImageFilter);
/** Some convenient typedefs. */
typedef TInputImage InputImageType;
typedef typename InputImageType::Pointer InputImagePointerType;
typedef typename InputImageType::ConstPointer InputImageConstPointerType;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename InputImageType::PixelType InputImagePixelType;
typedef typename InputImageType::SizeType InputImageSizeType;
typedef typename InputImageType::ValueType InputImageValueType;
typedef TInputPath InputPathType;
typedef typename InputPathType::Pointer InputPathPointerType;
typedef otb::ObjectList<InputPathType> InputPathListType;
typedef TInputImage InputImageType;
typedef typename InputImageType::Pointer InputImagePointerType;
typedef typename InputImageType::ConstPointer InputImageConstPointerType;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename InputImageType::PixelType InputImagePixelType;
typedef typename InputImageType::SizeType InputImageSizeType;
typedef typename InputImageType::ValueType InputImageValueType;
typedef TInputPath InputPathType;
typedef typename InputPathType::Pointer InputPathPointerType;
typedef otb::ObjectList<InputPathType> InputPathListType;
typedef typename InputPathListType::ConstPointer InputPathListConstPointerType;
typedef typename InputPathListType::Pointer InputPathListPointerType;
typedef typename InputPathListType::Pointer InputPathListPointerType;
typedef TOutputImage OutputImageType;
typedef typename OutputImageType::Pointer OutputImagePointerType;
......@@ -116,9 +116,11 @@ protected:
private:
DrawPathListFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
/** Default value to draw */
OutputImagePixelType m_PathValue;
/** If set to true, the algorithm try to use path internal metadatadictionnary value */
/** If set to true, the algorithm try to use path internal metadata dictionnary value */
bool m_UseInternalPathValue;
bool m_AddValue;
......@@ -131,4 +133,3 @@ private:
#endif
#endif
......@@ -42,7 +42,6 @@ DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
m_AddValue = false;
}
template <class TInputImage, class TInputPath,class TOutputImage>
void
DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
......@@ -62,6 +61,7 @@ DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
}
return static_cast<const InputPathListType *>(this->ProcessObjectType::GetInput(1));
}
/**
* Main computation method
*/
......@@ -78,9 +78,9 @@ DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
outputPtr->FillBuffer(itk::NumericTraits<OutputImagePixelType>::Zero);
// First, we copy input to output
typedef itk::ImageRegionIterator<OutputImageType> OutputIteratorType;
typedef itk::ImageRegionConstIterator<InputImageType> InputIteratorType;
typedef typename InputPathListType::ConstIterator PathListIteratorType;
typedef itk::ImageRegionIterator<OutputImageType> OutputIteratorType;
typedef itk::ImageRegionConstIterator<InputImageType> InputIteratorType;
typedef typename InputPathListType::ConstIterator PathListIteratorType;
typedef PolyLineImageIterator<OutputImageType,InputPathType> PolyLineIteratorType;
OutputIteratorType outIt(outputPtr,outputPtr->GetLargestPossibleRegion());
......@@ -119,6 +119,7 @@ DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
}
}
}
/**
* Printself method
*/
......@@ -129,7 +130,7 @@ DrawPathListFilter<TInputImage,TInputPath,TOutputImage>
{
Superclass::PrintSelf(os, indent);
}
} // end namespace otb
#endif
......@@ -7,12 +7,12 @@
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
See OTBCopyright.txt for details.
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.
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbPolyLineImageConstIterator_h
......
......@@ -7,12 +7,12 @@
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
See OTBCopyright.txt for details.
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.
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbPolyLineImageConstIterator_txx
......@@ -36,29 +36,27 @@ PolyLineImageConstIterator<TImage, TPath>
m_Image = imagePtr;
m_Path = pathPtr;
m_InternalVertexIterator = m_Path->GetVertexList()->Begin();
IndexType source,target;
for (unsigned int i = 0;i<ImageType::ImageDimension;++i)
IndexType source, target;
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
source[i] = static_cast<unsigned int>(m_InternalVertexIterator.Value()[i]);
source[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
}
++m_InternalVertexIterator;
if (m_InternalVertexIterator!=m_Path->GetVertexList()->End())
if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
{
for (unsigned int i = 0;i<ImageType::ImageDimension;++i)
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
target[i] = static_cast<unsigned int>(m_InternalVertexIterator.Value()[i]);
target[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
}
}
else
{
target = source;
}
m_InternalImageIterator = InternalImageIteratorType(const_cast<ImageType *>(m_Image.GetPointer()),source,target);
m_InternalImageIterator = InternalImageIteratorType(const_cast<ImageType *> (m_Image.GetPointer()), source, target);
}
/**
* Constructor
*/
template <class TImage, class TPath>
typename PolyLineImageConstIterator<TImage,TPath>
::Self&
......@@ -77,25 +75,25 @@ PolyLineImageConstIterator<TImage, TPath>
::GoToBegin(void)
{
m_InternalVertexIterator = m_Path->GetVertexList()->Begin();
IndexType source,target;
for (unsigned int i = 0;i<ImageType::ImageDimension;++i)
IndexType source, target;
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
source[i] = static_cast<unsigned int>(m_InternalVertexIterator.Value()[i]);
source[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
}
++m_InternalVertexIterator;
if (m_InternalVertexIterator!=m_Path->GetVertexList()->End())
if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
{
for (unsigned int i = 0;i<ImageType::ImageDimension;++i)
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
target[i] = static_cast<unsigned int>(m_InternalVertexIterator.Value()[i]);
target[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
}
}
else
{
target = source;
}
m_InternalImageIterator = InternalImageIteratorType(const_cast<ImageType *>(m_Image.GetPointer()),source,target);
m_InternalImageIterator = InternalImageIteratorType(const_cast<ImageType *> (m_Image.GetPointer()), source, target);
}
template <class TImage, class TPath>
......@@ -103,32 +101,34 @@ void
PolyLineImageConstIterator<TImage,TPath>
::operator++()
{
// otbMsgDebugMacro(<<this->GetIndex());
// otbMsgDebugMacro(<<this->GetIndex());
++m_InternalImageIterator;
if (m_InternalImageIterator.IsAtEnd())
{
if (m_InternalVertexIterator!=m_Path->GetVertexList()->End())
if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
{
IndexType source;
for (unsigned int i = 0;i<ImageType::ImageDimension;++i)
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
source[i] = static_cast<unsigned int>(m_InternalVertexIterator.Value()[i]);
source[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
}
// otbMsgDebugMacro(<<"Source: "<<source);
++m_InternalVertexIterator;
if (m_InternalVertexIterator!=m_Path->GetVertexList()->End())
if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
{
IndexType target;
for (unsigned int i = 0;i<ImageType::ImageDimension;++i)
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
target[i] = static_cast<unsigned int>(m_InternalVertexIterator.Value()[i]);
target[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
}
// otbMsgDebugMacro(<<"Target: "<<target);
m_InternalImageIterator = InternalImageIteratorType(const_cast<ImageType *>(m_Image.GetPointer()),source,target);
m_InternalImageIterator = InternalImageIteratorType(const_cast<ImageType *> (m_Image.GetPointer()), source,
target);
++m_InternalImageIterator;
}
}
}
}
} // End namespace otb
#endif
......@@ -7,12 +7,12 @@
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
See OTBCopyright.txt for details.
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.
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbPolyLineImageIterator_h
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment