21 #ifndef otbImageToProfileFilter_hxx
22 #define otbImageToProfileFilter_hxx
31 template <
class TInputImage,
class TOutputImage,
class TFilter,
class TParameter>
33 : m_Filter(FilterType::New()),
44 template <
class TInputImage,
class TOutputImage,
class TFilter,
class TParameter>
45 void ImageToProfileFilter<TInputImage, TOutputImage, TFilter, TParameter>::GenerateOutputInformation(
void)
48 InputImagePointerType inputPtr = this->GetInput();
49 OutputImageListPointerType outputPtr = this->GetOutput();
52 if (outputPtr->Size() != m_ProfileSize)
56 for (
unsigned int i = 0; i < m_ProfileSize; ++i)
59 outputPtr->PushBack(OutputImageType::New());
63 typename OutputImageListType::Iterator outputListIt = outputPtr->Begin();
64 m_Filter->SetInput(inputPtr);
65 m_Filter->UpdateOutputInformation();
66 while (outputListIt != outputPtr->End())
69 outputListIt.Get()->CopyInformation(m_Filter->GetOutput(m_OutputIndex));
70 outputListIt.Get()->SetLargestPossibleRegion(m_Filter->GetOutput(m_OutputIndex)->GetLargestPossibleRegion());
79 template <
class TInputImage,
class TOutputImage,
class TFilter,
class TParameter>
80 void ImageToProfileFilter<TInputImage, TOutputImage, TFilter, TParameter>::GenerateInputRequestedRegion(
void)
83 InputImagePointerType inputPtr = this->GetInput();
84 OutputImageListPointerType outputPtr = this->GetOutput();
88 typename OutputImageListType::Iterator outputListIt = outputPtr->Begin();
90 m_Filter->SetInput(inputPtr);
93 while (outputListIt != outputPtr->End())
95 m_Filter->GetOutput(m_OutputIndex)->SetRequestedRegion(outputListIt.Get()->GetRequestedRegion());
96 m_Filter->PropagateRequestedRegion(outputListIt.Get());
103 template <
class TInputImage,
class TOutputImage,
class TFilter,
class TParameter>
104 void ImageToProfileFilter<TInputImage, TOutputImage, TFilter, TParameter>::GenerateData(
void)
107 InputImagePointerType inputPtr = this->GetInput();
108 OutputImageListPointerType outputPtr = this->GetOutput();
109 m_Filter->SetInput(inputPtr);
112 for (
unsigned int i = 0; i < m_ProfileSize; ++i)
115 this->SetProfileParameter(profileParameter);
116 m_Filter->GetOutput(m_OutputIndex)->SetRequestedRegion(outputPtr->GetNthElement(i)->GetRequestedRegion());
118 outputPtr->SetNthElement(i,
static_cast<OutputImageType*
>(m_Filter->GetOutput(m_OutputIndex)));
119 outputPtr->GetNthElement(i)->DisconnectPipeline();