From d5c3c7aab44040c3c034f9978566320b77159d32 Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@c-s.fr> Date: Thu, 29 Nov 2007 15:00:24 +0000 Subject: [PATCH] tentative de correction pb de streaming --- Code/Fusion/otbBayesianFusionFilter.txx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Code/Fusion/otbBayesianFusionFilter.txx b/Code/Fusion/otbBayesianFusionFilter.txx index 659a9ab408..98c34146b2 100755 --- a/Code/Fusion/otbBayesianFusionFilter.txx +++ b/Code/Fusion/otbBayesianFusionFilter.txx @@ -68,6 +68,10 @@ namespace otb TOutputImage> ::BeforeThreadedGenerateData () { + OutputImageRegionType msiRequestedRegion = this->GetMultiSpectInterp()->GetRequestedRegion(); + OutputImageRegionType msRequestedRegion = this->GetMultiSpect()->GetRequestedRegion(); + OutputImageRegionType panchroRequestedRegion = this->GetPanchro()->GetRequestedRegion(); + // Allocate output typename OutputImageType::Pointer output = this->GetOutput(); typename InputMultiSpectralImageType::Pointer multiSpec = const_cast<InputMultiSpectralImageType *>(this->GetMultiSpect()); @@ -91,13 +95,15 @@ namespace otb covComputefilter->SetInput(multiSpecInterp); covComputefilter->Update(); + MatrixType m_CovarianceMatrix = covComputefilter->GetCovariance(); + m_CovarianceInvMatrix = m_CovarianceMatrix.GetInverse(); /** Beta computation : Regression model coefficient */ // MatrixTransform only support vectorimage input typename CasterType::Pointer caster = CasterType::New(); caster->SetInput(panchro); - caster->Update(); + // caster->Update(); // Compute the transpose multispectral image multiplied by itself typename MSTransposeMSType::Pointer msTransposeMs = MSTransposeMSType::New(); // Compute the transpose multispectral image multiplied by the panchromatic one @@ -262,6 +268,16 @@ namespace otb this->GetFunctor().SetCovarianceInvMatrix(m_CovarianceInvMatrix); this->GetFunctor().SetLambda(m_Lambda); this->GetFunctor().SetS(m_S); + + + // Restore the previous buffered data + multiSpecInterp->SetRequestedRegion(msiRequestedRegion); + multiSpecInterp->PropagateRequestedRegion(); + multiSpecInterp->UpdateOutputData(); + + multiSpec->SetRequestedRegion(msRequestedRegion); + multiSpec->PropagateRequestedRegion(); + multiSpec->UpdateOutputData(); } } // end namespace otb -- GitLab