Commit 7d86bc59 authored by Guillaume Borrut's avatar Guillaume Borrut
Browse files

ENH. RAD format testings

parent b042b0b2
......@@ -1448,19 +1448,23 @@ ADD_TEST(ioTuRADImageIOCanRead_RADCR4mult ${IO_TESTS16}
# Convert a ci2.RAD file into ENVI format
ADD_TEST(ioTvImageFileReaderRADCI22ENVI ${IO_TESTS16}
otbImageFileReaderTest
otbImageFileReaderRADComplex
#--compare-image ${TOL} /home3/mathieu/guillaume/CD_CNES/RAD_CI2/3017_HH.rad
# ${TEMP}/ioImageFileReaderRAD2ENVI.hdr
/home3/mathieu/guillaume/CD_CNES/RAD_CI2/3017_HH.rad
${TEMP}/ioImageFileReaderRAD2ENVI.hdr )
# Convert a cr4.RAD file into tif
ADD_TEST(ioTvImageFileReaderRADCR42TIF ${IO_TESTS16}
otbImageFileReaderTest
otbImageFileReaderRADComplex
#--compare-image ${TOL} /home3/mathieu/guillaume/CD_CNES/RAD_CR4_full/hvbas_calib_l1900_c1050.rad
# ${TEMP}/ioImageFileReaderRAD2ENVI.tif
/home3/mathieu/guillaume/CD_CNES/RAD_CR4_full/hvbas_calib_l1900_c1050.rad
${TEMP}/ioImageFileReaderRAD2ENVI.tif )
# Write a RAD file
ADD_TEST(ioTvImageFileReaderTIF2RADCI2 ${IO_TESTS16}
otbImageFileReaderTest
otbImageFileReaderRADComplex
/home3/mathieu/guillaume/CD_CNES/RSAT_cyrille/RSAT_imagery_VH.tif
${TEMP}/ioImageFileReaderTIF2RADCI2.rad )
......@@ -1590,7 +1594,8 @@ otbKMLVectorDataIOTestCanWrite.cxx
SET(BasicIO_SRCS16
otbRADImageIOTestCanRead.cxx
#otbALOSImageIOTestCanRead.cxx
otbImageFileReaderTest.cxx
otbImageFileReaderRAD.cxx
otbImageFileReaderRADComplex.cxx
)
INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")
......
......@@ -30,5 +30,6 @@ void RegisterTests()
{
REGISTER_TEST(otbRADImageIOTestCanRead);
//REGISTER_TEST(otbALOSImageIOTestCanRead);
REGISTER_TEST(otbImageFileReaderTest);
REGISTER_TEST(otbImageFileReaderRAD);
REGISTER_TEST(otbImageFileReaderRADComplex);
}
/*=========================================================================
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 "otbImage.h"
#include "itkExceptionObject.h"
#include <iostream>
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
int otbImageFileReaderRAD(int argc, char* argv[])
{
// Verify the number of parameters in the command line
const char * inputFilename = argv[1];
const char * outputFilename = argv[2];
typedef float InputPixelType;
typedef float OutputPixelType;
const unsigned int Dimension = 2;
typedef otb::Image< InputPixelType, Dimension > InputImageType;
typedef otb::Image< OutputPixelType, Dimension > OutputImageType;
typedef otb::ImageFileReader< InputImageType > ReaderType;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName( inputFilename );
writer->SetFileName( outputFilename );
writer->SetInput( reader->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.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "itkExceptionObject.h"
#include <iostream>
#include "itkComplexToRealImageFilter.h"
#include "itkComplexToImaginaryImageFilter.h"
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbExtractROI.h"
int otbImageFileReaderRADComplex(int argc, char* argv[])
{
// Verify the number of parameters in the command line
const char * inputFilename = argv[1];
const char * outputFilename = argv[2];
typedef std::complex<float> InputPixelType;
typedef std::complex<float> OutputPixelType;
const unsigned int Dimension = 2;
typedef otb::Image< InputPixelType, Dimension > InputImageType;
typedef otb::Image< OutputPixelType, Dimension > OutputImageType;
typedef otb::ImageFileReader< InputImageType > ReaderType;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName( inputFilename );
writer->SetFileName( outputFilename );
writer->SetInput( reader->GetOutput() );
writer->Update();
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