Unverified Commit ec470c9d authored by Kasper Marstal's avatar Kasper Marstal Committed by GitHub
Browse files

Merge pull request #103 from SuperElastix/SELX-62-enable-logger-for-all-components-variadic

Replaced boost logger with spdlog and integrated logging with SuperElastix core.
parents d9d0d1c5 9731f117
......@@ -21,22 +21,65 @@ cache:
- ${ITK_BUILD_DIR}
- ${ELASTIX_SOURCE_DIR}
- ${ELASTIX_BUILD_DIR}
matrix:
include:
- os: linux
dist: trusty
sudo: required
compiler: clang
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
env:
- GCC="CC=gcc-4.9 && CXX=g++-4.9"
- os: linux
dist: trusty
sudo: required
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env:
- GCC="CC=gcc-5 && CXX=g++-5"
- os: linux
dist: trusty
sudo: required
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- GCC="CC=gcc-6 && CXX=g++-6"
- os: linux
dist: trusty
sudo: required
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
env:
- GCC="CC=gcc-7 && CXX=g++-7"
- os: osx
compiler: clang
- os: osx
compiler: gcc
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then eval ${GCC}; fi;
before_script:
- mkdir -p ${SUPERELASTIX_BUILD_DIR}
- mkdir -p ${ExternalData_OBJECT_STORES}
......@@ -54,11 +97,11 @@ script:
cd ${ITK_BUILD_DIR} &&
cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -DCMAKE_VISIBILITY_INLINES_HIDDEN:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_SKIP_RPATH:BOOL=ON -DITK_LEGACY_REMOVE:BOOL=ON -DITK_USE_KWSTYLE:BOOL=OFF -DITK_BUILD_DEFAULT_MODULES:BOOL=ON -DModule_ITKReview:BOOL=ON ${ITK_SOURCE_DIR} &&
make --jobs=4; fi
- if [[ ! -e ${ELASTIX_BUILD_DIR}/UseElastix.cmake ]]; then
- if [[ ! -e ${ELASTIX_BUILD_DIR}/ElastixConfig.cmake ]]; then
rm -rf ${ELASTIX_SOURCE_DIR} ${ELASTIX_BUILD_DIR} &&
git clone ${ELASTIX_URL} ${ELASTIX_SOURCE_DIR} &&
cd ${ELASTIX_SOURCE_DIR} &&
git checkout b617fcaf2399041dbec259ab8c408225174d878d &&
git checkout e8354222396c6bd78e9fe6d5a39e4ecac4bb0d52 &&
mkdir -p ${ELASTIX_BUILD_DIR} &&
cd ${ELASTIX_BUILD_DIR} &&
cmake -DBUILD_TESTING:BOOL=OFF -DELASTIX_BUILD_EXECUTABLE:BOOL=OFF -DITK_DIR=${ITK_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release ${ELASTIX_SOURCE_DIR} &&
......@@ -66,5 +109,5 @@ script:
touch ${HOME_DIR}/built_cache; fi
- cd ${SUPERELASTIX_BUILD_DIR}
- if [[ ! -e ${HOME_DIR}/built_cache ]]; then
cmake -DBUILD_APPLICATIONS_EXTERNAL_PROJECT:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_ITK:BOOL=ON -DITK_DIR=${ITK_BUILD_DIR} -DUSE_SYSTEM_ELASTIX:BOOL=ON -DELASTIX_DIR=${ELASTIX_BUILD_DIR} ${SUPERELASTIX_SOURCE_DIR} &&
cmake -DBUILD_APPLICATIONS_EXTERNAL_PROJECT:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_ITK:BOOL=ON -DITK_DIR=${ITK_BUILD_DIR} -DUSE_SYSTEM_ELASTIX:BOOL=ON -DElastix_DIR=${ELASTIX_BUILD_DIR} ${SUPERELASTIX_SOURCE_DIR} &&
make --jobs=4; fi
......@@ -56,6 +56,7 @@ include( ${SUPERELASTIX_USE_FILE} )
find_package( ITK )
include( ${ITK_USE_FILE} )
find_package( Elastix )
include( ${ELASTIX_USE_FILE} )
add_subdirectory( CommandLineInterface )
......@@ -27,18 +27,14 @@ set( ${APPLICATION}_SOURCE_FILES
${${APPLICATION}_SOURCE_DIR}/src/selxConfigurationReader.cxx
)
set( ${APPLICATION}_LINK_LIBRARIES
${ITK_LIBRARIES}
${Boost_LIBRARIES}
)
set( ${APPLICATION}_MODULE_DEPENDENCIES
ModuleFilter
)
set( ${MODULE}_TEST_SOURCE_FILES
${${MODULE}_SOURCE_DIR}/test/selxConfigurationReader.cxx
)
# TODO: Find out how to include selxConfigurationReader.cxx in compilation unit
#set( ${APPLICATION}_TEST_SOURCE_FILES
# ${${APPLICATION}_SOURCE_DIR}/test/selxConfigurationReaderTest.cxx
#)
set( ${APPLICATION}_INTEGRATION_TEST_SOURCE_FILES
${${APPLICATION}_SOURCE_DIR}/test/integration.cmake
......
......@@ -36,13 +36,13 @@ set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost COMPONENTS program_options system filesystem REQUIRED QUIET )
find_package(Boost COMPONENTS program_options filesystem system regex REQUIRED QUIET )
include_directories( ${Boost_INCLUDE_DIR} )
# Compile executable
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/include" )
add_executable( SuperElastix ${COMMANDLINE_SOURCE_FILES} ${COMMANDLINE_HEADER_FILES} )
target_link_libraries( SuperElastix ${SUPERELASTIX_LIBRARIES} ${Boost_LIBRARIES} ${ITK_LIBRARIES} )
target_link_libraries( SuperElastix ${SUPERELASTIX_LIBRARIES} ${Boost_LIBRARIES} ${ITK_LIBRARIES} ${ELASTIX_LIBRARIES} )
# demo copies SuperElastix executable, image data, configuration files and bat/bash scripts to the DEMO_PREFIX directory
set( DEMO_PREFIX ${PROJECT_BINARY_DIR}/Demo CACHE PATH "Demo files will be copied to this directory" )
......
......@@ -21,12 +21,13 @@
#define ConfigurationReader_cxx
#include "selxConfigurationReader.h"
#include "selxLoggerImpl.h"
#include <ostream>
namespace selx
{
ConfigurationReader::ParameterValueType
ConfigurationReader::VectorizeValues( const ComponentOrConnectionTreeType & componentOrConnectionTree )
ConfigurationReader::VectorizeValues( ComponentOrConnectionTreeType & componentOrConnectionTree )
{
std::string propertySingleValue = componentOrConnectionTree.data();
ParameterValueType propertyMultiValue;
......@@ -50,14 +51,20 @@ ConfigurationReader::VectorizeValues( const ComponentOrConnectionTreeType & comp
BlueprintImpl
ConfigurationReader::FromFile(const PathType & filename)
ConfigurationReader::FromFile(const PathType & fileName)
{
std::cout << "Scanning for Includes: " << filename << std::endl;
auto propertyTree = ReadPropertyTree(filename);
LoggerImpl logger;
logger.Log( LogLevel::INF, "Loading {0} ... ");
auto propertyTree = ReadPropertyTree(fileName);
logger.Log( LogLevel::INF, "Loading {0} ... Done");
logger.Log( LogLevel::INF, "Checking {0} for include files ... ", fileName);
auto includesList = FindIncludes(propertyTree);
if (includesList.size() == 0)
{
std::cout << "Load: " << filename << std::endl;
logger.Log( LogLevel::INF, "Checking {0} for include files ... Done. No include files specified.", fileName);
return FromPropertyTree(propertyTree);
}
else
......@@ -65,28 +72,37 @@ ConfigurationReader::FromFile(const PathType & filename)
BlueprintImpl baseBlueprint = BlueprintImpl();
for (auto const & includePath : includesList)
{
logger.Log( LogLevel::INF, "Including file {0} ... ", includePath);
baseBlueprint.ComposeWith(FromFile(includePath));
std::cout << "Compose with: " << filename << std::endl;
logger.Log( LogLevel::INF, "Including include file {0} ... Done", includePath);
}
baseBlueprint.ComposeWith(FromPropertyTree(propertyTree));
logger.Log( LogLevel::INF, "Checking {0} for include files ... Done");
return baseBlueprint;
}
}
void
ConfigurationReader::MergeFromFile(BlueprintImplPointer blueprint, const PathType & filename)
ConfigurationReader::MergeFromFile(BlueprintImplPointer blueprint, const PathType & fileName)
{
std::cout << "Scanning for Includes: " << filename << std::endl;
auto propertyTree = ReadPropertyTree(filename);
LoggerImpl logger;
logger.Log( LogLevel::INF, "Loading {0} ... ", fileName);
auto propertyTree = ReadPropertyTree(fileName);
logger.Log( LogLevel::INF, "Loading {0} ... Done", fileName);
logger.Log( LogLevel::INF, "Checking {0} for include files ... ", fileName);
auto includesList = FindIncludes(propertyTree);
if (includesList.size() > 0)
{
for (auto const & includePath : includesList)
{
logger.Log( LogLevel::INF, "Including file {0} ... ", includePath);
MergeFromFile(blueprint, includePath);
}
}
std::cout << "Load: " << filename << std::endl;
logger.Log( LogLevel::INF, "Checking {0} for include files ... done", fileName);
MergeProperties(blueprint, propertyTree);
return;
}
......@@ -138,6 +154,7 @@ ConfigurationReader::FindIncludes(const PropertyTreeType & propertyTree)
BlueprintImpl
ConfigurationReader::FromPropertyTree( const PropertyTreeType & pt )
{
LoggerImpl logger;
BlueprintImpl blueprint = BlueprintImpl();
BOOST_FOREACH( const PropertyTreeType::value_type & v, pt.equal_range( "Component" ) )
......@@ -166,7 +183,8 @@ ConfigurationReader::FromPropertyTree( const PropertyTreeType & pt )
std::string connectionName = v.second.data();
if( connectionName != "" )
{
std::cout << "warning connectionName " "" << connectionName << "" " is ignored" << std::endl;
// TODO: Why is it ignored?
logger.Log( LogLevel::WRN, "Connection {0} is ignored.", connectionName);
}
std::string outName;
std::string inName;
......@@ -188,7 +206,7 @@ ConfigurationReader::FromPropertyTree( const PropertyTreeType & pt )
}
else if( connectionKey == "Name" )
{
std::cout << "Warning: connection 'Name'-s are ignored." << std::endl;
logger.Log( LogLevel::WRN, "Connections with key 'Name' are ignored.");
continue;
}
else
......@@ -207,6 +225,7 @@ ConfigurationReader::FromPropertyTree( const PropertyTreeType & pt )
void
ConfigurationReader::MergeProperties(BlueprintImplPointer blueprint, const PropertyTreeType & pt)
{
LoggerImpl logger;
BOOST_FOREACH(const PropertyTreeType::value_type & v, pt.equal_range("Component"))
{
std::string componentName;
......@@ -280,7 +299,7 @@ ConfigurationReader::MergeProperties(BlueprintImplPointer blueprint, const Prope
std::string connectionName = v.second.data();
if (connectionName != "")
{
std::cout << "warning connectionName " "" << connectionName << "" " is ignored" << std::endl;
logger.Log( LogLevel::WRN, "Connection {0} is ignored.", connectionName);
}
std::string outName;
std::string inName;
......@@ -302,7 +321,7 @@ ConfigurationReader::MergeProperties(BlueprintImplPointer blueprint, const Prope
}
else if (connectionKey == "Name")
{
std::cout << "Warning: connection 'Name'-s are ignored." << std::endl;
logger.Log( LogLevel::WRN, "Connections with key 'Name' are ignored.");
continue;
}
else
......
......@@ -50,6 +50,9 @@ operator<<( std::ostream & os, const std::vector< T > & v )
int
main( int ac, char * av[] )
{
// add logger
selx::Logger::Pointer logger = selx::Logger::New();
try
{
typedef std::vector< std::string > VectorOfStringsType;
......@@ -58,8 +61,6 @@ main( int ac, char * av[] )
// instantiate a SuperElastixFilter that is loaded with default components
selx::SuperElastixFilter::Pointer superElastixFilter = selx::SuperElastixFilter::New();
// add logger
selx::Logger::Pointer logger = selx::Logger::New();
superElastixFilter->SetLogger(logger);
boost::filesystem::path configurationPath;
......@@ -113,6 +114,7 @@ main( int ac, char * av[] )
if( vm.count( "in" ) )
{
logger->Log( selx::LogLevel::INF, "Preparing input data ... ");
int index = 0;
for( const auto & inputPair : inputPairs )
{
......@@ -125,19 +127,26 @@ main( int ac, char * av[] )
// since we do not know which reader type we should instantiate for input "name",
// we ask SuperElastix for a reader that matches the type of the source component "name"
logger->Log( selx::LogLevel::INF, "Preparing input " + name + " ..." );
selx::AnyFileReader::Pointer reader = superElastixFilter->GetInputFileReader( name );
reader->SetFileName( path );
superElastixFilter->SetInput( name, reader->GetOutput() );
fileReaders.push_back( reader );
logger->Log( selx::LogLevel::INF, "Preparing input " + name + "... Done" );
std::cout << "Input data " << index << " " << name << " : " << path << "\n";
++index;
}
logger->Log( selx::LogLevel::INF, "Preparing input data ... Done");
}
else
{
logger->Log( selx::LogLevel::INF, "No input data specified.");
}
if( vm.count( "out" ) )
{
logger->Log( selx::LogLevel::INF, "Preparing output data ... ");
int index = 0;
for( const auto & outputPair : outputPairs )
{
......@@ -148,34 +157,40 @@ main( int ac, char * av[] )
// since we do not know which writer type we should instantiate for output "name",
// we ask SuperElastix for a writer that matches the type of the sink component "name"
logger->Log( selx::LogLevel::INF, "Preparing output " + name + " ..." );
selx::AnyFileWriter::Pointer writer = superElastixFilter->GetOutputFileWriter( name );
//ImageWriter2DType::Pointer writer = ImageWriter2DType::New();
writer->SetFileName( path );
//writer->SetInput(superElastixFilter->GetOutput<Image2DType>(name));
writer->SetInput( superElastixFilter->GetOutput( name ) );
fileWriters.push_back( writer );
std::cout << "Output data " << index << " " << name << " : " << path << "\n";
logger->Log( selx::LogLevel::INF, "Preparing output " + name + " ... Done" );
++index;
}
}
else
{
logger->Log( selx::LogLevel::INF, "No output data specified.");
}
/* Execute SuperElastix by updating the writers */
logger->Log( selx::LogLevel::INF, "Executing ...");
for( auto & writer : fileWriters )
{
writer->Update();
}
logger->Log(selx:: LogLevel::INF, "Executing ... Done");
}
catch( std::exception & e )
{
logger->Log( selx::LogLevel::ERR, "Executing ... Error");
std::cerr << "error: " << e.what() << "\n";
return 1;
}
catch( ... )
{
logger->Log( selx::LogLevel::ERR, "Executing ... Error");
std::cerr << "Exception of unknown type!\n";
}
......
......@@ -40,16 +40,16 @@ public:
TEST_F( ConfigurationReaderTest, ReadXML )
{
ConfigurationReader::BlueprintPointerType blueprint;
BlueprintImpl blueprint;
EXPECT_NO_THROW( blueprint = ConfigurationReader::FromXML( this->dataManager->GetConfigurationFile( "itkv4_SVF_ANTsCC.xml" ) ) );
blueprint->Write( this->dataManager->GetOutputFile( "configurationReaderTest_itkv4_SVF_ANTsCC.xml.dot" ) );
EXPECT_NO_THROW( blueprint = ConfigurationReader::FromFile( this->dataManager->GetConfigurationFile( "itkv4_SVF_ANTsCC.xml" ) ) );
blueprint.Write( this->dataManager->GetOutputFile( "configurationReaderTest_itkv4_SVF_ANTsCC.xml.dot" ) );
}
TEST_F( ConfigurationReaderTest, ReadJson )
{
ConfigurationReader::BlueprintPointerType blueprint;
BlueprintImpl blueprint;
EXPECT_NO_THROW( blueprint = ConfigurationReader::FromJson( this->dataManager->GetConfigurationFile( "itkv4_SVF_ANTsCC.json" ) ) );
blueprint->Write( this->dataManager->GetOutputFile( "configurationReaderTest_itkv4_SVF_ANTsCC.json.dot" ) );
EXPECT_NO_THROW( blueprint = ConfigurationReader::FromFile( this->dataManager->GetConfigurationFile( "itkv4_SVF_ANTsCC.json" ) ) );
blueprint.Write( this->dataManager->GetOutputFile( "configurationReaderTest_itkv4_SVF_ANTsCC.json.dot" ) );
}
......@@ -97,15 +97,14 @@ macro( _selxapplication_enable APPLICATION UPSTREAM )
endif()
add_executable( ${${APPLICATION}_TARGET_NAME} "${${APPLICATION}_HEADER_FILES}" "${${APPLICATION}_SOURCE_FILES}" )
if( ${APPLICATION}_LINK_LIBRARIES )
target_link_libraries( ${${APPLICATION}_TARGET_NAME} ${${APPLICATION}_LINK_LIBRARIES} )
endif()
target_link_libraries( ${${APPLICATION}_TARGET_NAME} ${SUPERELASTIX_LIBRARIES} ${ITK_LIBRARIES} ${Boost_LIBRARIES} )
if( BUILD_TESTING AND ${MODULE}_TEST_SOURCE_FILES )
list( APPEND SUPERELASTIX_TEST_SOURCE_FILES ${${MODULE}_TEST_SOURCE_FILES} )
if( BUILD_TESTING AND ${APPLICATION}_TEST_SOURCE_FILES )
list( APPEND SUPERELASTIX_TEST_SOURCE_FILES ${APPLICATION}_TEST_SOURCE_FILES )
endif()
add_dependencies( ${${APPLICATION}_TARGET_NAME} ModuleCore )
message( STATUS "${APPLICATION} enabled." )
else()
message( STATUS "${APPLICATION} already enabled." )
......@@ -113,7 +112,7 @@ macro( _selxapplication_enable APPLICATION UPSTREAM )
endmacro()
macro( _selxapplication_disable APPLICATION )
set( USE_${APPLICATION} FALSE )
set( USE_${APPLICATION} OFF )
endmacro()
macro( add_integration_test )
......
......@@ -119,8 +119,7 @@ include( ${ITK_USE_FILE} )
set( Boost_USE_STATIC_LIBS ON ) # only find static libs
set( Boost_USE_MULTITHREADED ON )
set( Boost_USE_STATIC_RUNTIME OFF )
find_package( Boost 1.65.0 EXACT COMPONENTS filesystem system log_setup log date_time chrono atomic thread regex REQUIRED QUIET ) # graph ?
find_package( Boost 1.65.0 EXACT COMPONENTS program_options filesystem system regex REQUIRED QUIET ) # graph ?
include_directories( ${Boost_INCLUDE_DIRS} )
# ---------------------------------------------------------------------
......@@ -131,24 +130,25 @@ option( BUILD_APPLICATIONS "Build applications." OFF )
mark_as_advanced( BUILD_SHARED_LIBS )
option( BUILD_SHARED_LIBS "Build shared libraries." OFF )
mark_as_advanced( BUILD_EXPRESS )
option( BUILD_EXPRESS "Use express build." OFF )
# ---------------------------------------------------------------------
# Build SuperElastix
# Initialize the build system and build the core. These calls are mandatory.
# Do not change and do not call anywhere else.
message( STATUS "Enabling modules ..." )
include( selxModules )
_selxmodules_initialize()
_selxmodule_enable( ModuleFilter "SuperElastix" )
message( STATUS "Enabling modules ... Done" )
# Build applications
if( ${BUILD_APPLICATIONS} AND NOT ${BUILD_EXPRESS} )
if( ${BUILD_APPLICATIONS} )
message( STATUS "Enabling applications ..." )
include( selxApplications )
_selxapplications_initialize()
enable_applications( SUPERELASTIX_APPLICATIONS )
endif()
message( STATUS "Enabling applications ... Done" )
endif()
# TODO: Functionality to disable default modules/applications
......@@ -184,11 +184,11 @@ endif()
# ---------------------------------------------------------------------
# Documentation
option( BUILD_DOXYGEN "Build Doxygen documentation." OFF )
mark_as_advanced( BUILD_DOXYGEN )
option( BUILD_DOXYGEN "Enable building Doxygen documentation." OFF )
option( BUILD_READTHEDOCS "Build readthedocs.org documentation." OFF )
mark_as_advanced( BUILD_READTHEDOCS )
option( BUILD_READTHEDOCS "Enable building readthedocs.org documentation." OFF )
# ---------------------------------------------------------------------
# Installation
......
......@@ -25,17 +25,7 @@ if (OPENMP_FOUND)
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
endif()
# Find UseElastix.cmake
if( NOT EXISTS ${ELASTIX_USE_FILE} )
set( ELASTIX_USE_FILE ${ELASTIX_DIR}/UseElastix.cmake )
endif()
if( NOT EXISTS ${ELASTIX_USE_FILE} )
set( ELASTIX_DIR "" CACHE PATH "Path to elastix build folder" )
message( FATAL_ERROR "Could not find UseElastix.cmake. Point ELASTIX_DIR to folder containing UseElastix.cmake or use SuperBuild." )
endif()
# TODO: Add include and link directories manually to avoid elastix polluting CMake environment
find_package( Elastix REQUIRED )
include( ${ELASTIX_USE_FILE} )
set( ${MODULE}_INCLUDE_DIRS
......
......@@ -147,7 +147,7 @@ ElastixComponent< Dimensionality, TPixel >
}
catch( itk::ExceptionObject & err )
{
this->m_Logger.Log( SeverityType::SELX_ERROR, err.what() );
this->Error( err.what() );
meetsCriteria = false;
}
}
......
......@@ -128,8 +128,7 @@ MonolithicElastixComponent< Dimensionality, TPixel >
}
catch( itk::ExceptionObject & err )
{
this->m_Logger.Log( SeverityType::SELX_ERROR, err.what() );
//TODO log the error message?
this->Error( err.what() );
meetsCriteria = false;
}
}
......
......@@ -48,17 +48,14 @@ set( ${MODULE}_INCLUDE_DIRS
set( ${MODULE}_SOURCE_FILES
)
set( ${MODULE}_TEST_SOURCE_FILES
${${MODULE}_SOURCE_DIR}/test/selxNiftyregNiftiUser.cxx
set( ${MODULE}_TEST_SOURCE_FILES
${${MODULE}_SOURCE_DIR}/test/selxNiftyregComponentTest.cxx
${${MODULE}_SOURCE_DIR}/test/selxNiftiNameManglingTest.cxx
${${MODULE}_SOURCE_DIR}/test/selxItkNiftiUser.cxx
)
set( ${MODULE}_LIBRARIES
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
${Niftyreg_LIBRARIES}
#${Niftyreg__reg_ReadWriteImage_LIBRARY}
#${Niftyreg__reg_f3d_LIBRARY}
${Niftyreg__reg_ReadWriteImage_LIBRARY}
${Niftyreg__reg_f3d_LIBRARY}
)
......@@ -206,14 +206,13 @@ Niftyregf3dComponent< TPixel >
}
else
{
std::cout << "The key " << criterion.first << " is recognized, but not with value " << criterion.second[ 0 ] << std::endl;
this->Warning( "Criterion {0} has invalid value.", criterion.first );
return false;
}
}
else
{
// TODO log error?
std::cout << criterion.first << " accepts one number only" << std::endl;
this->Error( "Criteria {0} does not accept multiple values." );
return false;
}
}
......@@ -227,8 +226,7 @@ Niftyregf3dComponent< TPixel >
}
else
{
// TODO log error?
std::cout << "NumberOfIterations accepts one number only" << std::endl;
this->Warning( "{0} does not accept multiple values.", criterion.first );
return false;
}
}
......@@ -248,14 +246,14 @@ Niftyregf3dComponent< TPixel >
}
else
{
std::cout << "The key " << criterion.first << " is recognized, but not with value " << criterion.second[ 0 ] << std::endl;
this->Warning( "Criterion {0} has invalid value.", criterion.first);
return false;
}
}
else
{
// TODO log error?
std::cout << criterion.first << " accepts one number only" << std::endl;
this->Warning( "{0} does not accept multiple values.", criterion.first );
return false;
}
}
......@@ -270,8 +268,7 @@ Niftyregf3dComponent< TPixel >
}
else
{
// TODO log error?
std::cout << criterion.first << " accepts one number only" << std::endl;
this->Warning( "{0} does not accept multiple values.", criterion.first );
return false;
}
}
......
/*=========================================================================
*