20 #ifndef __stir_ProjDataInMemory_H__ 21 #define __stir_ProjDataInMemory_H__ 40 #ifdef STIR_COMPILING_SWIG_WRAPPER 56 shared_ptr<const ProjDataInfo>
const& proj_data_info_ptr,
57 const bool initialise_with_0 =
true);
66 static shared_ptr<ProjDataInMemory>
read_from_file(
const std::string& filename);
69 const int segment_num,
70 const bool make_num_tangential_poss_odd =
false,
71 const int timing_pos = 0)
const override;
75 const int segment_num,
76 const bool make_num_tangential_poss_odd =
false,
77 const int timing_pos = 0)
const override;
84 SegmentByView<float> get_segment_by_view(
const int segment_num,
const int timing_pos = 0)
const override;
93 void fill(
const float value)
override;
100 void fill(
const ProjData&)
override;
106 float get_bin_value(
Bin& bin);
108 void set_bin_value(
const Bin& bin);
113 float sum()
const override;
116 float find_max()
const override;
119 float find_min()
const override;
122 double norm()
const override;
128 self_type operator+(
const self_type& iv)
const;
131 self_type operator-(
const self_type& iv)
const;
134 self_type operator*(
const self_type& iv)
const;
137 self_type operator/(
const self_type& iv)
const;
140 self_type operator+(
const float a)
const;
143 self_type operator-(
const float a)
const;
146 self_type operator*(
const float a)
const;
149 self_type operator/(
const float a)
const;
154 self_type& operator+=(
const base_type& v)
override;
157 self_type& operator-=(
const base_type& v)
override;
160 self_type& operator*=(
const base_type& v)
override;
163 self_type& operator/=(
const base_type& v)
override;
166 self_type& operator+=(
const float v)
override;
169 self_type& operator-=(
const float v)
override;
172 self_type& operator*=(
const float v)
override;
175 self_type& operator/=(
const float v)
override;
183 void xapyb(
const ProjData& x,
const float a,
const ProjData& y,
const float b)
override;
193 void sapyb(
const float a,
const ProjData& y,
const float b)
override;
214 return buffer.begin();
219 return buffer.begin();
227 const_iterator
end()
const 234 return buffer.begin_all();
239 return buffer.begin_all();
244 return buffer.end_all();
249 return buffer.end_all();
254 float* get_data_ptr()
257 return buffer.get_data_ptr();
263 return buffer.get_const_data_ptr();
269 buffer.release_data_ptr();
275 buffer.release_const_data_ptr();
283 void create_buffer(
const bool initialise_with_0 =
false);
285 std::streamoff offset;
287 std::streamoff offset_3d_data;
290 std::vector<int> segment_sequence;
292 std::vector<int> timing_poss_sequence;
296 std::streamoff get_index(
const Bin&)
const;
A class which reads/writes projection data from/to memory.
Definition: ProjDataInMemory.h:38
#define STIR_DEPRECATED
Deprecation macro.
Definition: deprecated.h:21
A class for 2d projection data.
Definition: FBP3DRPReconstruction.h:39
iterator begin_all()
start value for iterating through all elements in the array, see iterator
Definition: ProjDataInMemory.h:232
iterator begin()
start value for iterating through all elements in the array, see iterator
Definition: ProjDataInMemory.h:212
const float * get_const_data_ptr() const
member function for access to the data via a const float*
Definition: ProjDataInMemory.h:261
A class for storing (3d) projection data with fixed SegmentIndices.
Definition: FBP3DRPReconstruction.h:41
double norm_squared() const override
return L2-norm squared (sum of squares)
Definition: ProjDataInMemory.cxx:389
const_iterator begin() const
start value for iterating through all elements in the (const) array, see iterator ...
Definition: ProjDataInMemory.h:217
Declaration of class stir::ProjData.
double norm() const override
return L2-norm (sqrt of sum of squares)
Definition: ProjDataInMemory.cxx:383
defines the stir::Array class for multi-dimensional (numeric) arrays
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
const_iterator begin_all() const
start value for iterating through all elements in the (const) array, see iterator ...
Definition: ProjDataInMemory.h:237
double norm_squared(const BasicCoordinate< num_dimensions, coordT > &p1)
compute (inner_product(p1,p1))
Definition: BasicCoordinate.inl:415
void release_data_ptr()
signal end of access to float*
Definition: ProjDataInMemory.h:267
A class for storing coordinates and value of a single projection bin.
Definition: Bin.h:48
const_iterator end_all() const
end value for iterating through all elements in the (const) array, see iterator
Definition: ProjDataInMemory.h:247
void release_const_data_ptr() const
signal end of access to const float*
Definition: ProjDataInMemory.h:273
iterator end()
end value for iterating through all elements in the array, see iterator
Definition: ProjDataInMemory.h:222
double norm(const BasicCoordinate< num_dimensions, coordT > &p1)
compute sqrt(inner_product(p1,p1))
Definition: BasicCoordinate.inl:426
This class defines multi-dimensional (numeric) arrays.
Definition: Array.h:77
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
const_iterator end() const
end value for iterating through all elements in the (const) array, see iterator
Definition: ProjDataInMemory.h:227
elemT sum(IterT start, IterT end, elemT init)
Compute the sum of a sequence using operator+=(), using an initial value.
Definition: more_algorithms.inl:52
The (abstract) base class for the projection data.
Definition: ProjData.h:103
iterator end_all()
end value for iterating through all elements in the array, see iterator
Definition: ProjDataInMemory.h:242