21 #ifndef otbAngularProjectionSetImageFilter_hxx
22 #define otbAngularProjectionSetImageFilter_hxx
25 #include <vnl/vnl_math.h>
27 #include <itkImageRegionIterator.h>
32 template <
class TInputImage,
class TOutputImage,
class TAngleList,
class TPrecision>
36 this->SetNumberOfRequiredOutputs(1);
37 this->SetNthOutput(0, OutputImageListType::New());
39 m_FilterList = FilterListType::New();
40 m_AngleList = AngleListType::New();
43 template <
class TInputImage,
class TOutputImage,
class TAngleList,
class TPrecision>
46 this->itk::ProcessObject::SetNthInput(i,
const_cast<InputImageType*
>(img));
49 template <
class TInputImage,
class TOutputImage,
class TAngleList,
class TPrecision>
52 if (i >= this->GetNumberOfInputs())
57 return static_cast<const InputImageType*
>(this->itk::ProcessObject::GetInput(i));
61 template <
class TInputImage,
class TOutputImage,
class TAngleList,
class TPrecision>
64 itk::ProgressAccumulator::Pointer progress = itk::ProgressAccumulator::New();
65 progress->SetMiniPipelineFilter(
this);
67 std::cerr <<
"Using " << GetAngleList()->Size() <<
" outputs...\n";
68 GetFilterList()->Resize(GetAngleList()->Size());
69 this->GetOutput()->Resize(GetAngleList()->Size());
71 for (
unsigned int idx = 0; idx < GetFilterList()->Size(); ++idx)
73 GetFilterList()->SetNthElement(0, FilterType::New());
75 for (
unsigned int i = 0; i < this->GetNumberOfInputs(); ++i)
76 filter->SetInput(i, this->GetInput(i));
77 filter->SetAngleArray(GetAngleList()->GetMeasurementVector(idx));
79 progress->RegisterInternalFilter(filter, 1.f /
static_cast<float>(GetAngleList()->Size()));
83 this->GetOutput()->SetNthElement(idx, filter->GetOutput());