From cff1dd17cc251ecf9829593332c326f9bc2df306 Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@c-s.fr> Date: Tue, 24 Apr 2007 14:23:18 +0000 Subject: [PATCH] Remplacement des anciens tests. --- Testing/Code/FeatureExtraction/CMakeLists.txt | 23 --- .../FeatureExtraction/otbDrawPathList.cxx | 96 --------- .../otbDrawPathListTracerLignes.cxx | 194 ------------------ .../otbFeatureExtractionTests.cxx | 2 - 4 files changed, 315 deletions(-) delete mode 100644 Testing/Code/FeatureExtraction/otbDrawPathList.cxx delete mode 100644 Testing/Code/FeatureExtraction/otbDrawPathListTracerLignes.cxx diff --git a/Testing/Code/FeatureExtraction/CMakeLists.txt b/Testing/Code/FeatureExtraction/CMakeLists.txt index 9fa19168b9..25d9b964f7 100755 --- a/Testing/Code/FeatureExtraction/CMakeLists.txt +++ b/Testing/Code/FeatureExtraction/CMakeLists.txt @@ -29,27 +29,6 @@ ADD_TEST(feTvAlignMV2ITK ${FEATUREEXTRACTION_TESTS} # ------- otb::Draw ------------------------------ -ADD_TEST(feTvDrawSegmentIntoImage ${FEATUREEXTRACTION_TESTS} - --compare-image ${TOL} ${BASELINE}/feDrawPathIntoPoupees.png - ${TEMP}/feDrawPathIntoPoupees.png - otbDrawPathList - ${INPUTDATA}/poupees.hdr - ${TEMP}/feDrawPathIntoPoupees.png) - -ADD_TEST(feTvDrawSegmentIntoImageLine ${FEATUREEXTRACTION_TESTS} - --compare-image ${TOL} ${BASELINE}/feDrawDeuxLignes.png - ${TEMP}/feDrawDeuxLignes.png - otbDrawPathListTracerLignes - ${INPUTDATA}/DeuxTraits.png - ${TEMP}/feDrawDeuxLignes.png) - -ADD_TEST(feTvDrawSegmentIntoImage ${FEATUREEXTRACTION_TESTS} - --compare-image ${TOL} ${BASELINE}/feDrawPathIntoDeuxTraits.png - ${TEMP}/feDrawPathIntoDeuxTraits.png - otbDrawPathList - ${INPUTDATA}/DeuxTraits.png - ${TEMP}/feDrawPathIntoDeuxTraits.png) - ADD_TEST(feTvDrawPathTestCarre ${FEATUREEXTRACTION_TESTS} --compare-image ${TOL} ${BASELINE}/feDrawPathDessinCarre.png ${TEMP}/feDrawPathDessinCarre.png @@ -554,8 +533,6 @@ ADD_TEST(feTvNonMaxRemovalByDirectionFilter ${FEATUREEXTRACTION_TESTS} # A enrichir SET(BasicFeatureExtraction_SRCS otbAlignImageToPath.cxx -otbDrawPathList.cxx -otbDrawPathListTracerLignes.cxx otbDrawPath.cxx otbDrawPathAlign.cxx otbComplexMomentImage.cxx diff --git a/Testing/Code/FeatureExtraction/otbDrawPathList.cxx b/Testing/Code/FeatureExtraction/otbDrawPathList.cxx deleted file mode 100644 index 5673027ba6..0000000000 --- a/Testing/Code/FeatureExtraction/otbDrawPathList.cxx +++ /dev/null @@ -1,96 +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 "itkPolyLineParametricPath.h" - -#include "otbImage.h" -#include "otbPathListSource.h" -#include "otbImageToPathListAlignFilter.h" -#include "otbDrawPathListFilter.h" -#include "otbImageFileReader.h" -#include "otbImageFileWriter.h" - - -int otbDrawPathList( int argc, char * argv[] ) -{ - try - { - const char * inputFilename = argv[1]; - const char * outputFilename = argv[2]; - - - typedef unsigned char InputPixelType; - typedef unsigned char OutputPixelType; - const unsigned int Dimension = 2; - - typedef otb::Image< InputPixelType, Dimension > InputImageType; - typedef otb::Image< OutputPixelType, Dimension > OutputImageType; - - typedef itk::PolyLineParametricPath< Dimension > PathType; - typedef PathType::Pointer PathPointerType; - - typedef otb::ImageFileReader< InputImageType > ReaderType; - typedef otb::ImageFileWriter< OutputImageType > WriterType; - - typedef otb::DrawPathListFilter<InputImageType,PathType,OutputImageType> DrawPathListFilterType; - - typedef otb::ImageToPathListAlignFilter<InputImageType,PathType> PathListType; - - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - - DrawPathListFilterType::Pointer DrawPath = DrawPathListFilterType::New(); - - PathListType::Pointer testList = PathListType::New(); - - reader->SetFileName( inputFilename ); - writer->SetFileName( outputFilename ); - -//OTB-FA-00010-CS - testList->SetInput( reader->GetOutput() ); - testList->Update(); - - DrawPath->SetImageInput(reader->GetOutput() ); - DrawPath->SetPathInput( testList->GetOutput()); - DrawPath->Update(); - - writer->SetInput(DrawPath->GetImageOutput()); - writer->Update(); - - } - catch( itk::ExceptionObject & err ) - { - std::cout << "Exception itk::ExceptionObject levee !" << std::endl; - std::cout << err << std::endl; - return EXIT_FAILURE; - } - catch( ... ) - { - std::cout << "Exception levee inconnue !" << std::endl; - return EXIT_FAILURE; - } - // Software Guide : EndCodeSnippet - -//#endif - return EXIT_SUCCESS; -} diff --git a/Testing/Code/FeatureExtraction/otbDrawPathListTracerLignes.cxx b/Testing/Code/FeatureExtraction/otbDrawPathListTracerLignes.cxx deleted file mode 100644 index df0b897201..0000000000 --- a/Testing/Code/FeatureExtraction/otbDrawPathListTracerLignes.cxx +++ /dev/null @@ -1,194 +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 "itkImage.h" -#include "itkImageFileWriter.h" -#include "itkPolyLineParametricPath.h" - -#include "otbImageFileReader.h" -#include "otbPathListSource.h" -#include "otbImageToPathListAlignFilter.h" -#include "otbDrawPathListFilter.h" -#include "otbImageFileWriter.h" - - -int otbDrawPathListTracerLignes( int argc, char * argv[] ) -{ - try - { - const char * inputFilename = argv[1]; - const char * outputFilename = argv[2]; - - typedef unsigned char InputPixelType; - typedef unsigned char OutputPixelType; - const unsigned int Dimension = 2; - - typedef itk::Image< InputPixelType, Dimension > InputImageType; - typedef itk::Image< OutputPixelType, Dimension > OutputImageType; - - typedef itk::PolyLineParametricPath< Dimension > PathType; - typedef PathType::Pointer PathPointerType; - - typedef otb::ImageFileReader< InputImageType > ReaderType; - typedef itk::ImageFileWriter< OutputImageType > WriterType; - typedef otb::PathListSource<PathType> PathListType; - - typedef otb::DrawPathListFilter<InputImageType,PathType,OutputImageType> DrawPathListFilterType; - - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - - reader->SetFileName( inputFilename ); - writer->SetFileName( outputFilename ); - - InputImageType::ConstPointer image = reader->GetOutput(); - typedef InputImageType::PointType ImagePointType; - - PathListType::Pointer testList = PathListType::New(); - PathListType::OutputPathListType * path = testList->GetOutput(); - - - ImagePointType pos; - PathType::ContinuousIndexType cindex; - - - /*1er Segment*/ - PathType::Pointer pathElt1 = PathType::New(); - pathElt1->Initialize(); - - pos[0]=30; - pos[1]=30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt1->AddVertex(cindex); - pos[0]= 30; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt1->AddVertex(cindex); - - path->PushBack(pathElt1); - - /*2eme Segment*/ - PathType::Pointer pathElt2 = PathType::New(); - pathElt2->Initialize(); - pos[0]= 30; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt2->AddVertex(cindex); - pos[0]=130; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt2->AddVertex(cindex); - - path->PushBack(pathElt2); - - /*3eme Segment*/ - PathType::Pointer pathElt3 = PathType::New(); - pathElt3->Initialize(); - pos[0]=130; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt3->AddVertex(cindex); - pos[0]=130; - pos[1]= 30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt3->AddVertex(cindex); - - path->PushBack(pathElt3); - - /*4eme Segment*/ - PathType::Pointer pathElt4 = PathType::New(); - - pathElt4->Initialize(); - pos[0]=130; - pos[1]= 30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt4->AddVertex(cindex); - pos[0]=30; - pos[1]=30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt4->AddVertex(cindex); - - path->PushBack(pathElt4); - - /*5eme Segment*/ - PathType::Pointer pathElt5 = PathType::New(); - pathElt5->Initialize(); - pos[0]= 30; - pos[1]= 30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt5->AddVertex(cindex); - pos[0]=130; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt5->AddVertex(cindex); - - path->PushBack(pathElt5); - - /*6eme Segment*/ - PathType::Pointer pathElt6 = PathType::New(); - - pathElt6->Initialize(); - pos[0]=130; - pos[1]= 30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt6->AddVertex(cindex); - pos[0]= 30; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt6->AddVertex(cindex); - - path->PushBack(pathElt6); - - - -#if 0 - testList->SetImageInput( reader->GetOutput() ); - testList->Update(); -#endif - DrawPathListFilterType::Pointer DrawPath = DrawPathListFilterType::New(); - - DrawPath->SetImageInput(reader->GetOutput() ); - DrawPath->SetPathInput( testList->GetOutput()); -// DrawPath->SetImageOutput(); - DrawPath->Update(); - - writer->SetInput(DrawPath->GetImageOutput()); - writer->Update(); - - } - catch( itk::ExceptionObject & err ) - { - std::cout << "Exception itk::ExceptionObject levee !" << std::endl; - std::cout << err << std::endl; - return EXIT_FAILURE; - } - catch( ... ) - { - std::cout << "Exception levee inconnue !" << std::endl; - return EXIT_FAILURE; - } - // Software Guide : EndCodeSnippet - -//#endif - return EXIT_SUCCESS; -} diff --git a/Testing/Code/FeatureExtraction/otbFeatureExtractionTests.cxx b/Testing/Code/FeatureExtraction/otbFeatureExtractionTests.cxx index 36495876ae..f82a98e134 100755 --- a/Testing/Code/FeatureExtraction/otbFeatureExtractionTests.cxx +++ b/Testing/Code/FeatureExtraction/otbFeatureExtractionTests.cxx @@ -28,8 +28,6 @@ void RegisterTests() { REGISTER_TEST(otbAlignImageToPath); -REGISTER_TEST(otbDrawPathList); -REGISTER_TEST(otbDrawPathListTracerLignes); REGISTER_TEST(otbDrawPathDessinCarre); REGISTER_TEST(otbDrawPathAlign); REGISTER_TEST(otbComplexMomentImage); -- GitLab