18 #ifndef itkFDFCommonImageIO_h 19 #define itkFDFCommonImageIO_h 36 void Tokenize(
const std::string& str, std::vector<std::string>& tokens,
const std::string& delimiters =
" ");
43 std::stringstream str;
51 std::vector<std::string> tokens;
54 std::string::size_type startBracketPosition = value.find_first_of(
"{", 0);
55 std::string::size_type endBracketPosition = value.find_first_of(
"}", startBracketPosition);
57 if ( startBracketPosition != std::string::npos && endBracketPosition != std::string::npos) {
58 std::string elements = value.substr(startBracketPosition + 1, endBracketPosition - startBracketPosition - 1);
66 for(
unsigned int i=0; i<tokens.size(); i++) {
68 values.push_back(element);
73 void PrintVector (std::ostream& os, std::string name,
const std::vector<T>& vect)
75 int size = vect.size();
79 for(
int i=0; i < size; i++) {
86 os <<
"}" << std::endl;
void StringToVector(std::string value, std::vector< T > &values)
void PrintVector(std::ostream &os, std::string name, const std::vector< T > &vect)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
std::string RemoveCharacters(std::string, char)
std::string ParseLine(std::string line)
void ConvertFromString(std::string s, T &value)