/*! * \file OxTestData.h * \author Konrad Werys * \date 2018/07/30 */ #ifndef Tomato_OXTESTDATA_H #define Tomato_OXTESTDATA_H #include "TomatoParser.h" #include "yaml.h" namespace Ox { template< typename MeasureType > class TestData { public: TestData(char* filePath); virtual std::vector getSignalMag() const { return _signalMag; } virtual std::vector getSignalPha() const { return _signalPha; } virtual std::vector getSigns() const { return _signs; } virtual std::vector getSignal() const { return _signal; } virtual std::vector getInvTimes() const { return _invTimes; } virtual std::vector getEchoTimes() const { return _echoTimes; } virtual std::vector getResultsMolli() const { return _resultsMolli; } virtual std::vector getResultsShmolli() const { return _resultsShmolli; } virtual std::vector getResultsTwoParam() const { return _resultsTwoParam; } virtual std::vector getResultsThreeParam() const { return _resultsThreeParam; } virtual const MeasureType* getSignalMagPtr() const { if (_signalMag.size() == 0) { throw std::runtime_error("Empty signalMag"); } return &_signalMag.at(0); } virtual const MeasureType* getSignalPhaPtr() const { if (_signalPha.size() == 0) { throw std::runtime_error("Empty signalPha"); } return &_signalPha.at(0); } virtual const MeasureType* getSignsPtr() const { if (_signs.size() == 0) { throw std::runtime_error("Empty signs"); } return &_signs.at(0); } virtual const MeasureType* getSignalPtr() const { if (_signal.size() == 0) { throw std::runtime_error("Empty signal"); } return &_signal.at(0); } virtual const MeasureType* getInvTimesPtr() const { if (_invTimes.size() == 0) { throw std::runtime_error("Empty invTimes"); } return &_invTimes.at(0); } virtual const MeasureType* getEchoTimesPtr() const { if (_echoTimes.size() == 0) { throw std::runtime_error("Empty echoTimes"); } return &_echoTimes.at(0); } virtual const MeasureType* getResultsMolliPtr() const { if (_resultsMolli.size() == 0) { throw std::runtime_error("Empty resultsMolli"); } return &_resultsMolli.at(0); } virtual const MeasureType* getResultsShmolliPtr() const { if (_resultsShmolli.size() == 0) { throw std::runtime_error("Empty resultsShmolli"); } return &_resultsShmolli.at(0); } virtual const MeasureType* getResultsTwoParamPtr() const { if (_resultsTwoParam.size() == 0) { throw std::runtime_error("Empty resultsTwoParam"); } return &_resultsTwoParam.at(0); } virtual const MeasureType* getResultsThreeParamPtr() const { if (_resultsThreeParam.size() == 0) { throw std::runtime_error("Empty resultsThreeParam"); } return &_resultsThreeParam.at(0); } virtual int getNSamples() const { return _nSamples; } void copyStrVectorToMemberVector(std::vector strVector, std::vector &memberVector); void disp(); template< typename TYPE > void printVector(std::vector myVector, std::string myVectorName); protected: int _nSamples; std::vector _signalMag; std::vector _signalPha; std::vector _signal; std::vector _signs; std::vector _invTimes; std::vector _echoTimes; std::vector _resultsMolli; std::vector _resultsShmolli; std::vector _resultsTwoParam; std::vector _resultsThreeParam; void calcSignal(); }; } // namespace Ox #include "OxTestData.hxx" #endif //Tomato_OXTESTDATA_H