Skip to content
Snippets Groups Projects
Commit 7c154bc2 authored by Thomas Feuvrier's avatar Thomas Feuvrier
Browse files

nomsg

parent 7f8cd136
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,15 @@ SET(TOL 0.0)
SET(COMMON_TESTS ${CXX_TEST_PATH}/otbCommonTests)
SET(IO_TESTS ${CXX_TEST_PATH}/otbIOTests)
# --- STREAMING ---
ADD_TEST(ioTvStreamingImageFilterTest ${IO_TESTS}
--compare-image ${TOL} ${TEMP}/ioStreamingImageFilterTestRef.png
${TEMP}/ioStreamingImageFilterTest.png
otbStreamingImageFilterTest
${INPUTDATA}/poupees_1canal.hd
${TEMP}/ioStreamingImageFilterTest.png
)
# --- RADARSAT (GDAL) ---
ADD_TEST(ioTvMultiMonoChannelROI_RADARSAT2BSQ ${COMMON_TESTS}
otbMultiToMonoChannelExtractROI
......@@ -350,7 +359,7 @@ otbImageFileReaderRGBTest.cxx
otbImageFileWriterRGBTest.cxx
otbMultiToMonoChannelExtractROISAR.cxx
otbImageFileReaderERS.cxx
otbStreamingImageFilterTest.cxx
)
INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")
......
......@@ -21,4 +21,5 @@ REGISTER_TEST(otbImageFileReaderRGBTest);
REGISTER_TEST(otbImageFileWriterRGBTest);
REGISTER_TEST(otbMultiToMonoChannelExtractROISAR);
REGISTER_TEST(otbImageFileReaderERS);
REGISTER_TEST(otbStreamingImageFilterTest);
}
// $Id$
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
//#define MAIN
#include "itkExceptionObject.h"
#include <iostream>
#include "itkImage.h"
#include "itkStreamingImageFilter.h"
#include "itkMeanImageFilter.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
int otbStreamingImageFilterTest (int argc, char* argv[])
{
try
{
// Verify the number of parameters in the command line
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 otb::ImageFileReader< InputImageType > ReaderType;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
typedef itk::MeanImageFilter<InputImageType,OutputImageType> MeanImageFilterType;
typedef itk::StreamingImageFilter<InputImageType,OutputImageType> StreamingImageFilterType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName( inputFilename );
writer->SetFileName( outputFilename );
// StreamingImageFilterType::Pointer streamer = StreamingImageFilterType::New();
// MeanImageFilterType::Pointer filter1 = MeanImageFilterType::New();
// filter1->SetInput( reader->GetOutput() );
// streamer->SetInput( filter1->GetOutput() );
// streamer->SetInput( reader->GetOutput() );
// streamer->SetNumberOfStreamDivisions( 5 );
// streamer->Update();
writer->SetInput( reader->GetOutput() );
// writer->SetInput( filter1->GetOutput() );
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cerr << "Exception OTB attrappee dans exception ITK !" << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
catch( ... )
{
std::cerr << "Exception OTB non attrappee !" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment