From 218183b0f41897ef46efe90a384092d705d03921 Mon Sep 17 00:00:00 2001 From: Cyrille Valladeau <cyrille.valladeau@c-s.fr> Date: Wed, 29 Apr 2009 17:04:27 +0200 Subject: [PATCH] ENH : bad correction --- Code/Learning/otbROIdataConversion.txx | 5 +---- Testing/Code/Learning/otbROIdataConversion.cxx | 14 ++++++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Code/Learning/otbROIdataConversion.txx b/Code/Learning/otbROIdataConversion.txx index 97e3dd65b6..7e4255521f 100644 --- a/Code/Learning/otbROIdataConversion.txx +++ b/Code/Learning/otbROIdataConversion.txx @@ -75,10 +75,7 @@ ROIdataConversion< TInputImage, TInputROIImage > typename OutputImageType::Pointer outputPtr = this->GetOutput(); outputPtr->Allocate(); - typename InputImageType::PixelType defaultPix; - defaultPix.SetSize(inputImagePtr->GetNumberOfComponentsPerPixel()); - defaultPix.Fill(0); - outputPtr->FillBuffer(defaultPix); + outputPtr->FillBuffer(static_cast<typename InputImageType::PixelType>(0)); itk::ImageRegionConstIterator< InputImageType > inputIter diff --git a/Testing/Code/Learning/otbROIdataConversion.cxx b/Testing/Code/Learning/otbROIdataConversion.cxx index 64ba648691..f9c8200373 100644 --- a/Testing/Code/Learning/otbROIdataConversion.cxx +++ b/Testing/Code/Learning/otbROIdataConversion.cxx @@ -30,20 +30,18 @@ int otbROIdataConversion( int argc, char* argv[] ) { - typedef double PixelType; - const unsigned int Dimension = 2; - typedef otb::VectorImage< PixelType, Dimension > InputImageType; - typedef otb::Image< PixelType, Dimension > InputROIImageType; - typedef otb::ROIdataConversion<InputImageType, InputROIImageType> ConvertorType; - typedef ConvertorType::OutputImageType OutputImageType; + typedef double PixelType; + const unsigned int Dimension = 2; + typedef otb::Image< PixelType, Dimension > InputImageType; + typedef otb::ROIdataConversion<InputImageType, InputImageType> ConvertorType; + typedef ConvertorType::OutputImageType OutputImageType; typedef otb::ImageFileReader<InputImageType> ReaderType; - typedef otb::ImageFileReader<InputROIImageType> ReaderROIType; typedef otb::ImageFileWriter<OutputImageType> WriterType; ConvertorType::Pointer convertor = ConvertorType::New(); ReaderType::Pointer readerIm = ReaderType::New(); - ReaderROIType::Pointer readerTr = ReaderROIType::New(); + ReaderType::Pointer readerTr = ReaderType::New(); readerIm->SetFileName(argv[1]); readerTr->SetFileName(argv[2]); -- GitLab