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
Branches
Tags
No related merge requests found
...@@ -103,6 +103,7 @@ void ...@@ -103,6 +103,7 @@ void
PolyLineImageConstIterator<TImage,TPath> PolyLineImageConstIterator<TImage,TPath>
::operator++() ::operator++()
{ {
// otbMsgDebugMacro(<<this->GetIndex());
++m_InternalImageIterator; ++m_InternalImageIterator;
if(m_InternalImageIterator.IsAtEnd()) if(m_InternalImageIterator.IsAtEnd())
{ {
...@@ -113,6 +114,7 @@ PolyLineImageConstIterator<TImage,TPath> ...@@ -113,6 +114,7 @@ PolyLineImageConstIterator<TImage,TPath>
{ {
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; ++m_InternalVertexIterator;
if(m_InternalVertexIterator!=m_Path->GetVertexList()->End()) if(m_InternalVertexIterator!=m_Path->GetVertexList()->End())
{ {
...@@ -121,6 +123,7 @@ PolyLineImageConstIterator<TImage,TPath> ...@@ -121,6 +123,7 @@ PolyLineImageConstIterator<TImage,TPath>
{ {
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; ++m_InternalImageIterator;
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "otbImageFileReader.h" #include "otbImageFileReader.h"
#include "otbPathListSource.h" #include "otbPathListSource.h"
#include "otbImageToPathListAlignFilter.h" #include "otbImageToPathListAlignFilter.h"
#include "otbDrawPathFilter.h" #include "otbDrawPathListFilter.h"
#include "otbImageFileWriter.h" #include "otbImageFileWriter.h"
...@@ -56,12 +56,10 @@ int otbDrawPathAlign( int argc, char * argv[] ) ...@@ -56,12 +56,10 @@ int otbDrawPathAlign( int argc, char * argv[] )
typedef otb::ImageToPathListAlignFilter<InputImageType,PathType> PathListType; typedef otb::ImageToPathListAlignFilter<InputImageType,PathType> PathListType;
typedef PathListType::OutputPathListType OutputPathListType; typedef PathListType::OutputPathListType OutputPathListType;
typedef otb::DrawPathFilter<InputImageType,PathType,OutputImageType> DrawPathFilterType; typedef otb::DrawPathListFilter<InputImageType,PathType,OutputImageType> DrawPathFilterType;
ReaderType::Pointer reader = ReaderType::New(); ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New(); WriterType::Pointer writer = WriterType::New();
// InputImageType::Pointer ImageIn = InputImageType::New();
// OutputImageType::Pointer ImageOut = OutputImageType::New();
DrawPathFilterType::Pointer DrawPath = DrawPathFilterType::New(); DrawPathFilterType::Pointer DrawPath = DrawPathFilterType::New();
PathType::Pointer VertexList = PathType::New(); PathType::Pointer VertexList = PathType::New();
...@@ -81,32 +79,12 @@ int otbDrawPathAlign( int argc, char * argv[] ) ...@@ -81,32 +79,12 @@ int otbDrawPathAlign( int argc, char * argv[] )
std::cout << "NbPath: " << nbPath << std::endl; std::cout << "NbPath: " << nbPath << std::endl;
InputImageType::ConstPointer imageIn = reader->GetOutput(); InputImageType::ConstPointer imageIn = reader->GetOutput();
for(int i = 0 ; i<nbPath;i++) DrawPath->SetInput( imageIn );
{ DrawPath->SetInputPath( sortiePath);
std::cout << "Path No: " << i << std::endl;
writer->SetInput(DrawPath->GetOutput());
OutputImageType::Pointer imageOut = OutputImageType::New(); writer->Update();
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();
} }
catch( itk::ExceptionObject & err ) 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