STIR  6.2.0
ModifiedInverseAveragingImageFilterAll.h
Go to the documentation of this file.
1 //
2 //
16 /*
17  Copyright (C) 2000- 2007, Hammersmith Imanet
18  SPDX-License-Identifier: Apache-2.0
19  See STIR/LICENSE.txt for details
20 */
21 
22 #ifndef __stir_ModifiedInverseAveragingImageFilterAll_H__
23 #define __stir_ModifiedInverseAveragingImageFilterAll_H__
24 
27 #include "stir/DataProcessor.h"
29 #include "stir/VectorWithOffset.h"
30 #include "stir/ProjData.h"
31 #include "stir_experimental/ArrayFilter2DUsingConvolution.h"
32 #include "stir_experimental/ArrayFilter3DUsingConvolution.h"
33 
34 #include "stir/shared_ptr.h"
35 
36 START_NAMESPACE_STIR
37 
38 // TODO!! remove define
39 
40 #define num_dimensions 3
41 
42 template <typename elemT>
43 class ModifiedInverseAveragingImageFilterAll
44  : public RegisteredParsingObject<ModifiedInverseAveragingImageFilterAll<elemT>,
45  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>,
46  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>>
47 {
48 private:
49  typedef RegisteredParsingObject<ModifiedInverseAveragingImageFilterAll<elemT>,
50  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>,
51  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>>
52  base_type;
53 
54 public:
55  static const char* const registered_name;
56 
58  ModifiedInverseAveragingImageFilterAll();
59 
60  ModifiedInverseAveragingImageFilterAll(string proj_data_filename,
61  string attenuation_proj_data_filename,
62  const VectorWithOffset<elemT>& filter_coefficients,
63  shared_ptr<ProjData> proj_data_ptr,
64  shared_ptr<ProjData> attenuation_proj_data_ptr,
65  DiscretisedDensity<3, float>* initial_image,
66  DiscretisedDensity<3, float>* sensitivity_image,
67  DiscretisedDensity<3, float>* precomputed_coefficients_image,
68  DiscretisedDensity<3, float>* normalised_bck_image,
69  int mask_size,
70  int num_dim);
71 
72 private:
73  int mask_size;
74  vector<double> filter_coefficients_for_parsing;
75  VectorWithOffset<float> filter_coefficients;
76 
77  shared_ptr<ProjData> proj_data_ptr;
78  string proj_data_filename;
79 
80  shared_ptr<ProjData> attenuation_proj_data_ptr;
81  string attenuation_proj_data_filename;
82 
83  DiscretisedDensity<3, float>* initial_image;
84  string initial_image_filename;
85 
86  DiscretisedDensity<3, float>* sensitivity_image;
87  string sensitivity_image_filename;
88 
89  DiscretisedDensity<3, float>* precomputed_coefficients_image;
90  string precomputed_coefficients_filename;
91 
92  DiscretisedDensity<3, float>* normalised_bck_image;
93  string normalised_bck_filename;
94  int num_dim;
95 
96  Succeeded virtual_set_up(const DiscretisedDensity<num_dimensions, elemT>& density);
97  // new
98  void virtual_apply(DiscretisedDensity<num_dimensions, elemT>& out_density,
99  const DiscretisedDensity<num_dimensions, elemT>& in_density) const;
100  void virtual_apply(DiscretisedDensity<num_dimensions, elemT>& density) const;
101  void precalculate_filter_coefficients(
102  VectorWithOffset<VectorWithOffset<VectorWithOffset<shared_ptr<ArrayFilter3DUsingConvolution<float>>>>>&
103  all_filter_coefficients,
104  DiscretisedDensity<3, elemT>* in_density) const;
105 
106  void precalculate_filter_coefficients_2D(
107  VectorWithOffset<VectorWithOffset<VectorWithOffset<shared_ptr<ArrayFilter2DUsingConvolution<float>>>>>&
108  all_filter_coefficients,
109  DiscretisedDensity<3, elemT>* in_density) const;
110 
111  void precalculate_filter_coefficients_separable(
112  VectorWithOffset<VectorWithOffset<VectorWithOffset<shared_ptr<ModifiedInverseAverigingArrayFilter<3, float>>>>>&
113  all_filter_coefficients,
114  DiscretisedDensity<3, elemT>* in_density) const;
115 
116  virtual void set_defaults();
117  virtual void initialise_keymap();
118 
119  virtual bool post_processing();
120 
121  mutable ModifiedInverseAverigingArrayFilter<num_dimensions, elemT> inverse_filter;
122 };
123 
124 #undef num_dimensions
125 
126 END_NAMESPACE_STIR
127 
128 #endif
Declaration of class stir::DataProcessor.
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
defines the stir::DiscretisedDensity class
Declaration of class stir::ProjData.
This is a messy first attempt to design spatially varying filter Given the kernel which in this case ...
defines the stir::VectorWithOffset class
Declaration of class stir::RegisteredParsingObject.