go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkParameterFileParser.h
Go to the documentation of this file.
1 /*======================================================================
2 
3 This file is part of the elastix software.
4 
5 Copyright (c) University Medical Center Utrecht. All rights reserved.
6 See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7 details.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __itkParameterFileParser_h
16 #define __itkParameterFileParser_h
17 
18 #include "itkObject.h"
19 #include "itkObjectFactory.h"
20 #include "itkMacro.h"
21 
22 #include <map>
23 #include <string>
24 #include <vector>
25 #include <fstream>
26 
27 
28 namespace itk
29 {
30 
77 class ParameterFileParser : public Object
78 {
79 public:
80 
83  typedef Object Superclass;
84  typedef SmartPointer< Self > Pointer;
85  typedef SmartPointer< const Self > ConstPointer;
86 
88  itkNewMacro( Self );
89 
91  itkTypeMacro( ParameterFileParser, Object );
92 
94  typedef std::vector< std::string > ParameterValuesType;
95  typedef std::map<
96  std::string,
98 
100  itkSetStringMacro( ParameterFileName );
101  itkGetStringMacro( ParameterFileName );
102 
104  virtual const ParameterMapType & GetParameterMap( void ) const;
105 
107  void ReadParameterFile( void );
108 
112  std::string ReturnParameterFileAsString( void );
113 
114 protected:
116  virtual ~ParameterFileParser();
117 
118 private:
119  ParameterFileParser(const Self&); //purposely not implemented
120  void operator=(const Self&); //purposely not implemented
121 
128  void BasicFileChecking( void ) const;
129 
135  bool CheckLine( const std::string & line, std::string & lineOut ) const;
136 
138  void GetParameterFromLine( const std::string & fullLine,
139  const std::string & line );
140 
142  void SplitLine( const std::string & fullLine, const std::string & line,
143  std::vector<std::string> & splittedLine ) const;
144 
148  void ThrowException( const std::string & line, const std::string & hint ) const;
149 
151  std::string m_ParameterFileName;
152  std::ifstream m_ParameterFile;
154 
155 }; // end class ParameterFileParser
156 
157 } // end of namespace itk
158 
159 #endif // end __itkParameterFileParser_h


Generated on 21-03-2014 for elastix by doxygen 1.8.1.2 elastix logo