Commit ed412893 authored by Jonathan Guinet's avatar Jonathan Guinet
Browse files

TEST: Simulation Spatialization filter test.

parent 2280d09d
......@@ -95,11 +95,18 @@ ADD_TEST(siTuReduceSpectralResponseClassifierRAndNIR ${Simulation_TESTS2}
# 0.199854 #aerosolOptical
# )
ADD_TEST(siTuSpatialisationTest ${Simulation_TESTS2}
ADD_TEST(siTuSpatialisationTestNew ${Simulation_TESTS2}
otbSpatialisationTestNew
)
ADD_TEST(siTvSpatialisationTest ${Simulation_TESTS2}
--compare-image ${TOL} ${BASELINE}/Simulation/siTvSpatialisationTest.tif
${TEMP}/siTvSpatialisationTest.tif
otbSpatialisationTest
${TEMP}/SpatialisationTest.tif
${TEMP}/siTvSpatialisationTest.tif
)
ADD_TEST(siTuLabelMapToSimulatedImageFilterTest ${Simulation_TESTS2}
otbLabelMapToSimulatedImageFilterTest
${INPUTDATA}/Simulation/Shapefile/culturesWithAndWithoutPath.shp
......@@ -285,6 +292,7 @@ otbReduceSpectralResponse.cxx
otbReduceSpectralResponseClassifierRAndNIR.cxx
otbAtmosphericEffects.cxx
otbSpatialisationTest.cxx
otbSpatialisationTestNew.cxx
otbLabelMapToSimulatedImageFilterTest.cxx
otbImageSimulationMethodWithVectorDataTest.cxx
otbImageSimulationMethodWithSpatialisationTest.cxx
......
......@@ -32,6 +32,7 @@ void RegisterTests()
REGISTER_TEST(otbReduceSpectralResponse);
REGISTER_TEST(otbReduceSpectralResponseClassifierRAndNIR);
REGISTER_TEST(otbAtmosphericEffects);
REGISTER_TEST(otbSpatialisationTestNew);
REGISTER_TEST(otbSpatialisationTest);
REGISTER_TEST(otbLabelMapToSimulatedImageFilterTest);
REGISTER_TEST(otbImageSimulationMethodWithVectorDataTest);
......
......@@ -93,16 +93,12 @@ int otbSpatialisationTest(int argc, char * argv[])
//
// std::cout<<"nb labels : "<<filter->GetOutput()->GetNumberOfLabelObjects()<<std::endl;
// filter->GetOutput()->PrintLabelObjects();
// labelMapToLabelImageFilter->SetInput(filter->GetOutput());
// // labelMapToLabelImageFilter->Update();
labelMapToLabelImageFilter->SetInput(filter->GetOutput());
labelMapToLabelImageFilter->Update();
//
// writer->SetFileName(outfilename);
// writer->SetInput(labelMapToLabelImageFilter->GetOutput());
// writer->Update();
// This test does not check the output and does not even produce it
// as such, it is incomplete and can be returning SUCCESS.
return EXIT_FAILURE;
writer->SetFileName(outfilename);
writer->SetInput(labelMapToLabelImageFilter->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}
/*=========================================================================
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.
=========================================================================*/
#include "itkExceptionObject.h"
#include "otbMacro.h"
#include "otbSpatialisationFilter.h"
#include "otbImage.h"
#include "otbAttributesMapLabelObject.h"
int otbSpatialisationTestNew(int argc, char * argv[])
{
const char * outfilename = argv[1];
typedef unsigned short LabelType;
const unsigned int Dimension = 2;
typedef otb::Image<LabelType, Dimension> ImageType;
typedef otb::AttributesMapLabelObject<LabelType, Dimension, std::string> LabelObjectType;
typedef itk::LabelMap<LabelObjectType> LabelMapType;
typedef otb::SpatialisationFilter<LabelMapType> FilterType;
FilterType::Pointer filter = FilterType::New();
return EXIT_SUCCESS;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment