diff --git a/Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx b/Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx index f6f2bf54fa11f58b326c30d1537374fa6d70f137..a1de6164ec14f87c32ea8680ba7475ed34083168 100644 --- a/Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx +++ b/Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx @@ -499,15 +499,15 @@ private: { m_ThumbSize[0] = GetParameterInt("spatial.local.w"); m_ThumbSize[1] = GetParameterInt("spatial.local.h"); - } if ( size[0] == m_ThumbSize[0] && size[1] == m_ThumbSize[1] ) - { - std::ostringstream oss; - oss<<"Warning you choose to compute the histogram with a local " - "method whereas you have selected the whole image for the thumbnail " - "size. In order to use less memory consider using the global option for " - "histogram computation."; - otbAppLogWARNING( << oss.str() ); + { + std::ostringstream oss; + oss<<"Warning you choose to compute the histogram with a local " + "method whereas you have selected the whole image for the thumbnail " + "size. In order to use less memory consider using the global option for " + "histogram computation."; + otbAppLogWARNING( << oss.str() ); + } } } @@ -855,7 +855,7 @@ private: HistoPersistentFilterType::HistogramType::Pointer histo; FloatImageType::SpacingType inputSpacing ( - GetParameterImage("in")->GetSpacing() ); + GetParameterImage("in")->GetSignedSpacing() ); FloatImageType::PointType inputOrigin ( GetParameterImage("in")->GetOrigin() ); @@ -901,7 +901,7 @@ private: histoVectorImage->SetBufferedRegion( sizeOne ); histoVectorImage->SetRequestedRegion( sizeOne ); histoVectorImage->SetLargestPossibleRegion( sizeOne ); - histoVectorImage->SetSpacing( histoSpacing ) ; + histoVectorImage->SetSignedSpacing( histoSpacing ) ; histoVectorImage->SetOrigin( histoOrigin ); histoVectorImage->Allocate(); for (unsigned int j = 0 ; j < nbBin ; j++ ) diff --git a/Modules/Filtering/Contrast/include/otbApplyGainFilter.txx b/Modules/Filtering/Contrast/include/otbApplyGainFilter.txx index 0bac49d38490b66a24866a9fd1a4ba8ed166525d..28bd851c0dbc83959e497147b413fb4cc8ad224b 100644 --- a/Modules/Filtering/Contrast/include/otbApplyGainFilter.txx +++ b/Modules/Filtering/Contrast/include/otbApplyGainFilter.txx @@ -100,10 +100,10 @@ void ApplyGainFilter < TInputImage , TLut , TOutputImage > typename InputImageType::ConstPointer input ( GetInputImage() ); if ( m_ThumbSizeFromSpacing ) { - m_ThumbSize[0] = std::round( lut->GetSpacing()[0] - / input->GetSpacing()[0] ); - m_ThumbSize[1] = std::round( lut->GetSpacing()[1] - / input->GetSpacing()[1] ); + m_ThumbSize[0] = std::round( lut->GetSignedSpacing()[0] + / input->GetSignedSpacing()[0] ); + m_ThumbSize[1] = std::round( lut->GetSignedSpacing()[1] + / input->GetSignedSpacing()[1] ); } m_Step = static_cast<double>( m_Max - m_Min ) \ / static_cast<double>( lut->GetVectorLength() - 1 ); diff --git a/Modules/Filtering/Contrast/include/otbComputeHistoFilter.txx b/Modules/Filtering/Contrast/include/otbComputeHistoFilter.txx index 9b67322b3781193972bae7acb2bd5d366e424fd0..c29b223c648ba16b16caac2ec38431474898d233 100644 --- a/Modules/Filtering/Contrast/include/otbComputeHistoFilter.txx +++ b/Modules/Filtering/Contrast/include/otbComputeHistoFilter.txx @@ -123,13 +123,13 @@ void ComputeHistoFilter < TInputImage , TOutputImage > region.SetIndex(start); output->SetNumberOfComponentsPerPixel(m_NbBin); output->SetLargestPossibleRegion(region); - typename InputImageType::SpacingType inputSpacing ( input->GetSpacing() ); + typename InputImageType::SpacingType inputSpacing ( input->GetSignedSpacing() ); typename InputImageType::PointType inputOrigin ( input->GetOrigin() ); typename OutputImageType::SpacingType histoSpacing ; histoSpacing[0] = inputSpacing[0] * m_ThumbSize[0] ; histoSpacing[1] = inputSpacing[1] * m_ThumbSize[1] ; - output->SetSpacing( histoSpacing ) ; + output->SetSignedSpacing( histoSpacing ) ; typename OutputImageType::PointType histoOrigin ; histoOrigin[0] = histoSpacing[0] / 2 + inputOrigin[0] - inputSpacing[0] / 2 ;