32 this->_blood_plot = blood_plot;
43 std::ifstream data_stream(input_string.c_str());
45 error(
"cannot read blood frame data from file.\n");
48 data_stream >> _num_frames;
51 unsigned int frame_num = 0;
52 float blood_sample_radioactivity = 0.F;
53 data_stream >> frame_num;
54 data_stream >> blood_sample_radioactivity;
57 const BloodFrame current_sample(frame_num, blood_sample_radioactivity);
58 (this->_blood_plot).push_back(current_sample);
79 _time_shift = time_shift;
80 for (std::vector<BloodFrame>::iterator cur_iter = this->_blood_plot.begin(); cur_iter != this->_blood_plot.end(); ++cur_iter)
82 cur_iter->set_frame_start_time_in_s(cur_iter->get_frame_start_time_in_s() + time_shift);
83 cur_iter->set_frame_end_time_in_s(cur_iter->get_frame_end_time_in_s() + time_shift);
90 return BloodFrameData::_time_shift;
96 _isotope_halflife = isotope_halflife;
102 this->_is_decay_corrected = is_decay_corrected;
108 return this->_is_decay_corrected;
114 if (BloodFrameData::_is_decay_corrected ==
true)
115 warning(
"BloodFrameData are already decay corrected");
118 for (std::vector<BloodFrame>::iterator cur_iter = this->_blood_plot.begin(); cur_iter != this->_blood_plot.end();
120 cur_iter->set_blood_counts_in_kBq(cur_iter->get_blood_counts_in_kBq()
121 * decay_correct_factor(_isotope_halflife,
122 cur_iter->get_frame_start_time_in_s(),
123 cur_iter->get_frame_end_time_in_s()));
129BloodFrameData::set_plot(
const std::vector<BloodFrame>& blood_plot)
131 this->_blood_plot = blood_plot;
135BloodFrameData::const_iterator
138 return this->_blood_plot.begin();
141BloodFrameData::const_iterator
142BloodFrameData::end()
const
144 return this->_blood_plot.end();
147BloodFrameData::size()
const
149 return this->_blood_plot.size();
bool get_if_decay_corrected()
Function to set _is_decay_corrected boolean true ar false.
Definition BloodFrameData.inl:106
void read_blood_frame_data(const std::string input_string)
Implementation to read the input function from ONLY a 2-columns frame data (FrameNumber-InputFunction...
Definition BloodFrameData.inl:41
void set_isotope_halflife(const float isotope_halflife)
Function to set the isotope halflife.
Definition BloodFrameData.inl:94
float get_time_shift()
Function to get the time data.
Definition BloodFrameData.inl:88
~BloodFrameData()
default constructor
Definition BloodFrameData.inl:36
const_iterator begin() const
void begin() and end() iterators for the plasma curve ;
Definition BloodFrameData.inl:136
void set_if_decay_corrected(const bool is_decay_corrected)
Function to set _is_decay_corrected boolean true ar false.
Definition BloodFrameData.inl:100
BloodFrameData()
default constructor
Definition BloodFrameData.inl:25
void decay_correct_BloodFrameData()
Function to decay correct the data.
Definition BloodFrameData.inl:112
void shift_time(const float time_shift)
Implementation to set the input units not currently used. Always, it assumed to use kBq,...
Definition BloodFrameData.inl:77
Simple functions to compute the decay correction factor.
Declaration of stir::error()
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition error.cxx:42
void warning(const char *const s,...)
Print warning with format string a la printf.
Definition warning.cxx:41
Declaration of stir::warning()