Skip to content
Snippets Groups Projects
Commit 7d2a9c76 authored by Julien Michel's avatar Julien Michel
Browse files

Correction d'une erreur dans un test de draw

parent c3a45ba4
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,7 @@ void
PolyLineImageConstIterator<TImage,TPath>
::operator++()
{
// otbMsgDebugMacro(<<this->GetIndex());
++m_InternalImageIterator;
if(m_InternalImageIterator.IsAtEnd())
{
......@@ -113,6 +114,7 @@ PolyLineImageConstIterator<TImage,TPath>
{
source[i] = static_cast<unsigned int>(m_InternalVertexIterator.Value()[i]);
}
// otbMsgDebugMacro(<<"Source: "<<source);
++m_InternalVertexIterator;
if(m_InternalVertexIterator!=m_Path->GetVertexList()->End())
{
......@@ -121,6 +123,7 @@ PolyLineImageConstIterator<TImage,TPath>
{
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;
}
......
......@@ -28,7 +28,7 @@
#include "otbImageFileReader.h"
#include "otbPathListSource.h"
#include "otbImageToPathListAlignFilter.h"
#include "otbDrawPathFilter.h"
#include "otbDrawPathListFilter.h"
#include "otbImageFileWriter.h"
......@@ -56,12 +56,10 @@ int otbDrawPathAlign( int argc, char * argv[] )
typedef otb::ImageToPathListAlignFilter<InputImageType,PathType> PathListType;
typedef PathListType::OutputPathListType OutputPathListType;
typedef otb::DrawPathFilter<InputImageType,PathType,OutputImageType> DrawPathFilterType;
typedef otb::DrawPathListFilter<InputImageType,PathType,OutputImageType> DrawPathFilterType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
// InputImageType::Pointer ImageIn = InputImageType::New();
// OutputImageType::Pointer ImageOut = OutputImageType::New();
DrawPathFilterType::Pointer DrawPath = DrawPathFilterType::New();
PathType::Pointer VertexList = PathType::New();
......@@ -81,32 +79,12 @@ int otbDrawPathAlign( int argc, char * argv[] )
std::cout << "NbPath: " << nbPath << std::endl;
InputImageType::ConstPointer imageIn = reader->GetOutput();
for(int i = 0 ; i<nbPath;i++)
{
std::cout << "Path No: " << i << std::endl;
OutputImageType::Pointer imageOut = OutputImageType::New();
DrawPath->SetImageInput( imageIn );
DrawPath->SetPathInput( sortiePath->GetNthElement(i));
imageOut = DrawPath->GetOutput();
imageOut->Update();
imageIn = imageOut;
#if 0
OutputImageType::Pointer imageOut = OutputImageType::New();
DrawPath->SetImageInput( reader->GetOutput() );
DrawPath->SetPathInput( VertexList );
writer->SetInput(DrawPath->GetOutput());
writer->Update();
#endif
}
writer->SetInput(imageIn);
writer->Update();
DrawPath->SetInput( imageIn );
DrawPath->SetInputPath( sortiePath);
writer->SetInput(DrawPath->GetOutput());
writer->Update();
}
catch( itk::ExceptionObject & err )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment