NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMatrixBasedSimulReconRegnMethod.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 itkMatrixBasedSimulReconRegnMethod_h
16 #define itkMatrixBasedSimulReconRegnMethod_h
17 
18 #include <itkProcessObject.h>
19 
20 #include <itkImage.h>
21 #include <itkProjectionGeometry.h>
22 #include <itkSingleValuedNonLinearOptimizer.h>
23 
26 #include <itkEulerAffineTransformMatrixAndItsVariations.h>
27 
28 namespace itk
29 {
30 
45 template <class IntensityType = double>
46 class ITK_EXPORT MatrixBasedSimulReconRegnMethod : public ProcessObject
47 {
48 public:
51  typedef ProcessObject Superclass;
52  typedef SmartPointer<Self> Pointer;
53  typedef SmartPointer<const Self> ConstPointer;
54 
57 
59  itkNewMacro(Self);
60 
62  itkTypeMacro(MatrixBasedSimulReconRegnMethod, ProcessObject);
63 
64  // Some convenient typedefs.
65 
70  typedef typename MatrixFormReconstructionType::Pointer MatrixFormReconstructionPointer;
74  typedef typename MatrixFormReconstructionType::SpacingType MatrixFormReconstructionSpacingType;
75  typedef typename MatrixFormReconstructionType::PointType MatrixFormReconstructionPointType;
77 
81 
83  typedef SingleValuedNonLinearOptimizer OptimizerType;
84  typedef typename OptimizerType::Pointer OptimizerPointer;
85 
89 
93 
98 
101  typedef MatrixFormReconstructionType MatrixFormReconstructionOutputType;
102  typedef typename MatrixFormReconstructionOutputType::Pointer MatrixFormReconstructionOutputPointer;
103  typedef typename MatrixFormReconstructionOutputType::ConstPointer MatrixFormReconstructionOutputConstPointer;
104 
106  itkSetObjectMacro( Optimizer, OptimizerType );
107  itkGetObjectMacro( Optimizer, OptimizerType );
108 
110  itkSetObjectMacro( Metric, MetricType );
111  itkGetObjectMacro( Metric, MetricType );
112 
114  itkSetObjectMacro( ProjectionGeometry, ProjectionGeometryType );
115  itkGetObjectMacro( ProjectionGeometry, ProjectionGeometryType );
116 
118  itkSetObjectMacro( ReconstructionUpdateCommand, ReconstructionUpdateCommandType );
119  itkGetObjectMacro( ReconstructionUpdateCommand, ReconstructionUpdateCommandType );
120 
122  void SetReconEstimate( MatrixFormReconstructionType *im3D);
123 
125  void SetAffineEstimate( EulerAffineTransformType *affinePara);
126 
128  void UpdateReconstructionEstimate( MatrixFormReconstructionType *im3D);
132  void UpdateInitialParameters(void);
134 
135 #if 0
136 
137  void UpdateReconstructionEstimateWithAverage( MatrixFormReconstructionType *im3D);
138 
140  bool SetInputProjectionVolume( MatrixFormReconstructionType *im2D);
141 #endif
142 
144  void SetMatrixFormReconstructedVolumeSize(MatrixFormReconstructionSizeType &reconSize) {m_ReconstructedVolumeSize = reconSize;};
145  void SetMatrixFormReconstructedVolumeSpacing(MatrixFormReconstructionSpacingType &reconSpacing) {m_ReconstructedVolumeSpacing = reconSpacing;};
146  void SetMatrixFormReconstructedVolumeOrigin(MatrixFormReconstructionPointType &reconOrigin) {m_ReconstructedVolumeOrigin = reconOrigin;};
147 
149  virtual void Initialise() throw (ExceptionObject);
150 
151 #if 0
152 
153  MatrixFormReconstructionType *GetInput();
154 #endif
155 
157  MatrixFormReconstructionOutputType *GetOutput();
158 
160  MatrixFormReconstructionOutputType *GetReconstructedVolume() const;
161 
164  virtual DataObjectPointer MakeOutput(unsigned int idx);
165 
168  unsigned long GetMTime() const;
169 
170 protected:
173  void PrintSelf(std::ostream& os, Indent indent) const;
174 
177  virtual void GenerateOutputInformation() {};
178 
183  void StartMatrixFormReconstruction(void);
184 
189  void StartOptimization(void);
190 
193  void GenerateData ();
194 
195 
196 private:
197  MatrixBasedSimulReconRegnMethod(const Self&); // purposely not implemented
198  void operator=(const Self&); // purposely not implemented
199 
200  bool m_FlagInitialised;
201 
202  OptimizerPointer m_Optimizer;
203  MetricPointer m_Metric;
204  ProjectionGeometryPointer m_ProjectionGeometry;
205 
206  MatrixFormReconstructionPointer m_VolumeEstimate;
207  EulerAffineTransformPointer m_EulerAffineEstimate;
208 
209  ParametersType m_InitialParameters;
210  ParametersType m_LastParameters;
211 
212  MatrixFormReconstructionSizeType m_ReconstructedVolumeSize;
213  MatrixFormReconstructionSpacingType m_ReconstructedVolumeSpacing;
214  MatrixFormReconstructionPointType m_ReconstructedVolumeOrigin;
215 
217  ReconstructionUpdateCommandPointer m_ReconstructionUpdateCommand;
218 
219 };
220 
221 
222 } // end namespace itk
223 
224 #ifndef ITK_MANUAL_INSTANTIATION
225 #include "itkMatrixBasedSimulReconRegnMethod.txx"
226 #endif
227 
228 #endif
229 
230 
231 
232 
MatrixBasedSimulReconRegnMetric< double > MetricType
The type of the metric.
Definition: itkMatrixBasedSimulReconRegnMethod.h:87
SmartPointer< Self > Pointer
Definition: itkMatrixBasedSimulReconRegnMetric.h:44
SingleValuedCostFunction::ParametersType ParametersType
Definition: itkMatrixBasedSimulReconRegnMetric.h:83
Class to apply the affine transformation matrix to a 3D image.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:34
SmartPointer< Self > Pointer
Definition: itkProjectionGeometry.h:36
itk::ReconstructionUpdateCommand ReconstructionUpdateCommandType
Definition: itkMatrixBasedSimulReconRegnMethod.h:55
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
MetricType::Pointer MetricPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:88
virtual void GenerateOutputInformation()
Definition: itkMatrixBasedSimulReconRegnMethod.h:177
Base class for Image Reconstruction Methods.
Definition: itkMatrixBasedSimulReconRegnMethod.h:46
Definition: niftkITKAffineResampleImage.cxx:74
Image< IntensityType, 3 > MatrixFormReconstructionType
Definition: itkMatrixBasedSimulReconRegnMethod.h:62
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
MatrixFormReconstructionType::RegionType MatrixFormReconstructionRegionType
Definition: itkMatrixBasedSimulReconRegnMethod.h:71
SmartPointer< const Self > ConstPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:53
MatrixFormReconstructionType MatrixFormReconstructionOutputType
Definition: itkMatrixBasedSimulReconRegnMethod.h:101
MatrixFormReconstructionType::SpacingType MatrixFormReconstructionSpacingType
Definition: itkMatrixBasedSimulReconRegnMethod.h:74
Class to compute the difference between a reconstruction estimate and the target set of 2D projection...
Definition: itkMatrixBasedSimulReconRegnMetric.h:37
void SetMatrixFormReconstructedVolumeOrigin(MatrixFormReconstructionPointType &reconOrigin)
Definition: itkMatrixBasedSimulReconRegnMethod.h:146
ReconstructionUpdateCommand::Pointer ReconstructionUpdateCommandPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:56
Euler Affine transform.
Definition: itkEulerAffineTransform.h:38
Abstract class to calculate the geometry of a CT or tomo machine.
Definition: itkProjectionGeometry.h:29
itk::EulerAffineTransformMatrixAndItsVariations< double > AffineTransformerType
Definition: itkMatrixBasedSimulReconRegnMethod.h:78
ProjectionGeometryType::Pointer ProjectionGeometryPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:92
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
void SetMatrixFormReconstructedVolumeSpacing(MatrixFormReconstructionSpacingType &reconSpacing)
Definition: itkMatrixBasedSimulReconRegnMethod.h:145
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
void SetMatrixFormReconstructedVolumeSize(MatrixFormReconstructionSizeType &reconSize)
Set the size, resolution and origin of the reconstructed image.
Definition: itkMatrixBasedSimulReconRegnMethod.h:144
OptimizerType::Pointer OptimizerPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:84
itk::SmartPointer< Self > Pointer
Definition: itkReconstructionUpdateCommand.h:41
MatrixBasedSimulReconRegnMethod Self
Definition: itkMatrixBasedSimulReconRegnMethod.h:50
SingleValuedNonLinearOptimizer OptimizerType
Type of the optimizer.
Definition: itkMatrixBasedSimulReconRegnMethod.h:83
itk::ProjectionGeometry< double > ProjectionGeometryType
The projection geometry type.
Definition: itkMatrixBasedSimulReconRegnMethod.h:91
virtual ~MatrixBasedSimulReconRegnMethod()
Definition: itkMatrixBasedSimulReconRegnMethod.h:172
MatrixFormReconstructionType::Pointer MatrixFormReconstructionPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:70
MatrixFormReconstructionType::IndexType MatrixFormReconstructionIndexType
Definition: itkMatrixBasedSimulReconRegnMethod.h:76
AffineTransformerType::EulerAffineTransformType EulerAffineTransformType
Definition: itkMatrixBasedSimulReconRegnMethod.h:79
MatrixFormReconstructionType::PointType MatrixFormReconstructionPointType
Definition: itkMatrixBasedSimulReconRegnMethod.h:75
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
SmartPointer< Self > Pointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:52
MetricType::ParametersType ParametersType
Definition: itkMatrixBasedSimulReconRegnMethod.h:97
ProcessObject Superclass
Definition: itkMatrixBasedSimulReconRegnMethod.h:51
MatrixFormReconstructionOutputType::ConstPointer MatrixFormReconstructionOutputConstPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:103
EulerAffineTransformType::Pointer EulerAffineTransformPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:80
SmartPointer< Self > Pointer
Definition: itkEulerAffineTransform.h:49
MatrixFormReconstructionOutputType::Pointer MatrixFormReconstructionOutputPointer
Definition: itkMatrixBasedSimulReconRegnMethod.h:102
MatrixFormReconstructionType::PixelType MatrixFormReconstructionPixelType
Definition: itkMatrixBasedSimulReconRegnMethod.h:72
Override this class to redefine DoExecute().
Definition: itkReconstructionUpdateCommand.h:36
MatrixFormReconstructionType::SizeType MatrixFormReconstructionSizeType
Definition: itkMatrixBasedSimulReconRegnMethod.h:73