STIR  6.2.0
CudaRelativeDifferencePrior.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2024, University College London
3  This file is part of STIR.
4 
5  SPDX-License-Identifier: Apache-2.0
6 
7  See STIR/LICENSE.txt for details
8 */
9 #ifndef __stir_recon_buildblock_CudaRelativeDifferencePrior_h__
10 #define __stir_recon_buildblock_CudaRelativeDifferencePrior_h__
11 
23 
24 START_NAMESPACE_STIR
25 
36 template <typename elemT>
37 class CudaRelativeDifferencePrior : public RegisteredParsingObject<CudaRelativeDifferencePrior<elemT>,
38  GeneralisedPrior<DiscretisedDensity<3, elemT>>,
39  RelativeDifferencePrior<elemT>>
40 {
41 #ifdef SWIG
42 public:
43 #endif
47  base_type;
48 
49 public:
50  // Name which will be used when parsing a GeneralisedPrior object
51  inline static const char* const registered_name = "Cuda Relative Difference Prior";
52 #ifndef SWIG
53  // import constructors from base_type
54  // Note: currently disabled for SWIG as that needs SWIG 4.2
56 #endif
57 
59 
60  // Overridden methods
61  void set_defaults() override;
62  double compute_value(const DiscretisedDensity<3, elemT>& current_image_estimate) override;
63  void compute_gradient(DiscretisedDensity<3, elemT>& prior_gradient,
64  const DiscretisedDensity<3, elemT>& current_image_estimate) override;
65 
66  Succeeded set_up(shared_ptr<const DiscretisedDensity<3, elemT>> const& target_sptr) override;
67 
68 protected:
69  struct cppdim3
70  {
71  int x;
72  int y;
73  int z;
74  };
75 
76  int z_dim, y_dim, x_dim;
77  cppdim3 block_dim;
78  cppdim3 grid_dim;
79 
81  float* d_weights_data = 0;
83  float* d_kappa_data = 0;
84 };
85 
86 END_NAMESPACE_STIR
87 
88 #endif // __stir_recon_buildblock_CudaRelativeDifferencePrior_h__
A base class for &#39;generalised&#39; priors, i.e. priors for which at least a &#39;gradient&#39; is defined...
Definition: GeneralisedPrior.h:41
A class in the GeneralisedPrior hierarchy. This implements a Relative Difference prior.
Definition: RelativeDifferencePrior.h:97
Declaration of class stir::RelativeDifferencePrior.
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
CUDA implementation of the Relative Difference prior.
Definition: CudaRelativeDifferencePrior.h:37
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
This abstract class is the basis for all image representations.
Definition: FBP2DReconstruction.h:35