Commit 2a69433b authored by OTB Bot's avatar OTB Bot

MRG

parents 2faa5bb0 f58900a5
......@@ -40,7 +40,7 @@ TerraSarBrightnessImageFilter<TInputImage,TOutputImage>
TerraSarImageMetadataInterface::Pointer lImageMetadata = otb::TerraSarImageMetadataInterface::New();
if( !lImageMetadata->CanRead(this->GetInput()->GetMetaDataDictionary()) )
{
itkExceptionMacro(<<"Invalid input image. Only TerraSar images are supproted");
itkExceptionMacro(<<"Invalid input image. Only TerraSar images are supported");
}
this->SetCalFactor( lImageMetadata->GetCalibrationFactor(this->GetInput()->GetMetaDataDictionary()) );
}
......
......@@ -39,6 +39,23 @@ ELSE(OTB_BINARY_DIR)
FIND_PATH(OTB_DATA_LARGEINPUT_ROOT OTBData.readme $ENV{OTB_DATA_LARGEINPUT_ROOT})
MARK_AS_ADVANCED(OTB_DATA_LARGEINPUT_ROOT)
ENDIF(OTB_DATA_USE_LARGEINPUT)
MACRO(OTB_ADD_EXECUTABLE name sources libraries)
ADD_EXECUTABLE(${name} ${sources})
TARGET_LINK_LIBRARIES(${name} ${libraries})
IF(OTB_CPP_CHECK_SOURCE_FILE)
FOREACH( file ${sources})
ADD_CUSTOM_COMMAND( TARGET ${name}
PRE_BUILD
COMMAND ${OTB_CPP_CHECK_PROG}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
DEPENDS ${libraries}
COMMENT "============== C++ checking ${file} source file... =================="
VERBATIM )
ENDFOREACH(file)
ENDIF(OTB_CPP_CHECK_SOURCE_FILE)
ENDMACRO(OTB_ADD_EXECUTABLE)
# Find OTB and load its settings.
FIND_PACKAGE(OTB)
IF(OTB_FOUND)
......@@ -68,23 +85,6 @@ ELSE(OTB_BINARY_DIR)
STRING(REGEX REPLACE "^/" "" OTB_INSTALL_BIN_DIR_CM24 "${OTB_INSTALL_BIN_DIR}")
STRING(REGEX REPLACE "^/" "" OTB_INSTALL_INCLUDE_DIR_CM24 "${OTB_INSTALL_INCLUDE_DIR}")
MACRO(OTB_ADD_EXECUTABLE name sources libraries)
ADD_EXECUTABLE(${name} ${sources})
TARGET_LINK_LIBRARIES(${name} ${libraries})
IF(OTB_CPP_CHECK_SOURCE_FILE)
FOREACH( file ${sources})
ADD_CUSTOM_COMMAND( TARGET ${name}
PRE_BUILD
COMMAND ${OTB_CPP_CHECK_PROG}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${file}
DEPENDS ${libraries}
COMMENT "============== C++ checking ${file} source file... =================="
VERBATIM )
ENDFOREACH(file)
ENDIF(OTB_CPP_CHECK_SOURCE_FILE)
ENDMACRO(OTB_ADD_EXECUTABLE)
ENDIF(OTB_BINARY_DIR)
IF(OTB_COMPILE_WITH_FULL_WARNING)
......
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(Dart)
set(CTEST_PROJECT_NAME "OTB")
set(CTEST_NIGHTLY_START_TIME "20:00:00 CEST")
set(CTEST_NIGHTLY_IDENT_LOCATION "http://www.orfeo-toolbox.org/nightly/libNightlyNumber")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "dash.orfeo-toolbox.org")
set(CTEST_DROP_LOCATION "/submit.php?project=OTB")
set(CTEST_DROP_SITE_CDASH TRUE)
......@@ -1058,9 +1058,10 @@ ADD_TEST(raTvTerraSarBrightnessImageFunctor ${RADIOMETRY_TESTS9}
${BASELINE_FILES}/raTvTerraSarBrightnessImageFunctor.txt
${TEMP}/raTvTerraSarBrightnessImageFunctor.txt
otbTerraSarBrightnessImageFunctor
12
12
0
12 # real pixel
12 # complex real part pixel
0 # complex imaginary part pixel
1 # calFactor
${TEMP}/raTvTerraSarBrightnessImageFunctor.txt
)
......
......@@ -23,23 +23,21 @@
int otbTerraSarBrightnessImageFunctor(int argc, char * argv[])
{
char *outFilename = argv[5];
double calFact = atof(argv[4]);
typedef double ScalarType;
typedef std::complex<ScalarType> ComplexType;
typedef otb::Functor::TerraSarBrightnessImageFunctor<ScalarType, ScalarType> FunctorType;
FunctorType funct;
if(argc!=5)
{
std::cout << "argv[0] <Scalar pixel> <Complex pixel (re part)> <Complex pixel (im part)> <output filename>" << std::endl;
return EXIT_FAILURE;
}
funct.SetCalFactor(calFact);
ScalarType inPix = static_cast<ScalarType>(atof(argv[1]));
ComplexType inCplxPix(static_cast<ScalarType>(atof(argv[2])), static_cast<ScalarType>(atof(argv[3])));
char *outFilename = argv[4];
std::ofstream file;
file.open(outFilename);
......
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