diff --git a/Modules/Applications/AppFusion/app/otbPansharpening.cxx b/Modules/Applications/AppFusion/app/otbPansharpening.cxx index fda0827b4f9b2e1ce06b91c22de6607540572aed..8e6cf20f0cd8cf8f2325ec2c9169caaf7bdaf25f 100644 --- a/Modules/Applications/AppFusion/app/otbPansharpening.cxx +++ b/Modules/Applications/AppFusion/app/otbPansharpening.cxx @@ -53,8 +53,6 @@ public: typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; - typedef itk::ImageToImageFilter<FloatVectorImageType, FloatVectorImageType> FusionFilterType; - typedef otb::SimpleRcsPanSharpeningFusionImageFilter<FloatImageType, FloatVectorImageType, FloatVectorImageType> SimpleRCSFilterType; typedef otb::LmvmPanSharpeningFusionImageFilter @@ -176,7 +174,9 @@ private: filter->UpdateOutputInformation(); otbAppLogINFO( << "Simple RCS algorithm" ); - m_FusionFilter = filter; + m_Ref.push_back(filter.GetPointer()); + SetParameterOutputImage("out", filter->GetOutput()); + break; } case 1: @@ -203,8 +203,9 @@ private: filter->UpdateOutputInformation(); otbAppLogINFO( << "Lmvm algorithm" ); + m_Ref.push_back(filter.GetPointer()); + SetParameterOutputImage("out", filter->GetOutput()); - m_FusionFilter = filter; break; } case 2: @@ -224,7 +225,9 @@ private: filter->UpdateOutputInformation(); otbAppLogINFO( << "Bayesian fusion algorithm" ); - m_FusionFilter = filter; + + m_Ref.push_back(filter.GetPointer()); + SetParameterOutputImage("out", filter->GetOutput()); break; } @@ -236,12 +239,9 @@ private: } return; } - - SetParameterOutputImage("out", m_FusionFilter->GetOutput()); } std::vector<itk::ProcessObject::Pointer> m_Ref; - FusionFilterType::Pointer m_FusionFilter; }; } }