NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkImageReconstructionMethod.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 itkImageReconstructionMethod_h
16 #define itkImageReconstructionMethod_h
17 
18 #include <itkProcessObject.h>
19 #include <itkImage.h>
21 #include <itkSingleValuedNonLinearOptimizer.h>
22 #include <itkProjectionGeometry.h>
24 
25 
26 namespace itk
27 {
28 
43 template <class IntensityType = double>
44 class ITK_EXPORT ImageReconstructionMethod : public ProcessObject
45 {
46 public:
49  typedef ProcessObject Superclass;
50  typedef SmartPointer<Self> Pointer;
51  typedef SmartPointer<const Self> ConstPointer;
52 
55 
57  itkNewMacro(Self);
58 
60  itkTypeMacro(ImageReconstructionMethod, ProcessObject);
61 
62  // Some convenient typedefs.
63 
68  typedef typename InputProjectionVolumeType::Pointer InputProjectionVolumePointer;
72  typedef typename InputProjectionVolumeType::SpacingType InputProjectionVolumeSpacingType;
73  typedef typename InputProjectionVolumeType::PointType InputProjectionVolumePointType;
74 
76  typedef typename ReconstructionType::Pointer ReconstructionPointer;
80  typedef typename ReconstructionType::SpacingType ReconstructionSpacingType;
81  typedef typename ReconstructionType::PointType ReconstructionPointType;
83 
85  typedef SingleValuedNonLinearOptimizer OptimizerType;
86  typedef typename OptimizerType::Pointer OptimizerPointer;
87 
91 
95 
100 
103  typedef ReconstructionType ReconstructionOutputType;
104  typedef typename ReconstructionOutputType::Pointer ReconstructionOutputPointer;
105  typedef typename ReconstructionOutputType::ConstPointer ReconstructionOutputConstPointer;
106 
108  itkSetObjectMacro( Optimizer, OptimizerType );
109  itkGetObjectMacro( Optimizer, OptimizerType );
110 
112  itkSetObjectMacro( Metric, MetricType );
113  itkGetObjectMacro( Metric, MetricType );
114 
116  itkSetObjectMacro( ProjectionGeometry, ProjectionGeometryType );
117  itkGetObjectMacro( ProjectionGeometry, ProjectionGeometryType );
118 
120  itkSetObjectMacro( ReconstructionUpdateCommand, ReconstructionUpdateCommandType );
121  itkGetObjectMacro( ReconstructionUpdateCommand, ReconstructionUpdateCommandType );
122 
124  void SetReconEstimate( ReconstructionType *im3D);
125 
127  void UpdateReconstructionEstimate( ReconstructionType *im3D);
130  void UpdateReconstructionEstimateWithAverage( ReconstructionType *im3D);
132  void UpdateInitialParameters(void);
133 
135  bool SetInputProjectionVolume( InputProjectionVolumeType *im2D);
136 
138  void SetReconstructedVolumeSize(ReconstructionSizeType &reconSize) {m_ReconstructedVolumeSize = reconSize;};
139  void SetReconstructedVolumeSpacing(ReconstructionSpacingType &reconSpacing) {m_ReconstructedVolumeSpacing = reconSpacing;};
140  void SetReconstructedVolumeOrigin(ReconstructionPointType &reconOrigin) {m_ReconstructedVolumeOrigin = reconOrigin;};
141 
143  virtual void Initialise() throw (ExceptionObject);
144 
146  InputProjectionVolumeType *GetInput();
148  ReconstructionOutputType *GetOutput();
149 
151  ReconstructionOutputType *GetReconstructedVolume() const;
152 
155  virtual DataObjectPointer MakeOutput(unsigned int idx);
156 
159  unsigned long GetMTime() const override;
160 
161 protected:
163  virtual ~ImageReconstructionMethod() {};
164  void PrintSelf(std::ostream& os, Indent indent) const override;
165 
168  virtual void GenerateOutputInformation() override {};
169 
174  void StartReconstruction(void);
175 
180  void StartOptimization(void);
181 
184  void GenerateData () override;
185 
186 
187 private:
188  ImageReconstructionMethod(const Self&); // purposely not implemented
189  void operator=(const Self&); // purposely not implemented
190 
191  bool m_FlagInitialised;
192 
193  OptimizerPointer m_Optimizer;
194  MetricPointer m_Metric;
195  ProjectionGeometryPointer m_ProjectionGeometry;
196 
197  InputProjectionVolumePointer m_ProjectionImages;
198  ReconstructionPointer m_VolumeEstimate;
199 
200  ParametersType m_InitialParameters;
201  ParametersType m_LastParameters;
202 
203  ReconstructionSizeType m_ReconstructedVolumeSize;
204  ReconstructionSpacingType m_ReconstructedVolumeSpacing;
205  ReconstructionPointType m_ReconstructedVolumeOrigin;
206 
208  ReconstructionUpdateCommandPointer m_ReconstructionUpdateCommand;
209 
210 };
211 
212 
213 } // end namespace itk
214 
215 #ifndef ITK_MANUAL_INSTANTIATION
216 #include "itkImageReconstructionMethod.txx"
217 #endif
218 
219 #endif
220 
221 
222 
223 
Image< IntensityType, 3 > ReconstructionType
Definition: itkImageReconstructionMethod.h:75
ImageReconstructionMethod Self
Definition: itkImageReconstructionMethod.h:48
ReconstructionType::PixelType ReconstructionPixelType
Definition: itkImageReconstructionMethod.h:78
SmartPointer< Self > Pointer
Definition: itkImageReconstructionMetric.h:43
itk::ReconstructionUpdateCommand ReconstructionUpdateCommandType
Definition: itkImageReconstructionMethod.h:53
SmartPointer< Self > Pointer
Definition: itkProjectionGeometry.h:36
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
ReconstructionType ReconstructionOutputType
Definition: itkImageReconstructionMethod.h:103
void SetReconstructedVolumeSpacing(ReconstructionSpacingType &reconSpacing)
Definition: itkImageReconstructionMethod.h:139
ReconstructionType::RegionType ReconstructionRegionType
Definition: itkImageReconstructionMethod.h:77
void SetReconstructedVolumeOrigin(ReconstructionPointType &reconOrigin)
Definition: itkImageReconstructionMethod.h:140
Base class for Image Reconstruction Methods.
Definition: itkImageReconstructionMethod.h:44
ReconstructionUpdateCommand::Pointer ReconstructionUpdateCommandPointer
Definition: itkImageReconstructionMethod.h:54
ReconstructionType::SpacingType ReconstructionSpacingType
Definition: itkImageReconstructionMethod.h:80
Definition: niftkITKAffineResampleImage.cxx:74
itk::ProjectionGeometry< IntensityType > ProjectionGeometryType
The projection geometry type.
Definition: itkImageReconstructionMethod.h:93
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
ReconstructionType::Pointer ReconstructionPointer
Definition: itkImageReconstructionMethod.h:76
OptimizerType::Pointer OptimizerPointer
Definition: itkImageReconstructionMethod.h:86
virtual void GenerateOutputInformation() override
Definition: itkImageReconstructionMethod.h:168
ReconstructionType::SizeType ReconstructionSizeType
Definition: itkImageReconstructionMethod.h:79
Abstract class to calculate the geometry of a CT or tomo machine.
Definition: itkProjectionGeometry.h:29
ReconstructionOutputType::ConstPointer ReconstructionOutputConstPointer
Definition: itkImageReconstructionMethod.h:105
SingleValuedCostFunction::ParametersType ParametersType
Definition: itkImageReconstructionMetric.h:72
SmartPointer< Self > Pointer
Definition: itkImageReconstructionMethod.h:50
ReconstructionType::PointType ReconstructionPointType
Definition: itkImageReconstructionMethod.h:81
SmartPointer< const Self > ConstPointer
Definition: itkImageReconstructionMethod.h:51
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
void SetReconstructedVolumeSize(ReconstructionSizeType &reconSize)
Set the size, resolution and origin of the reconstructed image.
Definition: itkImageReconstructionMethod.h:138
ReconstructionType::IndexType ReconstructionIndexType
Definition: itkImageReconstructionMethod.h:82
MetricType::ParametersType ParametersType
Definition: itkImageReconstructionMethod.h:99
InputProjectionVolumeType::PointType InputProjectionVolumePointType
Definition: itkImageReconstructionMethod.h:73
InputProjectionVolumeType::SpacingType InputProjectionVolumeSpacingType
Definition: itkImageReconstructionMethod.h:72
InputProjectionVolumeType::RegionType InputProjectionVolumeRegionType
Definition: itkImageReconstructionMethod.h:69
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
MetricType::Pointer MetricPointer
Definition: itkImageReconstructionMethod.h:90
itk::SmartPointer< Self > Pointer
Definition: itkReconstructionUpdateCommand.h:41
Class to compute the difference between a reconstruction estimate and the target set of 2D projection...
Definition: itkImageReconstructionMetric.h:36
InputProjectionVolumeType::Pointer InputProjectionVolumePointer
Definition: itkImageReconstructionMethod.h:68
SingleValuedNonLinearOptimizer OptimizerType
Type of the optimizer.
Definition: itkImageReconstructionMethod.h:85
InputProjectionVolumeType::SizeType InputProjectionVolumeSizeType
Definition: itkImageReconstructionMethod.h:71
ProcessObject Superclass
Definition: itkImageReconstructionMethod.h:49
ReconstructionOutputType::Pointer ReconstructionOutputPointer
Definition: itkImageReconstructionMethod.h:104
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
ImageReconstructionMetric< IntensityType > MetricType
The type of the metric.
Definition: itkImageReconstructionMethod.h:89
InputProjectionVolumeType::PixelType InputProjectionVolumePixelType
Definition: itkImageReconstructionMethod.h:70
ProjectionGeometryType::Pointer ProjectionGeometryPointer
Definition: itkImageReconstructionMethod.h:94
Image< IntensityType, 3 > InputProjectionVolumeType
Definition: itkImageReconstructionMethod.h:60
Override this class to redefine DoExecute().
Definition: itkReconstructionUpdateCommand.h:36