diff --git a/Applications/Util/otbRescale.cxx b/Applications/Util/otbRescale.cxx index 2e86be9e32e4d1d8996df109b52cb13793fdcc50..ba9bd376fa7b164f2dac12d21f233fa7ff48c76d 100644 --- a/Applications/Util/otbRescale.cxx +++ b/Applications/Util/otbRescale.cxx @@ -75,10 +75,6 @@ private: void DoUpdateParameters() { // Nothing to do here for the parameters : all are independent - - // Reinitialize the object - m_RescaleFilter = RescaleImageFilterType::New(); - m_MinMaxFilter = MinMaxFilterType::New(); } void DoExecute() @@ -87,8 +83,10 @@ private: otbAppLogDEBUG( << "Starting Min/Max computation" ) - m_MinMaxFilter->GetStreamer()->SetNumberOfLinesStrippedStreaming( 50 ); + m_MinMaxFilter = MinMaxFilterType::New(); m_MinMaxFilter->SetInput( inImage ); + m_MinMaxFilter->GetStreamer()->SetNumberOfLinesStrippedStreaming( 50 ); + AddProcess(m_MinMaxFilter->GetStreamer(), "Min/Max computing"); m_MinMaxFilter->Update(); @@ -97,6 +95,7 @@ private: FloatVectorImageType::PixelType inMin, inMax; + m_RescaleFilter = RescaleImageFilterType::New(); m_RescaleFilter->SetInput( inImage ); m_RescaleFilter->SetInputMinimum( m_MinMaxFilter->GetMinimum() ); m_RescaleFilter->SetInputMaximum( m_MinMaxFilter->GetMaximum() );