STIR  6.2.0
ModifiedInverseAverigingImageFilter.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_ModifiedInverseAverigingImageFilter_H__
23 #define __stir_ModifiedInverseAverigingImageFilter_H__
24 
27 #include "stir/DataProcessor.h"
29 #include "stir/VectorWithOffset.h"
30 #include "stir/ProjData.h"
31 #include "stir_experimental/ArrayFilter3DUsingConvolution.h"
32 
33 START_NAMESPACE_STIR
34 
35 // TODO!! remove define
36 
37 #define num_dimensions 3
38 
39 template <typename elemT>
40 class ModifiedInverseAverigingImageFilter
41  : public RegisteredParsingObject<ModifiedInverseAverigingImageFilter<elemT>,
42  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>,
43  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>>
44 {
45 private:
46  typedef RegisteredParsingObject<ModifiedInverseAverigingImageFilter<elemT>,
47  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>,
48  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>>
49  base_type;
50 
51 public:
52  static const char* const registered_name;
53 
55  ModifiedInverseAverigingImageFilter();
56 
57  ModifiedInverseAverigingImageFilter(string proj_data_filename,
58  string attenuation_proj_data_filename,
59  const VectorWithOffset<elemT>& filter_coefficients,
60  shared_ptr<ProjData> proj_data_ptr,
61  shared_ptr<ProjData> attenuation_proj_data_ptr,
62  DiscretisedDensity<3, float>* initial_image,
63  DiscretisedDensity<3, float>* sensitivity_image,
64  int mask_size,
65  bool z_direction_trivial);
66 
67 private:
68  int mask_size;
69  vector<double> filter_coefficients_for_parsing;
70  VectorWithOffset<float> filter_coefficients;
71 
72  shared_ptr<ProjData> proj_data_ptr;
73  string proj_data_filename;
74 
75  shared_ptr<ProjData> attenuation_proj_data_ptr;
76  string attenuation_proj_data_filename;
77 
78  DiscretisedDensity<3, float>* initial_image;
79  string initial_image_filename;
80 
81  DiscretisedDensity<3, float>* sensitivity_image;
82  string sensitivity_image_filename;
83 
84  bool z_direction_trivial;
85 
86  Succeeded virtual_set_up(const DiscretisedDensity<num_dimensions, elemT>& density);
87  // new
88  void virtual_apply(DiscretisedDensity<num_dimensions, elemT>& out_density,
89  const DiscretisedDensity<num_dimensions, elemT>& in_density) const;
90  void virtual_apply(DiscretisedDensity<num_dimensions, elemT>& density) const;
91  void precalculate_filter_coefficients(
92  VectorWithOffset<VectorWithOffset<VectorWithOffset<shared_ptr<ArrayFunctionObject<3, float>>>>>& all_filter_coefficients,
93  DiscretisedDensity<3, elemT>* in_density) const;
94 
95  virtual void set_defaults();
96  virtual void initialise_keymap();
97 
98  virtual bool post_processing();
99 };
100 
101 #undef num_dimensions
102 
103 END_NAMESPACE_STIR
104 
105 #endif
Declaration of class stir::DataProcessor.
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.