NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkImageMatrixFormReconstructionMethod.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 itkImageMatrixFormReconstructionMethod_h
16 #define itkImageMatrixFormReconstructionMethod_h
17 
18 #include <itkProcessObject.h>
19 #include <itkImage.h>
21 #include <itkSingleValuedNonLinearOptimizer.h>
22 #include <itkProjectionGeometry.h>
24 
25 namespace itk
26 {
27 
42 template <class IntensityType = double>
43 class ITK_EXPORT ImageMatrixFormReconstructionMethod : public ProcessObject
44 {
45 public:
48  typedef ProcessObject Superclass;
49  typedef SmartPointer<Self> Pointer;
50  typedef SmartPointer<const Self> ConstPointer;
51 
54 
56  itkNewMacro(Self);
57 
59  itkTypeMacro(ImageMatrixFormReconstructionMethod, ProcessObject);
60 
61  // Some convenient typedefs.
62 
67  typedef typename MatrixFormReconstructionType::Pointer MatrixFormReconstructionPointer;
71  typedef typename MatrixFormReconstructionType::SpacingType MatrixFormReconstructionSpacingType;
72  typedef typename MatrixFormReconstructionType::PointType MatrixFormReconstructionPointType;
74 
76  typedef SingleValuedNonLinearOptimizer OptimizerType;
77  typedef typename OptimizerType::Pointer OptimizerPointer;
78 
82 
86 
91 
94  typedef MatrixFormReconstructionType MatrixFormReconstructionOutputType;
95  typedef typename MatrixFormReconstructionOutputType::Pointer MatrixFormReconstructionOutputPointer;
96  typedef typename MatrixFormReconstructionOutputType::ConstPointer MatrixFormReconstructionOutputConstPointer;
97 
99  itkSetObjectMacro( Optimizer, OptimizerType );
100  itkGetObjectMacro( Optimizer, OptimizerType );
101 
103  itkSetObjectMacro( Metric, MetricType );
104  itkGetObjectMacro( Metric, MetricType );
105 
107  itkSetObjectMacro( ProjectionGeometry, ProjectionGeometryType );
108  itkGetObjectMacro( ProjectionGeometry, ProjectionGeometryType );
109 
111  itkSetObjectMacro( ReconstructionUpdateCommand, ReconstructionUpdateCommandType );
112  itkGetObjectMacro( ReconstructionUpdateCommand, ReconstructionUpdateCommandType );
113 
115  void SetReconEstimate( MatrixFormReconstructionType *im3D);
116 
118  void UpdateReconstructionEstimate( MatrixFormReconstructionType *im3D);
122  void UpdateInitialParameters(void);
124 
125 #if 0
126 
127  void UpdateReconstructionEstimateWithAverage( MatrixFormReconstructionType *im3D);
128 
130  bool SetInputProjectionVolume( MatrixFormReconstructionType *im2D);
131 #endif
132 
134  void SetMatrixFormReconstructedVolumeSize(MatrixFormReconstructionSizeType &reconSize) {m_ReconstructedVolumeSize = reconSize;};
135  void SetMatrixFormReconstructedVolumeSpacing(MatrixFormReconstructionSpacingType &reconSpacing) {m_ReconstructedVolumeSpacing = reconSpacing;};
136  void SetMatrixFormReconstructedVolumeOrigin(MatrixFormReconstructionPointType &reconOrigin) {m_ReconstructedVolumeOrigin = reconOrigin;};
137 
139  virtual void Initialise() throw (ExceptionObject);
140 
141 #if 0
142 
143  MatrixFormReconstructionType *GetInput();
144 #endif
145 
147  MatrixFormReconstructionOutputType *GetOutput();
148 
150  MatrixFormReconstructionOutputType *GetReconstructedVolume() const;
151 
154  virtual DataObjectPointer MakeOutput(unsigned int idx);
155 
158  unsigned long GetMTime() const;
159 
160 protected:
163  void PrintSelf(std::ostream& os, Indent indent) const;
164 
167  virtual void GenerateOutputInformation() {};
168 
173  void StartMatrixFormReconstruction(void);
174 
179  void StartOptimization(void);
180 
183  void GenerateData ();
184 
185 
186 private:
187  ImageMatrixFormReconstructionMethod(const Self&); // purposely not implemented
188  void operator=(const Self&); // purposely not implemented
189 
190  bool m_FlagInitialised;
191 
192  OptimizerPointer m_Optimizer;
193  MetricPointer m_Metric;
194  ProjectionGeometryPointer m_ProjectionGeometry;
195 
196  MatrixFormReconstructionPointer m_VolumeEstimate;
197 
198  ParametersType m_InitialParameters;
199  ParametersType m_LastParameters;
200 
201  MatrixFormReconstructionSizeType m_ReconstructedVolumeSize;
202  MatrixFormReconstructionSpacingType m_ReconstructedVolumeSpacing;
203  MatrixFormReconstructionPointType m_ReconstructedVolumeOrigin;
204 
206  ReconstructionUpdateCommandPointer m_ReconstructionUpdateCommand;
207 
208 };
209 
210 
211 } // end namespace itk
212 
213 #ifndef ITK_MANUAL_INSTANTIATION
214 #include "itkImageMatrixFormReconstructionMethod.txx"
215 #endif
216 
217 #endif
218 
219 
220 
221 
MatrixFormReconstructionType::SpacingType MatrixFormReconstructionSpacingType
Definition: itkImageMatrixFormReconstructionMethod.h:71
MetricType::Pointer MetricPointer
Definition: itkImageMatrixFormReconstructionMethod.h:81
SmartPointer< Self > Pointer
Definition: itkProjectionGeometry.h:36
ImageMatrixFormReconstructionMethod Self
Definition: itkImageMatrixFormReconstructionMethod.h:47
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
void SetMatrixFormReconstructedVolumeSize(MatrixFormReconstructionSizeType &reconSize)
Set the size, resolution and origin of the reconstructed image.
Definition: itkImageMatrixFormReconstructionMethod.h:134
SmartPointer< Self > Pointer
Definition: itkImageMatrixFormReconstructionMetric.h:44
Base class for Image Reconstruction Methods.
Definition: itkImageMatrixFormReconstructionMethod.h:43
Class to compute the difference between a reconstruction estimate and the target set of 2D projection...
Definition: itkImageMatrixFormReconstructionMetric.h:37
Definition: niftkITKAffineResampleImage.cxx:74
MetricType::ParametersType ParametersType
Definition: itkImageMatrixFormReconstructionMethod.h:90
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
MatrixFormReconstructionType::PointType MatrixFormReconstructionPointType
Definition: itkImageMatrixFormReconstructionMethod.h:72
SmartPointer< const Self > ConstPointer
Definition: itkImageMatrixFormReconstructionMethod.h:50
MatrixFormReconstructionType::IndexType MatrixFormReconstructionIndexType
Definition: itkImageMatrixFormReconstructionMethod.h:73
MatrixFormReconstructionType MatrixFormReconstructionOutputType
Definition: itkImageMatrixFormReconstructionMethod.h:94
MatrixFormReconstructionOutputType::Pointer MatrixFormReconstructionOutputPointer
Definition: itkImageMatrixFormReconstructionMethod.h:95
ImageMatrixFormReconstructionMetric< double > MetricType
The type of the metric.
Definition: itkImageMatrixFormReconstructionMethod.h:80
MatrixFormReconstructionOutputType::ConstPointer MatrixFormReconstructionOutputConstPointer
Definition: itkImageMatrixFormReconstructionMethod.h:96
void SetMatrixFormReconstructedVolumeOrigin(MatrixFormReconstructionPointType &reconOrigin)
Definition: itkImageMatrixFormReconstructionMethod.h:136
Abstract class to calculate the geometry of a CT or tomo machine.
Definition: itkProjectionGeometry.h:29
OptimizerType::Pointer OptimizerPointer
Definition: itkImageMatrixFormReconstructionMethod.h:77
virtual ~ImageMatrixFormReconstructionMethod()
Definition: itkImageMatrixFormReconstructionMethod.h:162
void SetMatrixFormReconstructedVolumeSpacing(MatrixFormReconstructionSpacingType &reconSpacing)
Definition: itkImageMatrixFormReconstructionMethod.h:135
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
SingleValuedCostFunction::ParametersType ParametersType
Definition: itkImageMatrixFormReconstructionMetric.h:77
itk::SmartPointer< Self > Pointer
Definition: itkReconstructionUpdateCommand.h:41
itk::ProjectionGeometry< double > ProjectionGeometryType
The projection geometry type.
Definition: itkImageMatrixFormReconstructionMethod.h:84
MatrixFormReconstructionType::PixelType MatrixFormReconstructionPixelType
Definition: itkImageMatrixFormReconstructionMethod.h:69
ProjectionGeometryType::Pointer ProjectionGeometryPointer
Definition: itkImageMatrixFormReconstructionMethod.h:85
SmartPointer< Self > Pointer
Definition: itkImageMatrixFormReconstructionMethod.h:49
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
virtual void GenerateOutputInformation()
Definition: itkImageMatrixFormReconstructionMethod.h:167
MatrixFormReconstructionType::RegionType MatrixFormReconstructionRegionType
Definition: itkImageMatrixFormReconstructionMethod.h:68
ReconstructionUpdateCommand::Pointer ReconstructionUpdateCommandPointer
Definition: itkImageMatrixFormReconstructionMethod.h:53
ProcessObject Superclass
Definition: itkImageMatrixFormReconstructionMethod.h:48
SingleValuedNonLinearOptimizer OptimizerType
Type of the optimizer.
Definition: itkImageMatrixFormReconstructionMethod.h:76
Image< IntensityType, 3 > MatrixFormReconstructionType
Definition: itkImageMatrixFormReconstructionMethod.h:59
itk::ReconstructionUpdateCommand ReconstructionUpdateCommandType
Definition: itkImageMatrixFormReconstructionMethod.h:52
Override this class to redefine DoExecute().
Definition: itkReconstructionUpdateCommand.h:36
MatrixFormReconstructionType::SizeType MatrixFormReconstructionSizeType
Definition: itkImageMatrixFormReconstructionMethod.h:70
MatrixFormReconstructionType::Pointer MatrixFormReconstructionPointer
Definition: itkImageMatrixFormReconstructionMethod.h:67