diff --git a/Modules/Applications/AppFusion/app/otbBundleToPerfectSensor.cxx b/Modules/Applications/AppFusion/app/otbBundleToPerfectSensor.cxx index 7de9d58d3645dfe7c1d6aa07d9960b7d1111a7b9..51b77af1428dbeeedb344806a190d797bb9db7ab 100644 --- a/Modules/Applications/AppFusion/app/otbBundleToPerfectSensor.cxx +++ b/Modules/Applications/AppFusion/app/otbBundleToPerfectSensor.cxx @@ -19,6 +19,7 @@ #include "otbMultiToMonoChannelExtractROI.h" #include "otbGenericRSResampleImageFilter.h" +#include "otbImportGeoInformationImageFilter.h" #include "otbBCOInterpolateImageFunction.h" #include "otbSimpleRcsPanSharpeningFusionImageFilter.h" #include "itkFixedArray.h" @@ -133,6 +134,7 @@ private: typedef otb::BCOInterpolateImageFunction<FloatVectorImageType> InterpolatorType; typedef otb::GenericRSResampleImageFilter<FloatVectorImageType, FloatVectorImageType> ResamplerType; typedef otb::StreamingResampleImageFilter<FloatVectorImageType, FloatVectorImageType> BasicResamplerType; + typedef otb::ImportGeoInformationImageFilter<FloatVectorImageType,InternalImageType> ImportGeoInformationFilterType; typedef otb::SimpleRcsPanSharpeningFusionImageFilter<InternalImageType, FloatVectorImageType, FloatVectorImageType> FusionFilterType; // Resample filter @@ -142,6 +144,9 @@ private: BasicResamplerType::Pointer basicResampler = BasicResamplerType::New(); m_Ref.push_back(basicResampler.GetPointer()); + ImportGeoInformationFilterType::Pointer geoImport = ImportGeoInformationFilterType::New(); + m_Ref.push_back(geoImport.GetPointer()); + InterpolatorType::Pointer interpolator = InterpolatorType::New(); resampler->SetInterpolator(interpolator); basicResampler->SetInterpolator(interpolator); @@ -209,8 +214,11 @@ private: basicResampler->SetOutputSize(size); basicResampler->SetOutputStartIndex(start); basicResampler->SetEdgePaddingValue(defaultValue); - - fusionFilter->SetXsInput(basicResampler->GetOutput()); + + geoImport->SetInput(basicResampler->GetOutput()); + geoImport->SetSource(panchro); + + fusionFilter->SetXsInput(geoImport->GetOutput()); // Set the profRef & Keywordlist from Pan into the resampled XS image basicResampler->UpdateOutputInformation(); diff --git a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx index b44ce6db057614272f74137fec97c5643414d6ff..8063257976315560454934c47448e29372f8bece 100644 --- a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx +++ b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx @@ -18,6 +18,7 @@ #include "otbWrapperApplicationFactory.h" #include "otbGenericRSResampleImageFilter.h" +#include "otbImportGeoInformationImageFilter.h" #include "otbBCOInterpolateImageFunction.h" #include "itkNearestNeighborInterpolateImageFunction.h" @@ -66,6 +67,8 @@ public: typedef otb::GenericRSResampleImageFilter<FloatVectorImageType, FloatVectorImageType> ResamplerType; + typedef otb::ImportGeoInformationImageFilter<FloatVectorImageType, + FloatVectorImageType> ImportGeoInformationFilterType; typedef itk::ScalableAffineTransform<double, 2> TransformType; @@ -165,6 +168,8 @@ private: m_BasicResampler = BasicResamplerType::New(); + m_GeoImport = ImportGeoInformationFilterType::New(); + // Get Interpolator switch ( GetParameterInt("interpolator") ) { @@ -261,8 +266,11 @@ private: m_BasicResampler->SetEdgePaddingValue(defaultValue); + m_GeoImport->SetInput(m_BasicResampler->GetOutput()); + m_GeoImport->SetSource(refImage); + // Set the output image - SetParameterOutputImage("out", m_BasicResampler->GetOutput()); + SetParameterOutputImage("out", m_GeoImport->GetOutput()); } else { @@ -273,6 +281,8 @@ private: ResamplerType::Pointer m_Resampler; BasicResamplerType::Pointer m_BasicResampler; + + ImportGeoInformationFilterType::Pointer m_GeoImport; };