From aeb0966203e0b4b26a264df73f0ca6f77d26acf2 Mon Sep 17 00:00:00 2001 From: Cyrille Valladeau <cyrille.valladeau@c-s.fr> Date: Wed, 14 May 2008 15:12:11 +0000 Subject: [PATCH] Suppresssion de tests inutiles dans Markov. --- Testing/Code/Markov/CMakeLists.txt | 24 ------ Testing/Code/Markov/otbMRFEnergy.cxx | 97 ---------------------- Testing/Code/Markov/otbMRFEnergyNew.cxx | 42 ---------- Testing/Code/Markov/otbMRFOptimizerNew.cxx | 32 ------- Testing/Code/Markov/otbMRFSamplerNew.cxx | 38 --------- Testing/Code/Markov/otbMarkovTests1.cxx | 3 - Testing/Code/Markov/otbMarkovTests2.cxx | 1 - 7 files changed, 237 deletions(-) delete mode 100644 Testing/Code/Markov/otbMRFEnergy.cxx delete mode 100644 Testing/Code/Markov/otbMRFEnergyNew.cxx delete mode 100644 Testing/Code/Markov/otbMRFOptimizerNew.cxx delete mode 100644 Testing/Code/Markov/otbMRFSamplerNew.cxx diff --git a/Testing/Code/Markov/CMakeLists.txt b/Testing/Code/Markov/CMakeLists.txt index 3a3e986310..9d179c6a5d 100755 --- a/Testing/Code/Markov/CMakeLists.txt +++ b/Testing/Code/Markov/CMakeLists.txt @@ -35,18 +35,6 @@ ADD_TEST(maTvMarkovRandomFieldFilter ${MARKOV_TESTS1} 1.0 ) -# ------- otb::MRFEnergy ------------------------------ -ADD_TEST(maTuMRFEnergyNew ${MARKOV_TESTS1} - otbMRFEnergyNew ) - -ADD_TEST(maTvMRFEnergy ${MARKOV_TESTS1} ---compare-ascii ${TOL} ${BASELINE_FILES}/maTvMRFEnergy.txt - ${TEMP}/maTvMRFEnergy.txt - otbMRFEnergy - ${INPUTDATA}/poupees_sub_c1.png - ${INPUTDATA}/poupees_sub_c2.png - ${TEMP}/maTvMRFEnergy.txt - ) # ------- otb::MRFEnergyEdgeFidelity ------------------------------ ADD_TEST(maTuMRFEnergyEdgeFidelityNew ${MARKOV_TESTS1} @@ -84,9 +72,6 @@ ADD_TEST(maTvMRFEnergyPotts ${MARKOV_TESTS1} ${TEMP}/maTvMRFEnergyPotts.txt ) -# ------- otbMRFOptimizer ------------------------------ -ADD_TEST(maTuMRFOptimizerNew ${MARKOV_TESTS1} - otbMRFOptimizerNew ) # ------- otbMRFOptimizerICM ------------------------------ ADD_TEST(maTuMRFOptimizerICMNew ${MARKOV_TESTS1} @@ -114,11 +99,6 @@ ADD_TEST(maTvMRFOptimizerMetropolis ${MARKOV_TESTS2} ) -# ------- otbMRFSampler ------------------------------ -ADD_TEST(maTuMRFSamplerNew ${MARKOV_TESTS2} - otbMRFSamplerNew ) - - # ------- otbMRFSamplerMAP ------------------------------ ADD_TEST(maTuMRFSamplerMAPNew ${MARKOV_TESTS2} otbMRFSamplerMAPNew ) @@ -166,15 +146,12 @@ ADD_TEST(maTvMRFSamplerRandomMAP ${MARKOV_TESTS2} SET(Markov_SRCS1 otbMarkovRandomFieldFilterNew.cxx otbMarkovRandomFieldFilter.cxx -otbMRFEnergyNew.cxx -otbMRFEnergy.cxx otbMRFEnergyPottsNew.cxx otbMRFEnergyPotts.cxx otbMRFEnergyEdgeFidelityNew.cxx otbMRFEnergyEdgeFidelity.cxx otbMRFEnergyGaussianClassificationNew.cxx otbMRFEnergyGaussianClassification.cxx -otbMRFOptimizerNew.cxx otbMRFOptimizerICMNew.cxx otbMRFOptimizerICM.cxx ) @@ -182,7 +159,6 @@ otbMRFOptimizerICM.cxx SET(Markov_SRCS2 otbMRFOptimizerMetropolisNew.cxx otbMRFOptimizerMetropolis.cxx -otbMRFSamplerNew.cxx otbMRFSamplerMAPNew.cxx otbMRFSamplerMAP.cxx otbMRFSamplerRandomNew.cxx diff --git a/Testing/Code/Markov/otbMRFEnergy.cxx b/Testing/Code/Markov/otbMRFEnergy.cxx deleted file mode 100644 index 60e2c55a2b..0000000000 --- a/Testing/Code/Markov/otbMRFEnergy.cxx +++ /dev/null @@ -1,97 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#if defined(_MSC_VER) -#pragma warning ( disable : 4786 ) -#endif - -#include "otbMRFEnergy.h" -#include "otbImage.h" -#include "otbImageFileReader.h" -#include <fstream> - -int otbMRFEnergy(int argc, char * argv[]) -{ - const char * inputImage = argv[1]; - const char * labelImage = argv[2]; - const char * outputFile = argv[3]; - - typedef double PixelTypeInput; - typedef int PixelTypeLabel; - typedef otb::Image<PixelTypeInput, 2> ImageType; - typedef otb::Image<PixelTypeLabel, 2> LabelType; - typedef otb::MRFEnergy< ImageType, LabelType> MRFEnergyType; - typedef otb::ImageFileReader< ImageType > ReaderInputType; - typedef otb::ImageFileReader< LabelType > ReaderLabelType; - typedef MRFEnergyType::InputImagePixelType InputImagePixelType; - typedef MRFEnergyType::LabelledImagePixelType LabelledImagePixelType; - typedef MRFEnergyType::LabelledNeighborhoodIterator LabelledNeighborhoodIterator; - typedef MRFEnergyType::InputNeighborhoodIterator InputNeighborhoodIterator; - typedef MRFEnergyType::ParametersType ParametersType; - - MRFEnergyType::Pointer object = MRFEnergyType::New(); - ReaderInputType::Pointer readerIn = ReaderInputType::New(); - ReaderLabelType::Pointer readerLab = ReaderLabelType::New(); - - readerIn->SetFileName( inputImage ); - readerLab->SetFileName( labelImage ); - readerIn->Update(); - readerLab->Update(); - - object->SetNumberOfParameters( 4 ); - - ParametersType parameters; - parameters.SetSize(4); - parameters[0]=10.0; //Class 0 mean - parameters[1]=10.0; //Class 0 stdev - parameters[2]=80.0; //Class 1 mean - parameters[3]=10.0; //Class 1 stdev - - object->SetParameters( parameters ); - - ImageType::IndexType idIn; - LabelType::IndexType idLab; - idIn[0] = 50; - idIn[1] = 50; - idLab[0] = 100; - idLab[1] = 100; - InputImagePixelType inPix = readerIn->GetOutput()->GetPixel( idIn ); - LabelledImagePixelType inLab = readerLab->GetOutput()->GetPixel( idLab ); - - InputNeighborhoodIterator::RadiusType radIn; - radIn.Fill(3); - LabelledNeighborhoodIterator::RadiusType radLab; - radLab.Fill(3); - - InputNeighborhoodIterator iterIn = InputNeighborhoodIterator( radIn, readerIn->GetOutput(), readerIn->GetOutput()->GetLargestPossibleRegion()); - - LabelledNeighborhoodIterator iterLab = LabelledNeighborhoodIterator( radLab, readerLab->GetOutput(), readerLab->GetOutput()->GetLargestPossibleRegion()); - - std::ofstream file; - file.open(outputFile); - file<<"Used pixels: (50, 50) -> "<<inPix<<" , (100, 100) -> "<<inLab<<std::endl; - file<<std::endl; - file<<"GetSingleValue(const InputImagePixelType, const LabelledImagePixelType): "<< object->GetValue(inPix, inLab)<<std::endl; - file<<"GetValue(const InputImagePixelType, const LabelledImagePixelType): "<< object->GetValue(inPix, inLab)<<std::endl; - file<<"GetValue(const LabelledNeighborhoodIterator, const LabelledImagePixelType): "<< object->GetValue(iterLab, inLab)<<std::endl; - file<<"GetValue(const InputNeighborhoodIterator, const LabelledImagePixelType): "<< object->GetValue(iterIn, inLab)<<std::endl; - - file.close(); - - return EXIT_SUCCESS; -} - diff --git a/Testing/Code/Markov/otbMRFEnergyNew.cxx b/Testing/Code/Markov/otbMRFEnergyNew.cxx deleted file mode 100644 index 5243993471..0000000000 --- a/Testing/Code/Markov/otbMRFEnergyNew.cxx +++ /dev/null @@ -1,42 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#if defined(_MSC_VER) -#pragma warning ( disable : 4786 ) -#endif - -#include "otbMRFEnergy.h" -#include "otbImage.h" - - -int otbMRFEnergyNew(int argc, char * argv[]) -{ - typedef double PixelType; - typedef int PixelType2; - - typedef otb::Image<PixelType, 2> ImageType; - typedef otb::Image<PixelType2, 2> ImageType2; - typedef otb::MRFEnergy< ImageType, ImageType > MRFEnergyType; - typedef otb::MRFEnergy< ImageType, ImageType2 > MRFEnergyType2; - - MRFEnergyType::Pointer object = MRFEnergyType::New(); - MRFEnergyType2::Pointer object2 = MRFEnergyType2::New(); - - - return EXIT_SUCCESS; -} - diff --git a/Testing/Code/Markov/otbMRFOptimizerNew.cxx b/Testing/Code/Markov/otbMRFOptimizerNew.cxx deleted file mode 100644 index 36d122e4fd..0000000000 --- a/Testing/Code/Markov/otbMRFOptimizerNew.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#if defined(_MSC_VER) -#pragma warning ( disable : 4786 ) -#endif - -#include "otbMRFOptimizer.h" - -int otbMRFOptimizerNew(int argc, char * argv[]) -{ - typedef otb::MRFOptimizer MRFOptimizerType; - - MRFOptimizerType::Pointer object = MRFOptimizerType::New(); - - return EXIT_SUCCESS; -} - diff --git a/Testing/Code/Markov/otbMRFSamplerNew.cxx b/Testing/Code/Markov/otbMRFSamplerNew.cxx deleted file mode 100644 index 1f72b012af..0000000000 --- a/Testing/Code/Markov/otbMRFSamplerNew.cxx +++ /dev/null @@ -1,38 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#if defined(_MSC_VER) -#pragma warning ( disable : 4786 ) -#endif - -#include "itkExceptionObject.h" - -#include "otbMRFSampler.h" -#include "otbImage.h" - - -int otbMRFSamplerNew(int argc, char * argv[]) -{ - typedef double PixelType; - typedef otb::Image<PixelType, 2> ImageType; - typedef otb::MRFSampler< ImageType, ImageType> MRFSamplerType; - - //MRFSamplerType::Pointer object = MRFSamplerType::New(); - - return EXIT_SUCCESS; -} - diff --git a/Testing/Code/Markov/otbMarkovTests1.cxx b/Testing/Code/Markov/otbMarkovTests1.cxx index 61c9e05e20..dec53b3d93 100755 --- a/Testing/Code/Markov/otbMarkovTests1.cxx +++ b/Testing/Code/Markov/otbMarkovTests1.cxx @@ -29,15 +29,12 @@ void RegisterTests() { REGISTER_TEST(otbMarkovRandomFieldFilterNew); REGISTER_TEST(otbMarkovRandomFieldFilter); -REGISTER_TEST(otbMRFEnergyNew); -REGISTER_TEST(otbMRFEnergy); REGISTER_TEST(otbMRFEnergyEdgeFidelityNew); REGISTER_TEST(otbMRFEnergyEdgeFidelity); REGISTER_TEST(otbMRFEnergyPottsNew); REGISTER_TEST(otbMRFEnergyPotts); REGISTER_TEST(otbMRFEnergyGaussianClassificationNew); REGISTER_TEST(otbMRFEnergyGaussianClassification); -REGISTER_TEST(otbMRFOptimizerNew); REGISTER_TEST(otbMRFOptimizerICMNew); REGISTER_TEST(otbMRFOptimizerICM); } diff --git a/Testing/Code/Markov/otbMarkovTests2.cxx b/Testing/Code/Markov/otbMarkovTests2.cxx index 2488ca7a57..e1cd403153 100644 --- a/Testing/Code/Markov/otbMarkovTests2.cxx +++ b/Testing/Code/Markov/otbMarkovTests2.cxx @@ -29,7 +29,6 @@ void RegisterTests() { REGISTER_TEST(otbMRFOptimizerMetropolisNew); REGISTER_TEST(otbMRFOptimizerMetropolis); -REGISTER_TEST(otbMRFSamplerNew); REGISTER_TEST(otbMRFSamplerMAPNew); REGISTER_TEST(otbMRFSamplerMAP); REGISTER_TEST(otbMRFSamplerRandomNew); -- GitLab