diff --git a/Testing/Fa/CMakeLists.txt b/Testing/Fa/CMakeLists.txt index 6480e5a9355929a72ec78519b464e033b27e783c..02a6f5a0b959bf45de7c9ef1d38aceda3c712953 100755 --- a/Testing/Fa/CMakeLists.txt +++ b/Testing/Fa/CMakeLists.txt @@ -12,7 +12,7 @@ SET(EXAMPLES_DATA ${OTB_SOURCE_DIR}/Examples/Data) #Tolerance sur diff pixel image SET(TOL 0.0) -# !!!!! Pointe sur un exe généré dans le repertoire Common +# !!!!! Pointe sur un exe g�n�r� dans le repertoire Common SET(COMMON_TESTS ${CXX_TEST_PATH}/otbCommonTests) SET(IO_TESTS ${CXX_TEST_PATH}/otbIOTests) SET(VISU_TESTS ${CXX_TEST_PATH}/otbVisuTests) @@ -139,7 +139,7 @@ ADD_TEST(FA-00012-co_AlignementsQB ${CXX_TEST_PATH}/AlignementsQB ) -# --- FA 00013 : impossible d'écrire une image TIFF(CAI) -> GDAL --- +# --- FA 00013 : impossible d'�crire une image TIFF(CAI) -> GDAL --- ADD_TEST(FA-00013-io_WriteImageTIFF ${IO_TESTS} otbImageFileWriterTest ${INPUTDATA}/sbuv_NB_c1.png @@ -177,12 +177,22 @@ ADD_TEST(FA-00060-le_Map_Activation ${CXX_TEST_PATH}/MapActivation # ------- Fin des FAs traitees ----------------------------------- +ADD_TEST(FA-00070-vi_Streaming_Stat ${CXX_TEST_PATH}/StreamingStat + ${EXAMPLES_DATA}/qb_RoadExtract.tif + ) + + + ADD_EXECUTABLE(AlignementsQB AlignementsQB.cxx) TARGET_LINK_LIBRARIES(AlignementsQB OTBFeatureExtraction OTBIO OTBCommon gdal ITKIO ITKCommon) ADD_EXECUTABLE(MapActivation MapActivation.cxx) TARGET_LINK_LIBRARIES(MapActivation OTBFeatureExtraction OTBIO OTBCommon gdal ITKIO ITKCommon) +ADD_EXECUTABLE(StreamingStat StreamingStat.cxx) +TARGET_LINK_LIBRARIES(StreamingStat OTBFeatureExtraction OTBIO OTBCommon gdal ITKIO ITKCommon) + + INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}") ENDIF( NOT OTB_DISABLE_CXX_TESTING ) diff --git a/Testing/Fa/StreamingStat.cxx b/Testing/Fa/StreamingStat.cxx new file mode 100644 index 0000000000000000000000000000000000000000..64a3842e3be71f7b85fc7b261a90a7a8f88ccded --- /dev/null +++ b/Testing/Fa/StreamingStat.cxx @@ -0,0 +1,37 @@ + +#include "otbImage.h" +#include "otbVectorImage.h" +#include "otbImageFileReader.h" +#include "otbStreamingStatisticsImageFilter.h" +#include "otbVectorImageTo3DScalarImageFilter.h" + +int main(int argc, char ** argv) +{ + + typedef otb::Image< double, 2 > ImageType; + typedef otb::Image< double, 3 > Image3DType; + typedef otb::VectorImage< double, 2 > VectorImageType; + typedef otb::ImageFileReader< VectorImageType > ReaderType; + + ReaderType::Pointer reader1 = ReaderType::New(); + reader1->SetFileName( argv[1] ); + + + typedef otb::VectorImageTo3DScalarImageFilter<VectorImageType, Image3DType> + VectorImageTo3DScalarImageFilterType; + VectorImageTo3DScalarImageFilterType::Pointer filter1 = + VectorImageTo3DScalarImageFilterType::New(); + + + typedef otb::StreamingStatisticsImageFilter<Image3DType> statFilterType; + statFilterType::Pointer statFilter= statFilterType::New(); + + filter1->SetInput(reader1->GetOutput()); +// filter1->Update(); + statFilter->SetInput(filter1->GetOutput()); + statFilter->Update(); + + std::cout << statFilter->GetMean() << std::endl; + + +}