Commit 09340962 authored by Floris Berendsen's avatar Floris Berendsen
Browse files

COMP: forgot to remove ConfigurationReader files #122

parent 076b4679
......@@ -22,13 +22,8 @@
# ---------------------------------------------------------------------
# Collect header files for Visual Studio Project
# http://stackoverflow.com/questions/8316104/specify-how-cmake-creates-visual-studio-project
file(GLOB COMMANDLINE_HEADER_FILES "${COMMANDLINE_SOURCE_DIR}/*/include/*.*")
set( COMMANDLINE_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/selxSuperElastix.cxx
${CMAKE_CURRENT_SOURCE_DIR}/src/selxConfigurationReader.cxx
)
#set(Boost_DEBUG ON )
......
/*=========================================================================
*
* Copyright Leiden University Medical Center, Erasmus University Medical
* Center and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef ConfigurationReader_h
#define ConfigurationReader_h
#include "selxBlueprint.h"
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/info_parser.hpp>
#include <boost/foreach.hpp>
#include <boost/filesystem.hpp>
#include <string>
#include <iostream>
#include <boost/algorithm/string.hpp>
#include <vector>
#include <map>
namespace selx
{
class ConfigurationReader
{
public:
typedef Blueprint::ParameterKeyType ParameterKeyType;
typedef Blueprint::ParameterValueType ParameterValueType;
typedef Blueprint::ParameterMapType ParameterMapType;
using PathType = boost::filesystem::path;
using PathsType = std::list<PathType>;
static Blueprint::Pointer FromFile(const PathType& filename);
static void MergeFromFile(Blueprint::Pointer blueprint, const PathType & filename);
private:
typedef boost::property_tree::ptree PropertyTreeType;
typedef const boost::property_tree::ptree & ComponentOrConnectionTreeType;
static PropertyTreeType ReadPropertyTree(const PathType & filename);
static PathsType FindIncludes(const PropertyTreeType &);
static ParameterValueType VectorizeValues(ComponentOrConnectionTreeType componentOrConnectionTree);
static Blueprint::Pointer FromPropertyTree(const PropertyTreeType &);
static void MergeProperties(Blueprint::Pointer blueprint, const PropertyTreeType &);
};
}
#endif // #define ConfigurationReader_h
......@@ -18,7 +18,6 @@
*=========================================================================*/
#include "selxSuperElastixFilter.h"
#include "selxConfigurationReader.h"
#include "selxAnyFileReader.h"
#include "selxAnyFileWriter.h"
#include "selxLogger.h"
......
/*=========================================================================
*
* Copyright Leiden University Medical Center, Erasmus University Medical
* Center and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#include "selxConfigurationReader.h"
#include "selxDataManager.h"
#include "gtest/gtest.h"
using namespace selx;
class ConfigurationReaderTest : public ::testing::Test
{
public:
typedef DataManager DataManagerType;
DataManagerType::Pointer dataManager;
virtual void SetUp()
{
this->dataManager = DataManagerType::New();
}
};
TEST_F( ConfigurationReaderTest, ReadXML )
{
BlueprintImpl blueprint;
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 )
{
BlueprintImpl blueprint;
EXPECT_NO_THROW( blueprint = ConfigurationReader::FromFile( this->dataManager->GetConfigurationFile( "itkv4_SVF_ANTsCC.json" ) ) );
blueprint.Write( this->dataManager->GetOutputFile( "configurationReaderTest_itkv4_SVF_ANTsCC.json.dot" ) );
}
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