NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkImageReconstructionMetric.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkImageReconstructionMetric_h
16 #define itkImageReconstructionMetric_h
17 
18 #include <itkImageToImageFilter.h>
19 #include <itkConceptChecking.h>
20 #include <itkSingleValuedCostFunction.h>
22 
23 
24 namespace itk
25 {
26 
35 template <class IntensityType = float>
36 class ITK_EXPORT ImageReconstructionMetric : public SingleValuedCostFunction
37 {
38 public:
39 
42  typedef SingleValuedCostFunction Superclass;
43  typedef SmartPointer<Self> Pointer;
44  typedef SmartPointer<const Self> ConstPointer;
45 
47  itkNewMacro(Self);
48 
50  itkTypeMacro(ImageReconstructionMetric, SingleValuedCostFunction);
51 
57 
60 
63 
66 
69 
70 
72  typedef typename SingleValuedCostFunction::ParametersType ParametersType;
73  typedef typename SingleValuedCostFunction::MeasureType MeasureType;
74  typedef typename SingleValuedCostFunction::DerivativeType DerivativeType;
75 
77  void SetInputVolume( InputVolumeType *im3D );
78 
80  void SetInputProjectionVolume( InputProjectionVolumeType *im2D );
81 
83  void SetProjectionGeometry( ProjectionGeometryType *projGeometry );
84 
86  unsigned int GetNumberOfParameters(void) const override;
87 
89  const InputVolumeType *GetReconstructedVolume(void) {
90  return m_FwdAndBackProjDiffFilter->GetPointerToInputVolume();
91  }
92 
95  void SetParametersAddress( const ParametersType & parameters ) const;
98  void SetDerivativesAddress( const DerivativeType & derivatives ) const;
99 
101  void SetParameters( const ParametersType & parameters ) const;
102 
106  fileOutputCurrentEstimate = filename;
107  }
108 
112  suffixOutputCurrentEstimate = suffix;
113  }
114 
116  void Initialise(void) {m_FwdAndBackProjDiffFilter->Initialise();}
117 
120  virtual void GetValueAndDerivative( const ParametersType & parameters,
121  MeasureType & value,
122  DerivativeType & derivative ) const override;
123 
130  virtual MeasureType GetValue( const ParametersType & parameters ) const override;
131 
138  virtual void GetDerivative( const ParametersType & parameters,
139  DerivativeType & derivative ) const override;
140 
141 
142 protected:
143 
146 
147  void PrintSelf(std::ostream& os, Indent indent) const override;
148 
155 
157  ForwardAndBackProjectionDifferenceFilterPointerType m_FwdAndBackProjDiffFilter;
158 
159 
160 private:
161  ImageReconstructionMetric(const Self&); //purposely not implemented
162  void operator=(const Self&); //purposely not implemented
163 
164 };
165 
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkImageReconstructionMetric.txx"
170 #endif
171 
172 #endif
ForwardAndBackProjectionDifferenceFilterType::OutputBackProjectedDifferencesType OutputBackProjectedDifferencesType
Definition: itkImageReconstructionMetric.h:67
void SetIterativeReconEstimateFile(std::string filename)
Definition: itkImageReconstructionMetric.h:105
SmartPointer< const Self > ConstPointer
Definition: itkImageReconstructionMetric.h:44
SingleValuedCostFunction::MeasureType MeasureType
Definition: itkImageReconstructionMetric.h:73
SmartPointer< Self > Pointer
Definition: itkImageReconstructionMetric.h:43
virtual ~ImageReconstructionMetric()
Definition: itkImageReconstructionMetric.h:145
void Initialise(void)
Definition: itkImageReconstructionMetric.h:116
Class to compute the difference between a reconstruction estimate and the target set of 2D projection...
Definition: itkForwardAndBackProjectionDifferenceFilter.h:43
ForwardAndBackProjectionDifferenceFilterType::InputVolumePointer InputVolumePointer
Definition: itkImageReconstructionMetric.h:59
ForwardAndBackProjectionDifferenceFilterType::Pointer ForwardAndBackProjectionDifferenceFilterPointerType
Definition: itkImageReconstructionMetric.h:56
ForwardAndBackProjectionDifferenceFilterType::InputProjectionVolumePointer InputProjectionVolumePointer
Definition: itkImageReconstructionMetric.h:62
Definition: niftkITKAffineResampleImage.cxx:74
ImageReconstructionMetric Self
Definition: itkImageReconstructionMetric.h:41
SingleValuedCostFunction Superclass
Definition: itkImageReconstructionMetric.h:42
ForwardAndBackProjectionDifferenceFilterType::ProjectionGeometryType ProjectionGeometryType
Definition: itkImageReconstructionMetric.h:64
ProjectionGeometryType::Pointer ProjectionGeometryPointer
Definition: itkForwardAndBackProjectionDifferenceFilter.h:113
itk::ForwardAndBackProjectionDifferenceFilter< IntensityType > ForwardAndBackProjectionDifferenceFilterType
Definition: itkImageReconstructionMetric.h:50
OutputBackProjectedDifferencesType::Pointer OutputBackProjectedDifferencesPointer
Definition: itkForwardAndBackProjectionDifferenceFilter.h:81
Abstract class to calculate the geometry of a CT or tomo machine.
Definition: itkProjectionGeometry.h:29
SingleValuedCostFunction::ParametersType ParametersType
Definition: itkImageReconstructionMetric.h:72
GLsizei const GLfloat * value
Definition: glew.h:1833
InputVolumeType::Pointer InputVolumePointer
Definition: itkForwardAndBackProjectionDifferenceFilter.h:64
const InputVolumeType * GetReconstructedVolume(void)
Get the 3D reconstructed volume.
Definition: itkImageReconstructionMetric.h:89
SmartPointer< Self > Pointer
Definition: itkForwardAndBackProjectionDifferenceFilter.h:53
Class to compute the difference between a reconstruction estimate and the target set of 2D projection...
Definition: itkImageReconstructionMetric.h:36
ForwardAndBackProjectionDifferenceFilterType::InputProjectionVolumeType InputProjectionVolumeType
Definition: itkImageReconstructionMetric.h:61
ForwardAndBackProjectionDifferenceFilterType::InputVolumeType InputVolumeType
Definition: itkImageReconstructionMetric.h:58
std::string fileOutputCurrentEstimate
Definition: itkImageReconstructionMetric.h:151
std::string suffixOutputCurrentEstimate
Definition: itkImageReconstructionMetric.h:154
ForwardAndBackProjectionDifferenceFilterType::OutputBackProjectedDifferencesPointer OutputBackProjectedDifferencesPointer
Definition: itkImageReconstructionMetric.h:68
SingleValuedCostFunction::DerivativeType DerivativeType
Definition: itkImageReconstructionMetric.h:74
ForwardAndBackProjectionDifferenceFilterType::ProjectionGeometryPointer ProjectionGeometryPointer
Definition: itkImageReconstructionMetric.h:65
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
InputProjectionVolumeType::Pointer InputProjectionVolumePointer
Definition: itkForwardAndBackProjectionDifferenceFilter.h:73
ForwardAndBackProjectionDifferenceFilterPointerType m_FwdAndBackProjDiffFilter
The filter to perform the forward and back-projection.
Definition: itkImageReconstructionMetric.h:157
void SetIterativeReconEstimateSuffix(std::string suffix)
Definition: itkImageReconstructionMetric.h:111
GLsizei const GLcharARB ** string
Definition: glew.h:5194