Commit 0e723e70 authored by Julien Osman's avatar Julien Osman

FIX: Encapsulate output metadata in GenericRSResampleImageFilter

parent 8f85f3d2
Pipeline #6207 failed with stages
in 92 minutes and 39 seconds
...@@ -481,7 +481,7 @@ void ImageMetadata::Merge(const ImageMetadata& imd) ...@@ -481,7 +481,7 @@ void ImageMetadata::Merge(const ImageMetadata& imd)
{ {
ImageMetadataBase::Fuse(imd); ImageMetadataBase::Fuse(imd);
for (unsigned int i = 0; i < std::min(Bands.size(), imd.Bands.size()); i++) for (unsigned int i = 0; i < std::min(Bands.size(), imd.Bands.size()); ++i)
{ {
Bands[i].Fuse(imd.Bands[i]); Bands[i].Fuse(imd.Bands[i]);
} }
......
...@@ -99,8 +99,10 @@ void GenericRSResampleImageFilter<TInputImage, TOutputImage>::GenerateOutputInfo ...@@ -99,8 +99,10 @@ void GenericRSResampleImageFilter<TInputImage, TOutputImage>::GenerateOutputInfo
m_Resampler->UpdateOutputInformation(); m_Resampler->UpdateOutputInformation();
this->GraftOutput(m_Resampler->GetOutput()); this->GraftOutput(m_Resampler->GetOutput());
// Encapsulate output projRef // Encapsulate output projRef and metadata
this->GetOutput()->m_Imd.Add(MDGeom::ProjectionProj, this->GetOutputProjectionRef()); if (this->GetOutputImageMetadata() != nullptr)
this->GetOutput()->m_Imd.Merge(*(this->GetOutputImageMetadata()));
this->GetOutput()->m_Imd.Add(MDGeom::ProjectionWKT, this->GetOutputProjectionRef());
} }
/** /**
...@@ -119,8 +121,8 @@ void GenericRSResampleImageFilter<TInputImage, TOutputImage>::EstimateOutputRpcM ...@@ -119,8 +121,8 @@ void GenericRSResampleImageFilter<TInputImage, TOutputImage>::EstimateOutputRpcM
tempPtr->SetRegions(region); tempPtr->SetRegions(region);
// Encapsulate the output metadata in the temp image // Encapsulate the output metadata in the temp image
tempPtr->m_Imd.Add(MDGeom::ProjectionWKT, this->GetOutputProjectionRef());
tempPtr->SetImageMetadata(*(this->GetOutputImageMetadata())); tempPtr->SetImageMetadata(*(this->GetOutputImageMetadata()));
tempPtr->m_Imd.Add(MDGeom::ProjectionProj, this->GetOutputProjectionRef());
// Estimate the rpc model from the temp image // Estimate the rpc model from the temp image
m_OutputRpcEstimator->SetInput(tempPtr); m_OutputRpcEstimator->SetInput(tempPtr);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment