19 #ifndef rtkGeneralPurposeFunctions_h 20 #define rtkGeneralPurposeFunctions_h 41 inline static std::vector<double>
44 std::vector<double> signalVector;
45 std::ifstream is(filename.c_str());
48 itkGenericExceptionMacro(<<
"Could not open signal file " << filename);
53 while (getline(is, s))
57 std::istringstream tmp(s);
59 if (itk::Math::Round<double>(value * 100) / 100 == 1)
60 signalVector.push_back(0);
62 signalVector.push_back(itk::Math::Round<double>(value * 100) / 100);
69 template <
typename ImageType>
71 WriteImage(
typename ImageType::ConstPointer input, std::string name)
75 typename WriterType::Pointer writer = WriterType::New();
76 writer->SetInput(input);
77 writer->SetFileName(name);
83 #endif // rtkGeneralPurposeFunctions_h
static std::vector< double > ReadSignalFile(std::string filename)
A few functions that are used either in the applications or for debugging purposes.
void WriteImage(typename ImageType::ConstPointer input, std::string name)