STIR
6.2.0
|
a minimal class for Interfile keywords (and parsing) common to all types of data More...
#include "stir/IO/InterfileHeader.h"
Public Member Functions | |
shared_ptr< const ExamInfo > | get_exam_info_sptr () const |
Get a shared pointer to the exam information. | |
const ExamInfo & | get_exam_info () const |
Get the exam information. | |
Public Member Functions inherited from stir::KeyParser | |
bool | parse (std::istream &f, const bool write_warnings=true) |
parse() returns false if there is some error, true otherwise More... | |
bool | parse (const char *const filename, const bool write_warnings=true) |
parse() returns false if there is some error, true otherwise More... | |
bool | parse (const std::string &, const bool write_warnings=true) |
void | add_key (const std::string &keyword, float *variable_ptr) |
add a keyword. When parsing, parse its value as a float and put it in *variable_ptr | |
void | add_vectorised_key (const std::string &keyword, std::vector< float > *variable_ptr) |
add a vectorised keyword. When parsing, parse its value as a float and put it in (*variable_ptr)[current_index] | |
void | add_key (const std::string &keyword, double *variable_ptr) |
add a keyword. When parsing, parse its value as a double and put it in *variable_ptr | |
void | add_vectorised_key (const std::string &keyword, std::vector< double > *variable_ptr) |
add a vectorised keyword. When parsing, parse its value as a double and put it in (*variable_ptr)[current_index] | |
void | add_vectorised_key (const std::string &keyword, std::vector< std::vector< double >> *variable_ptr) |
add a vectorised keyword. When parsing, parse its value as a list of doubles and put it in (*variable_ptr)[current_index] | |
void | add_key (const std::string &keyword, int *variable_ptr) |
add a keyword. When parsing, parse its value as a int and put it in *variable_ptr | |
void | add_key (const std::string &keyword, std::vector< int > *variable_ptr) |
add a keyword. When parsing, parse its value as a int and put it in *variable_ptr | |
void | add_vectorised_key (const std::string &keyword, std::vector< int > *variable_ptr) |
add a vectorised keyword. When parsing, parse its value as a int and put it in (*variable_ptr)[current_index] | |
void | add_vectorised_key (const std::string &keyword, std::vector< std::vector< int >> *variable_ptr) |
add a vectorised keyword. When parsing, parse its value as a list of ints and put it in (*variable_ptr)[current_index] | |
void | add_key (const std::string &keyword, long int *variable_ptr) |
add a keyword. When parsing, parse its value as a int and put it in *variable_ptr | |
void | add_key (const std::string &keyword, unsigned int *variable_ptr) |
add a keyword. When parsing, parse its value as a int and put it in *variable_ptr | |
void | add_vectorised_key (const std::string &keyword, std::vector< unsigned int > *variable) |
add a vectorised keyword. When parsing, parse its value as an unsigned int and put it in (*variable_ptr)[current_index] | |
void | add_key (const std::string &keyword, unsigned long *variable_ptr) |
add a keyword. When parsing, parse its value as an unsigned long and put it in *variable_ptr | |
void | add_vectorised_key (const std::string &keyword, std::vector< unsigned long > *variable_ptr) |
add a vectorised keyword. When parsing, parse its value as an unsigned long and put it in (*variable_ptr)[current_index] | |
void | add_key (const std::string &keyword, bool *variable_ptr) |
add a keyword. When parsing, parse its value as a int and put the bool value in *variable_ptr More... | |
void | add_key (const std::string &keyword, std::vector< double > *variable_ptr) |
add a keyword. When parsing, parse its value as a list of doubles and put its value in *variable_ptr | |
void | add_key (const std::string &keyword, std::vector< std::string > *variable_ptr) |
add a keyword. When parsing, parse its value as a list of comma-separated strings and put its value in *variable_ptr | |
void | add_key (const std::string &keyword, Array< 2, float > *variable_ptr) |
add a keyword. When parsing, parse its value as a 2d array of floats and put its value in *variable_ptr | |
void | add_key (const std::string &keyword, Array< 3, float > *variable_ptr) |
add a keyword. When parsing, parse its value as a 3d array of floats and put its value in *variable_ptr | |
void | add_key (const std::string &keyword, BasicCoordinate< 3, float > *variable_ptr) |
add a keyword. When parsing, parse its value as a 3d BasicCoordinate of floats and put its value in *variable_ptr | |
void | add_key (const std::string &keyword, BasicCoordinate< 3, Array< 3, float >> *variable_ptr) |
add a keyword. When parsing, parse its value as a 3d BasicCoordinate of a 3d array of floats and put its value in *variable_ptr | |
void | add_key (const std::string &keyword, std::string *variable_ptr) |
void | add_vectorised_key (const std::string &keyword, std::vector< std::string > *variable_ptr) |
add a vectorised keyword. When parsing, parse its value as a string and put it in (*variable_ptr)[current_index] More... | |
void | add_key (const std::string &keyword, int *variable_ptr, const ASCIIlist_type *const list_of_values) |
add a keyword. When parsing, its string value is checked against a list of strings. The corresponding index is stored in variable_ptr. More... | |
void | ignore_key (const std::string &keyword) |
Add keyword this is just ignored by the parser. | |
void | add_start_key (const std::string &keyword) |
add keyword that has to occur before all others More... | |
void | add_stop_key (const std::string &keyword) |
add a keyword that when encountered, will stop the parsing | |
template<typename ParsingClass > | |
void | add_parsing_key (const std::string &keyword, ParsingClass **parsed_object_ptr_ptr) |
add keyword corresponding to an object that will parse the next keys itself More... | |
template<typename ParsingClass > | |
void | add_parsing_key (const std::string &keyword, shared_ptr< ParsingClass > *parsed_object_ptr_ptr) |
add keyword corresponding to an object that will parse the next keys itself More... | |
bool | remove_key (const std::string &keyword) |
Removes a key from the kep map. More... | |
void | add_alias_key (const std::string &keyword, const std::string &alias, bool deprecated_key=true) |
Add an alias for keyword. More... | |
void | print_keywords_to_stream (std::ostream &) const |
Prints all keywords (in random order) to the stream. | |
virtual std::string | parameter_info () const |
Returns a string with keywords and their values. More... | |
virtual void | ask_parameters () |
Ask interactively for values for all keywords. More... | |
int | find_in_ASCIIlist (const std::string &, const ASCIIlist_type &list_of_values) |
returns the index of a string in 'list_of_values', -1 if not found More... | |
void | start_parsing () |
callback function to start parsing, has to be set by first keyword | |
void | stop_parsing () |
to stop parsing | |
void | do_nothing () |
callback function for keys which do not do anything | |
void | set_variable () |
callback function that sets the variable to the value given as the value of the keyword More... | |
void | set_parsing_object () |
callback function that sets the variable by calling the parser (as stored by add_parsing_key()), with argument the value of the keyword More... | |
void | set_shared_parsing_object () |
callback function that sets the shared_ptr variable by calling the parser (as stored by add_parsing_key()), with argument the value of the keyword More... | |
Public Attributes | |
std::string | version_of_keys |
std::string | siemens_mi_version |
Static Public Attributes | |
static const double | double_value_not_set = -12345.60789 |
A value that can be used to signify that a variable has not been set during parsing. | |
Protected Member Functions | |
virtual void | set_version_specific_keys () |
will be called when the version keyword is found More... | |
Protected Member Functions inherited from stir::KeyParser | |
virtual bool | post_processing () |
This will be called at the end of the parsing. More... | |
virtual std::string | standardise_keyword (const std::string &keyword) const |
convert 'rough' keyword into a standardised form More... | |
virtual std::string | get_keyword (const std::string &) const |
gets a keyword from a string More... | |
void | add_key (const std::string &keyword, KeyArgument::type t, KeywordProcessor function, void *variable=0, const ASCIIlist_type *const list=0) |
add a keyword to the list, together with its call_back function More... | |
void | add_key (const std::string &keyword, KeyArgument::type t, KeywordProcessor function, void *variable, const int vectorised_key_level, const ASCIIlist_type *const list=0) |
add a keyword to the list, together with its call_back function More... | |
void | add_key (const std::string &keyword, KeyArgument::type t, void *variable, const ASCIIlist_type *const list=0) |
version that defaults 'function' to set_variable More... | |
void | add_key (const std::string &keyword, KeyArgument::type t, void *variable, const int vectorised_key_level, const ASCIIlist_type *const list=0) |
version that defaults 'function' to set_variable More... | |
Protected Attributes | |
shared_ptr< ExamInfo > | exam_info_sptr |
Additional Inherited Members | |
Protected Types inherited from stir::KeyParser | |
typedef void(KeyParser::* | KeywordProcessor) () |
a minimal class for Interfile keywords (and parsing) common to all types of data
This class is only used to select which version of Interfile to use.
|
protectedvirtual |
will be called when the version keyword is found
This callback function provides an opportunity to change the keymap depending on the version (which can be obtained from version_of_keys
).
Just calls set_variable()
.
It is expected that if this is function is re-implemented in a derived class, it calls the base-class version.
Reimplemented in stir::InterfileHeader.