From 60bd5589b8db6933f1370ee86ec2361360a353fd Mon Sep 17 00:00:00 2001 From: Cyrille Valladeau <cyrille.valladeau@c-s.fr> Date: Wed, 3 Dec 2008 10:44:11 +0100 Subject: [PATCH] BUG : try to fix prolate bug --- .../otbProlateInterpolateImageFunction.h | 4 +- .../otbProlateInterpolateImageFunction.cxx | 129 ------------------ .../BasicFilters/otbProlateValidationTest.cxx | 22 +-- 3 files changed, 4 insertions(+), 151 deletions(-) diff --git a/Code/BasicFilters/otbProlateInterpolateImageFunction.h b/Code/BasicFilters/otbProlateInterpolateImageFunction.h index cb7b750a49..17a0bc2ed0 100644 --- a/Code/BasicFilters/otbProlateInterpolateImageFunction.h +++ b/Code/BasicFilters/otbProlateInterpolateImageFunction.h @@ -87,7 +87,9 @@ class ProlateFunction static const unsigned int m_OriginalProfileSize; /** Original prolate profil */ static const double m_OriginalProfile[721]; - + protected: + ProlateFunction(){ m_Radius = 1; }; + ~ProlateFunction(){}; }; }//namespace Function diff --git a/Testing/Code/BasicFilters/otbProlateInterpolateImageFunction.cxx b/Testing/Code/BasicFilters/otbProlateInterpolateImageFunction.cxx index 7d5fd02ead..d3ba2e53d3 100644 --- a/Testing/Code/BasicFilters/otbProlateInterpolateImageFunction.cxx +++ b/Testing/Code/BasicFilters/otbProlateInterpolateImageFunction.cxx @@ -124,136 +124,7 @@ int otbProlateInterpolateImageFunction(int argc, char * argv[]) itkcoswriter->SetFileName(itkcosfname); coswriter->Update(); itkcoswriter->Update(); - /* - unsigned int rad = 10; - - typedef otb::WindowedSincInterpolateImageGaussianFunction<ImageType> GaussInterpolatorType; - typedef otb::WindowedSincInterpolateImageHammingFunction<ImageType> HamInterpolatorType; - typedef otb::WindowedSincInterpolateImageCosineFunction<ImageType> CosInterpolatorType; - typedef itk::Function::HammingWindowFunction<10, double, double> itkHamType; - typedef itk::WindowedSincInterpolateImageFunction<ImageType, 10, itkHamType> itkHamInterpolatorType; - typedef itk::Function::CosineWindowFunction<10, double, double> itkCosType; - typedef itk::WindowedSincInterpolateImageFunction<ImageType, 10, itkCosType> itkCosInterpolatorType; - typedef itk::DifferenceImageFilter<ImageType, ImageType> DiffType; - */ - // Instantiating object - - /* - WriterType::Pointer gausswriter = WriterType::New(); - WriterType::Pointer hamwriter = WriterType::New(); - WriterType::Pointer coswriter = WriterType::New(); - WriterType::Pointer itkhamwriter = WriterType::New(); - WriterType::Pointer itkcoswriter = WriterType::New(); - WriterType::Pointer cosdiffwriter = WriterType::New(); - WriterType::Pointer hamdiffwriter = WriterType::New(); - */ - - /* - StreamingResampleImageFilterType::Pointer gaussresampler = StreamingResampleImageFilterType::New(); - StreamingResampleImageFilterType::Pointer hamresampler = StreamingResampleImageFilterType::New(); - StreamingResampleImageFilterType::Pointer cosresampler = StreamingResampleImageFilterType::New(); - StreamingResampleImageFilterType::Pointer itkhamresampler = StreamingResampleImageFilterType::New(); - StreamingResampleImageFilterType::Pointer itkcosresampler = StreamingResampleImageFilterType::New(); - DiffType::Pointer hamdiff = DiffType::New(); - DiffType::Pointer cosdiff = DiffType::New(); - */ - - - /* - HamInterpolatorType::Pointer ham = HamInterpolatorType::New(); - CosInterpolatorType::Pointer cos = CosInterpolatorType::New(); - itkHamInterpolatorType::Pointer itkham = itkHamInterpolatorType::New(); - itkCosInterpolatorType::Pointer itkcos = itkCosInterpolatorType::New(); - GaussInterpolatorType::Pointer gauss = GaussInterpolatorType::New(); - */ - - //proresampler->SetInterpolatorNeighborhoodRadius(rad); - /* - gaussresampler->SetInput(reader->GetOutput()); - gauss->SetRadius(rad); - gaussresampler->SetInterpolator(gauss); - //gaussresampler->SetInterpolatorNeighborhoodRadius(rad); - - hamresampler->SetInput(reader->GetOutput()); - ham->SetRadius(rad); - hamresampler->SetInterpolator(ham); - //hamresampler->SetInterpolatorNeighborhoodRadius(rad); - - cosresampler->SetInput(reader->GetOutput()); - cos->SetRadius(rad); - cosresampler->SetInterpolator(cos); - //cosresampler->SetInterpolatorNeighborhoodRadius(30); - - itkhamresampler->SetInput(reader->GetOutput()); - itkhamresampler->SetInterpolator(itkham); - //itkhamresampler->SetInterpolatorNeighborhoodRadius(rad); - - itkcosresampler->SetInput(reader->GetOutput()); - itkcosresampler->SetInterpolator(itkcos); - //itkcosresampler->SetInterpolatorNeighborhoodRadius(30); - */ - // Size of output resampler result - - /* - gaussresampler->SetSize(size); - gaussresampler->SetOutputSpacing(tutu); - - hamresampler->SetSize(size); - hamresampler->SetOutputSpacing(tutu); - - cosresampler->SetSize(size); - cosresampler->SetOutputSpacing(tutu); - - itkhamresampler->SetSize(size); - itkhamresampler->SetOutputSpacing(tutu); - - itkcosresampler->SetSize(size); - itkcosresampler->SetOutputSpacing(tutu); - */ - /* - gausswriter->SetInput(gaussresampler->GetOutput()); - //gausswriter->SetNumberOfStreamDivisions(1); - gausswriter->SetFileName("gaussresample.tif"); - - hamwriter->SetInput(hamresampler->GetOutput()); - //hamwriter->SetNumberOfStreamDivisions(1); - hamwriter->SetFileName("hamresample.tif"); - - coswriter->SetInput(cosresampler->GetOutput()); - //coswriter->SetNumberOfStreamDivisions(1); - coswriter->SetFileName("cosresample.tif"); - - itkhamwriter->SetInput(itkhamresampler->GetOutput()); - //itkhamwriter->SetNumberOfStreamDivisions(1); - itkhamwriter->SetFileName("itkhamresample.tif"); - - itkcoswriter->SetInput(itkcosresampler->GetOutput()); - //itkcoswriter->SetNumberOfStreamDivisions(1); - itkcoswriter->SetFileName("itkcosresample.tif"); - - gausswriter->Update(); - hamwriter->Update(); - coswriter->Update(); - itkhamwriter->Update(); - itkcoswriter->Update(); - - cosdiff->SetInput(0, cosresampler->GetOutput()); - cosdiff->SetInput(1, itkcosresampler->GetOutput()); - //cosdiffwriter->SetNumberOfStreamDivisions(1); - cosdiffwriter->SetFileName("cosdiff.tif"); - cosdiffwriter->SetInput(cosdiff->GetOutput()); - - hamdiff->SetInput(0, hamresampler->GetOutput()); - hamdiff->SetInput(1, itkhamresampler->GetOutput()); - //hamdiffwriter->SetNumberOfStreamDivisions(1); - hamdiffwriter->SetFileName("hamdiff.tif"); - hamdiffwriter->SetInput(hamdiff->GetOutput()); - - cosdiffwriter->Update(); - hamdiffwriter->Update(); - */ - return EXIT_SUCCESS; } diff --git a/Testing/Code/BasicFilters/otbProlateValidationTest.cxx b/Testing/Code/BasicFilters/otbProlateValidationTest.cxx index 5d4e30ccfc..706f39248a 100644 --- a/Testing/Code/BasicFilters/otbProlateValidationTest.cxx +++ b/Testing/Code/BasicFilters/otbProlateValidationTest.cxx @@ -67,14 +67,6 @@ int otbProlateValidationTest(int argc, char * argv[]) std::cout<<"Radius : "<<prolate->GetRadius()<<std::endl; std::cout<<"Factor : "<<factor<<std::endl; - /* - otb::Function::ProlateFunction<double,double> function; ///= prolate->GetFunction(); - function.SetRadius(rad); - std::cout<<"Originalprofilsize: "<< function.GetOriginalProfileSize()<<std::endl; - std::cout<<"Energy : "<<function.ComputeEnergy(factor)<<std::endl; - std::cout<<"Radius : "<<function.GetRadius()<<std::endl; - std::cout<<"Factor : "<<factor<<std::endl; - */ proresampler->SetInput(reader->GetOutput()); proresampler->SetInterpolator(prolate); StreamingResampleImageFilterType::SizeType size; @@ -88,18 +80,6 @@ int otbProlateValidationTest(int argc, char * argv[]) prowriter->SetFileName(outfname); prowriter->Update(); - /* - prowriter = WriterType::New(); - proresampler = StreamingResampleImageFilterType::New(); - proresampler->SetSize(size); - proresampler->SetOutputSpacing(newSpacing); - proresampler->SetOutputOrigin(origin); - proresampler->SetInput(reader->GetOutput()); - def->SetInputImage(reader->GetOutput()); - proresampler->SetInterpolator(def); - prowriter->SetInput(proresampler->GetOutput()); - prowriter->SetFileName(defaultoutfname); - prowriter->Update(); - */ + return EXIT_SUCCESS; } -- GitLab