22 #ifndef otbDrawPathListFilter_hxx
23 #define otbDrawPathListFilter_hxx
27 #include "itkImageRegionIterator.h"
29 #include "itkMetaDataObject.h"
36 template <
class TInputImage,
class TInputPath,
class TOutputImage>
39 this->SetNumberOfRequiredInputs(2);
40 this->SetNumberOfRequiredOutputs(1);
42 m_UseInternalPathValue =
false;
47 template <
class TInputImage,
class TInputPath,
class TOutputImage>
53 template <
class TInputImage,
class TInputPath,
class TOutputImage>
57 if (this->GetNumberOfInputs() < 2)
61 return static_cast<const InputPathListType*
>(this->ProcessObjectType::GetInput(1));
67 template <
class TInputImage,
class TInputPath,
class TOutputImage>
73 outputPtr->SetRegions(inputPtr->GetLargestPossibleRegion());
74 outputPtr->Allocate();
75 outputPtr->FillBuffer(itk::NumericTraits<OutputImagePixelType>::Zero);
79 typedef itk::ImageRegionIterator<OutputImageType> OutputIteratorType;
80 typedef itk::ImageRegionConstIterator<InputImageType> InputIteratorType;
84 OutputIteratorType outIt(outputPtr, outputPtr->GetLargestPossibleRegion());
85 InputIteratorType inIt(inputPtr, inputPtr->GetLargestPossibleRegion());
87 for (outIt.GoToBegin(), inIt.GoToBegin(); (!outIt.IsAtEnd() && !inIt.IsAtEnd()); ++outIt, ++inIt)
93 for (PathListIteratorType plIt = pathListPtr->Begin(); plIt != pathListPtr->End(); ++plIt)
96 if (m_UseInternalPathValue && plIt.Get()->GetMetaDataDictionary().HasKey(
"Value"))
98 itk::ExposeMetaData<OutputImagePixelType>(plIt.Get()->GetMetaDataDictionary(),
"Value", value);
104 PolyLineIteratorType imageIt(outputPtr, plIt.Get());
105 for (imageIt.GoToBegin(); !imageIt.IsAtEnd(); ++imageIt)
109 imageIt.Set(imageIt.Get() + 1);
122 template <
class TInputImage,
class TInputPath,
class TOutputImage>
125 Superclass::PrintSelf(os, indent);