STIR  6.2.0
NonseparableSpatiallyVaryingFilters3D.h
Go to the documentation of this file.
1 //
15 /*
16  Copyright (C) 2000- 2007, Hammersmith Imanet
17  SPDX-License-Identifier: Apache-2.0
18  See STIR/LICENSE.txt for details
19 */
20 
21 #ifndef __stir_NonseparableSpatiallyVaryingFilters3D_H__
22 #define __stir_NonseparableSpatiallyVaryingFilters3D_H__
23 
26 #include "stir/DataProcessor.h"
28 #include "stir/VectorWithOffset.h"
29 #include "stir/ProjData.h"
30 #include "stir_experimental/ArrayFilter2DUsingConvolution.h"
31 #include "stir_experimental/ArrayFilter3DUsingConvolution.h"
32 
33 #include "stir/shared_ptr.h"
34 
35 START_NAMESPACE_STIR
36 
37 // TODO!! remove define
38 
39 #define num_dimensions 3
40 
41 template <typename elemT>
42 class NonseparableSpatiallyVaryingFilters3D
43  : public RegisteredParsingObject<NonseparableSpatiallyVaryingFilters3D<elemT>,
44  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>,
45  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>>
46 {
47 private:
48  typedef RegisteredParsingObject<NonseparableSpatiallyVaryingFilters3D<elemT>,
49  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>,
50  DataProcessor<DiscretisedDensity<num_dimensions, elemT>>>
51  base_type;
52 
53 public:
54  static const char* const registered_name;
55 
57  NonseparableSpatiallyVaryingFilters3D();
58 
59  NonseparableSpatiallyVaryingFilters3D(string proj_data_filename,
60  string attenuation_proj_data_filename,
61  const Array<3, float>& filter_coefficients,
62  shared_ptr<ProjData> proj_data_ptr,
63  shared_ptr<ProjData> attenuation_proj_data_ptr,
64  DiscretisedDensity<3, float>* initial_image,
65  DiscretisedDensity<3, float>* sensitivity_image,
66  DiscretisedDensity<3, float>* precomputed_coefficients_image,
67  DiscretisedDensity<3, float>* normalised_bck_image,
68  int mask_size,
69  float rescaling_coefficient);
70 
71 private:
72  int mask_size;
73  Array<3, float> filter_coefficients_for_parsing;
74  mutable Array<3, float> filter_coefficients;
75 
76  shared_ptr<ProjData> proj_data_ptr;
77  string proj_data_filename;
78 
79  shared_ptr<ProjData> attenuation_proj_data_ptr;
80  string attenuation_proj_data_filename;
81 
82  DiscretisedDensity<3, float>* initial_image;
83  string initial_image_filename;
84 
85  DiscretisedDensity<3, float>* sensitivity_image;
86  string sensitivity_image_filename;
87 
88  mutable DiscretisedDensity<3, float>* precomputed_coefficients_image;
89  string precomputed_coefficients_filename;
90 
91  DiscretisedDensity<3, float>* normalised_bck_image;
92  string normalised_bck_filename;
93  float rescaling_coefficient;
94  mutable float k_interval;
95  int recompute_every_num_subiterations;
96  int recompute_from_subiteration_num;
97 
98  Succeeded virtual_set_up(const DiscretisedDensity<num_dimensions, elemT>& density);
99  // new
100  void virtual_apply(DiscretisedDensity<num_dimensions, elemT>& out_density,
101  const DiscretisedDensity<num_dimensions, elemT>& in_density) const;
102  void virtual_apply(DiscretisedDensity<num_dimensions, elemT>& density) const;
103  void precalculate_filter_coefficients_3D(
104  VectorWithOffset<VectorWithOffset<VectorWithOffset<shared_ptr<ArrayFilter3DUsingConvolution<float>>>>>&
105  all_filter_coefficients,
106  DiscretisedDensity<3, elemT>* in_density) const;
107 
108  virtual void set_defaults();
109  virtual void initialise_keymap();
110 
111  virtual bool post_processing();
112 };
113 
114 #undef num_dimensions
115 
116 END_NAMESPACE_STIR
117 
118 #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.