11 #ifndef __stir__DynamicProjData__H__ 12 #define __stir__DynamicProjData__H__ 39 static unique_ptr<DynamicProjData>
read_from_file(
const std::string& filename);
48 : MultipleProjData(exam_info_sptr)
51 DynamicProjData(
const shared_ptr<const ExamInfo>& exam_info_sptr,
const int num_gates)
52 : MultipleProjData(exam_info_sptr, num_gates)
65 const double get_start_time_in_secs_since_1970()
const;
70 void set_start_time_in_secs_since_1970(
const double start_time);
71 unsigned int get_num_frames()
const {
return this->get_num_proj_data(); }
73 Succeeded write_to_ecat7(
const std::string& filename)
const;
83 for (
unsigned int frame_num = 1; frame_num <= this->get_time_frame_definitions().
get_num_frames(); ++frame_num)
84 for (
int segment_num = (this->_proj_datas[frame_num - 1])->get_min_segment_num();
85 segment_num <= (this->_proj_datas[frame_num - 1])->get_max_segment_num();
88 for (
int timing_pos_num = (this->_proj_datas[frame_num - 1])->get_min_tof_pos_num();
89 timing_pos_num <= (this->_proj_datas[frame_num - 1])->get_max_tof_pos_num();
93 (*(this->_proj_datas[frame_num - 1])).get_segment_by_view(segment_num, timing_pos_num));
94 segment_by_view *= cal_factor;
95 if ((*(this->_proj_datas[frame_num - 1])).set_segment(segment_by_view) == Succeeded::no)
97 error(
"DynamicProjData:calibrate_frames failed because set_segment_by_view failed");
108 for (
unsigned int frame_num = 1; frame_num <= this->get_time_frame_definitions().
get_num_frames(); ++frame_num)
109 for (
int segment_num = (this->_proj_datas[frame_num - 1])->get_min_segment_num();
110 segment_num <= (this->_proj_datas[frame_num - 1])->get_max_segment_num();
113 for (
int timing_pos_num = (this->_proj_datas[frame_num - 1])->get_min_tof_pos_num();
114 timing_pos_num <= (this->_proj_datas[frame_num - 1])->get_max_tof_pos_num();
118 = (*(this->_proj_datas[frame_num - 1])).get_segment_by_view(segment_num, timing_pos_num);
119 segment_by_view /=
static_cast<float>(this->get_time_frame_definitions().get_duration(frame_num));
120 if ((*(this->_proj_datas[frame_num - 1])).set_segment(segment_by_view) == Succeeded::no)
122 error(
"DynamicProjData:calibrate_frames failed because set_segment_by_view failed");
140 template <
typename iterT>
144 return stir_object.copy_to(iter);
154 template <
typename iterT>
158 return stir_object.fill_from(iter);
void calibrate_frames(const float cal_factor)
multiply data with a constant factor
Definition: DynamicProjData.h:81
Class used for storing time frame durations.
Definition: TimeFrameDefinitions.h:38
Declaration of class stir::Succeeded.
Declaration of class stir::TimeFrameDefinitions.
iterT copy_to(const T &stir_object, iterT iter)
Copy all bins to a range specified by a iterator.
Definition: copy_fill.h:133
Helper class for stir::copy_to and stir::fill_from.
Definition: copy_fill.h:35
Declaration of stir::error()
A class for storing (3d) projection data with fixed SegmentIndices.
Definition: ArcCorrection.h:40
unique_ptr< DataT > read_from_file(const FileSignature &signature, FileT file)
Function that reads data from file using the default InputFileFormatRegistry, using the provided File...
Definition: read_from_file.h:46
void fill_from(DynamicProjData &stir_object, iterT iter, iterT)
set all elements of a MultipleProjData from an iterator
Definition: DynamicProjData.h:156
Declaration of class stir::MultipleProjData.
Dynamic projection data.
Definition: DynamicProjData.h:36
Declaration of class stir::SegmentByView.
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition: error.cxx:42
unsigned int get_num_frames() const
Get number of frames.
Definition: TimeFrameDefinitions.cxx:86
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
void divide_with_duration()
divide data with the corresponding frame duration
Definition: DynamicProjData.h:105