CTL  0.6.1
Computed Tomography Library
fdkreconstructor.h
1 #ifndef CTL_FDKRECONSTRUCTOR_H
2 #define CTL_FDKRECONSTRUCTOR_H
3 
4 #include "acquisition/acquisitionsetup.h"
5 #include "mat/matrix.h"
6 #include "recon/sfpbackprojector.h"
7 
8 namespace CTL {
9 
10 class AbstractProjectionFilter;
11 
12 namespace OCL {
13 
65 {
67 
68 public: void configure(const AcquisitionSetup& setup) override;
69 public: bool reconstructToPlain(const ProjectionDataView& projections,
70  VoxelVolume<float>& targetVolume) override;
71 public:
73 
74  explicit FDKReconstructor(float q = 1.0f,
75  bool useSFPBackprojector = false);
76  explicit FDKReconstructor(std::unique_ptr<ProjectionFilter> projectionFilter,
77  float q = 1.0f,
78  bool useSFPBackprojector = false);
79  explicit FDKReconstructor(ProjectionFilter* projectionFilter,
80  float q = 1.0f,
81  bool useSFPBackprojector = false);
82  void setProjectionFilter(std::unique_ptr<ProjectionFilter> projectionFilter);
83  void setProjectionFilter(ProjectionFilter* projectionFilter);
84  void setRevisedParkerWeightQ(float q);
86  void useSimpleBackrojector();
87 
88  SFPBackprojector::FootprintType footprintType() const;
89  bool isSFPBackprojectorInUse() const;
90  bool isSimpleBackprojectorInUse() const;
91  float revisedParkerWeightQ() const;
92 
93  bool isApplicableTo(const AcquisitionSetup& setup) const override;
94 
95  // AbstractReconstructor interface
96  QVariant parameter() const override;
97  void setParameter(const QVariant& parameter) override;
98 
99 private:
100  AcquisitionSetup _setup;
101  std::unique_ptr<ProjectionFilter> _projectionFilter;
102  float _q = 1.0f;
103  bool _useSFPBackprojector = false;
104  SFPBackprojector::FootprintType _footprintType = SFPBackprojector::TR;
105 
106  bool consistencyChecks(const ProjectionDataView& projections) const;
107 
108  static float estimateSDD(AcquisitionSetup& setup);
109  static float estimateSID(AcquisitionSetup& setup);
110  static bool isCircularSourceOrbit(AcquisitionSetup& setup);
111  static bool isDetectorTangentialToOrbit(AcquisitionSetup& setup);
112 };
113 
114 } // namespace OCL
115 
116 namespace assist{
117 
124 struct Circle3D{
125  mat::Matrix<3,1> center;
126  mat::Matrix<3,1> normal;
127  double radius;
128 
129  double distanceToPoint(const mat::Matrix<3,1>& pt) const;
130 
131  static Circle3D fromThreePoints(const mat::Matrix<3,1>& p1,
132  const mat::Matrix<3,1>& p2,
133  const mat::Matrix<3,1>& p3);
134 };
135 
136 } // namespace assist
137 
138 } // namespace CTL
139 
140 #endif // CTL_FDKRECONSTRUCTOR_H
SFPBackprojector::FootprintType footprintType() const
Returns the footprint type that is used if isSFPBackprojectorInUse() returns true....
Definition: fdkreconstructor.cpp:370
bool consistencyChecks(const ProjectionDataView &projections) const
Returns true if projections are consistent with the AcquisitionSetup previously passed to configure()...
Definition: fdkreconstructor.cpp:676
void configure(const AcquisitionSetup &setup) override
Passes the AcquisitionSetup that describes the setting in which projections that shall be reconstruct...
Definition: fdkreconstructor.cpp:95
static bool isDetectorTangentialToOrbit(AcquisitionSetup &setup)
Returns true if the detector orientation for all the views defined by setup is such that its rows lay...
Definition: fdkreconstructor.cpp:624
static float estimateSID(AcquisitionSetup &setup)
Estimates the source-to-isocenter distance used in setup.
Definition: fdkreconstructor.cpp:560
bool isSFPBackprojectorInUse() const
Returns true if OCL::SFPBackprojector is in use for the backprojection operation.
Definition: fdkreconstructor.cpp:386
void useSFPBackprojector(SFPBackprojector::FootprintType footprintType=SFPBackprojector::TR)
Enables use of the OCL::SFPBackprojector for the backprojection operation.
Definition: fdkreconstructor.cpp:303
Definition: abstractprojectionfilter.h:10
void setProjectionFilter(std::unique_ptr< ProjectionFilter > projectionFilter)
Sets the projection filter to projectionFilter.
Definition: fdkreconstructor.cpp:342
The VoxelVolume class provides a simple container for storage of voxelized 3D volume data.
Definition: ctsystemview.h:14
Holds a CTSystem together with the information about the system settings for all views from which pro...
Definition: acquisitionsetup.h:175
static float estimateSDD(AcquisitionSetup &setup)
Estimates the source-to-detector distance used in setup.
Definition: fdkreconstructor.cpp:544
The ProjectionDataView class is a read-only wrapper for a reference to ProjectionData.
Definition: projectiondataview.h:51
QVariant parameter() const override
Returns the parameters of this instance as a QVariant.
Definition: fdkreconstructor.cpp:455
bool isApplicableTo(const AcquisitionSetup &setup) const override
Returns true if the reconstruction method can be applied to data whose acquisition is described by se...
Definition: fdkreconstructor.cpp:427
The AbstractReconstructor class defined the interface for reconstruction types.
Definition: abstractreconstructor.h:163
bool isSimpleBackprojectorInUse() const
Returns true if OCL::SimpleBackprojector is in use for the backprojection operation.
Definition: fdkreconstructor.cpp:397
The FDKReconstructor class implements the FDK reconstruction algorithm for reconstruction of cone-bea...
Definition: fdkreconstructor.h:64
static bool isCircularSourceOrbit(AcquisitionSetup &setup)
Returns true if the source positions in the views defined by setup can be considered to lie on a circ...
Definition: fdkreconstructor.cpp:577
bool reconstructToPlain(const ProjectionDataView &projections, VoxelVolume< float > &targetVolume) override
Reconstructs projection data projections into targetVolume and returns true on success.
Definition: fdkreconstructor.cpp:152
#define CTL_TYPE_ID(newIndex)
Definition: serializationinterface.h:189
void setRevisedParkerWeightQ(float q)
Sets the parameter 'q' for the revised Parker weighting to q.
Definition: fdkreconstructor.cpp:285
The SFPBackprojector class is an OpenCL implementation of the separable footprint approach for backpr...
Definition: sfpbackprojector.h:38
void setParameter(const QVariant &parameter) override
Sets the parameters of this instance based on the passed QVariant parameter.
Definition: fdkreconstructor.cpp:485
float revisedParkerWeightQ() const
Returns the current 'q' value used in revised Parker weighting.
Definition: fdkreconstructor.cpp:404
The Circle3D struct represents a circle in three dimensions.
Definition: fdkreconstructor.h:124
void useSimpleBackrojector()
Enables use of the OCL::SimpleBackprojector for the backprojection operation.
Definition: fdkreconstructor.cpp:325