STIR  6.2.0
recon_array_functions.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000 PARAPET partners
5  Copyright (C) 2000- 2008, Hammersmith Imanet Ltd
6  This file is part of STIR.
7 
8  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
9 
10  See STIR/LICENSE.txt for details
11 */
12 
13 #ifndef __stir_recon_array_functions_h_
14 #define __stir_recon_array_functions_h_
15 
28 #include "stir/common.h"
29 
30 START_NAMESPACE_STIR
31 
32 // TODO template this all in data type of Viewgram et al
33 
34 template <typename elemT>
35 class SegmentByView;
36 template <typename elemT>
37 class SegmentBySinogram;
38 template <typename elemT>
39 class Viewgram;
40 template <typename elemT>
41 class RelatedViewgrams;
42 template <int num_dimensions, typename elemT>
43 class DiscretisedDensity;
44 
45 #if 0
46 void multiply_and_add(DiscretisedDensity<3,float> &image_res, const DiscretisedDensity<3,float> &image_scaled, float scalar);
48 #endif
49 
51 float neg_trunc(float x);
52 
53 // MJ 17/05/2000 disabled
54 // gives 1 if negative, 0 otherwise
55 // float neg_indicate(float x){return (x<=0.0)?1.0:0.0;}
56 
57 #if 0
58 
62 void threshold_min_to_small_positive_value_and_truncate_rim(DiscretisedDensity<3,float>& input_image, const int rim_truncation_image=0);
63 
65 void divide_and_truncate(DiscretisedDensity<3,float>& numerator,
66  const DiscretisedDensity<3,float>& denominator,
67  const int rim_truncation,
68  int & count);
69 #endif
70 
72 void divide_and_truncate(Viewgram<float>& numerator,
73  const Viewgram<float>& denominator,
74  const int rim_truncation_sino,
75  int& count,
76  int& count2,
77  double* f = NULL);
78 
80 void divide_and_truncate(RelatedViewgrams<float>& numerator,
81  const RelatedViewgrams<float>& denominator,
82  const int rim_truncation_sino,
83  int& count,
84  int& count2,
85  double* f = NULL);
86 
88 void truncate_rim(DiscretisedDensity<3, float>& image_input,
89  const int rim_truncation_image,
90  const bool strictly_less_than_radius = true);
91 
93 void truncate_rim(SegmentByView<float>& seg, const int rim_truncation_sino);
94 
96 void truncate_rim(Viewgram<float>& viewgram, const int rim_truncation_sino);
97 
99 void truncate_end_planes(DiscretisedDensity<3, float>& input_image, int input_num_planes = 1);
100 
102 void divide_array(SegmentByView<float>& numerator, const SegmentByView<float>& denominator);
103 
105 void divide_array(DiscretisedDensity<3, float>& numerator, const DiscretisedDensity<3, float>& denominator);
106 
107 // MJ 03/01/2000 Trying to adhoc parallelize a loglikelihood computation
108 
110 void accumulate_loglikelihood(Viewgram<float>& projection_data,
111  const Viewgram<float>& estimated_projections,
112  const int rim_truncation_sino,
113  double* accum);
114 
115 END_NAMESPACE_STIR
116 #endif // __recon_array_functions_h_
float neg_trunc(float x)
truncates negative values to zero
Definition: recon_array_functions.cxx:396
void truncate_rim(Viewgram< float > &viewgram, const int rim_truncation_sino)
sets the first and last rim_truncation_sino bins at the &#39;edges&#39; to zero
Definition: recon_array_functions.cxx:48
void truncate_end_planes(DiscretisedDensity< 3, float > &input_image, int input_num_planes)
sets the end planes of the image to zero
Definition: recon_array_functions.cxx:403
void divide_array(SegmentByView< float > &numerator, const SegmentByView< float > &denominator)
simple division of two sinograms, x/0 = 0
Definition: recon_array_functions.cxx:289
void divide_and_truncate(Viewgram< float > &numerator, const Viewgram< float > &denominator, const int rim_truncation_sino, int &count, int &count2, double *log_likelihood_ptr)
divide viewgrams and set &#39;edge bins&#39; to zero, put answer in numerator
Definition: recon_array_functions.cxx:172
basic configuration include file
void accumulate_loglikelihood(Viewgram< float > &projection_data, const Viewgram< float > &estimated_projections, const int rim_truncation_sino, double *accum)
compute the log term of the loglikelihood function for given part of the projection space ...
Definition: recon_array_functions.cxx:336