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

ENH: Adding normal SetInputPath() method to DrawPathFilter (to use instead of SetPathInput())

parent a063fcca
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,12 @@ public:
itkSetMacro(Value, OutputImagePixelType);
itkGetConstReferenceMacro(Value, OutputImagePixelType);
/** Set/Get the path input of this process object.
Note: these methods are adding to get the proper name */
void SetInputPath( const TInputPath * path);
const TInputPath * GetInputPath(void);
protected:
DrawPathFilter();
virtual ~DrawPathFilter() {};
......
......@@ -33,6 +33,23 @@ DrawPathFilter<TInputImage,TInputPath,TOutputImage>
{
m_Value = static_cast<OutputImagePixelType>(255.0);
}
template <class TInputImage, class TInputPath,class TOutputImage>
inline void DrawPathFilter<TInputImage,TInputPath,TOutputImage>
::SetInputPath( const TInputPath * path)
{
this->SetPathInput(path);
}
template <class TInputImage, class TInputPath,class TOutputImage>
const TInputPath * DrawPathFilter<TInputImage,TInputPath,TOutputImage>
::GetInputPath(void)
{
return this->GetPathInput();
}
/**
* Main computation method.
*/
......
......@@ -200,7 +200,7 @@ int main( int argc, char *argv[] )
DrawPathFilterType::Pointer drawPathFilter = DrawPathFilterType::New();
drawPathFilter->SetImageInput( backgroundImage );
drawPathFilter->SetPathInput( listIt.Get() );
drawPathFilter->SetInputPath( listIt.Get() );
drawPathFilter->SetValue( itk::NumericTraits<OutputPixelType>::max() );
drawPathFilter->Update();
......
......@@ -191,14 +191,14 @@ int main(int argc, char * argv[])
if (energyVert < energyHor)
{
removeCarvingPath->SetInput( duplicator->GetOutput() );
removeCarvingPath->SetPathInput( carvingFilterVert->GetOutput() );
removeCarvingPath->SetInputPath( carvingFilterVert->GetOutput() );
removeCarvingPath->SetDirection(0);
removeCarvingPath->UpdateLargestPossibleRegion();
}
else
{
removeCarvingPath->SetInput( duplicator->GetOutput() );
removeCarvingPath->SetPathInput( carvingFilterHor->GetOutput() );
removeCarvingPath->SetInputPath( carvingFilterHor->GetOutput() );
removeCarvingPath->SetDirection(1);
removeCarvingPath->UpdateLargestPossibleRegion();
}
......
......@@ -151,7 +151,7 @@ int main(int argc, char * argv[])
carvingFilter->SetDirection(i%2);
removeCarvingPath->SetInput( duplicator->GetOutput() );
removeCarvingPath->SetPathInput( carvingFilter->GetOutput() );
removeCarvingPath->SetInputPath( carvingFilter->GetOutput() );
removeCarvingPath->SetDirection(i%2);
removeCarvingPath->UpdateLargestPossibleRegion();
......@@ -180,12 +180,12 @@ int main(int argc, char * argv[])
{
addCarvingPath->SetInput( duplicator->GetOutput() );
addCarvingPath->SetPathInput( pathList->GetNthElement(i) );
addCarvingPath->SetInputPath( pathList->GetNthElement(i) );
addCarvingPath->SetDirection(i%2);
addCarvingPath->UpdateLargestPossibleRegion();
drawPathFilter->SetInput( addCarvingPath->GetOutput() );
drawPathFilter->SetPathInput( pathList->GetNthElement(i) );
drawPathFilter->SetInputPath( pathList->GetNthElement(i) );
drawPathFilter->UpdateLargestPossibleRegion();
duplicator->SetInputImage(drawPathFilter->GetOutput());
......
......@@ -80,7 +80,7 @@ int otbDrawPathFilter(int argc, char * argv[])
DrawPathFilterType::Pointer filter = DrawPathFilterType::New();
filter->SetImageInput(image);
filter->SetPathInput(path);
filter->SetInputPath(path);
WriterType::Pointer writer = WriterType::New();
writer->SetInput(filter->GetOutput());
......
......@@ -98,7 +98,7 @@ int otbDrawPathDessinCarre( int argc, char * argv[] )
DrawPathFilterType::Pointer DrawPath = DrawPathFilterType::New();
DrawPath->SetImageInput( reader->GetOutput() );
DrawPath->SetPathInput( VertexList );
DrawPath->SetInputPath( VertexList );
writer->SetInput(DrawPath->GetOutput());
writer->Update();
......
......@@ -115,7 +115,7 @@ int main( int argc, char ** argv )
{
drawPathFilter->SetImageInput( backgroundImage );
drawPathFilter->SetPathInput(listIt.Get());
drawPathFilter->SetInputPath(listIt.Get());
//drawPathFilter->SetPathValue( color );
drawPathFilter->Update();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment