NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.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 itkImageMatrixFormReconTwoDataSetsWithoutRegMetric_h
16 #define itkImageMatrixFormReconTwoDataSetsWithoutRegMetric_h
17 
18 #include <itkConceptChecking.h>
19 #include <itkSingleValuedCostFunction.h>
20 
21 #include <itkForwardAndBackwardProjectionMatrix.h>
22 #include <itkEulerAffineTransformMatrixAndItsVariations.h>
23 
24 
25 namespace itk
26 {
27 
36 template <class IntensityType = double>
37 class ITK_EXPORT ImageMatrixFormReconTwoDataSetsWithoutRegMetric : public SingleValuedCostFunction
38 {
39 public:
40 
43  typedef SingleValuedCostFunction Superclass;
44  typedef SmartPointer<Self> Pointer;
45  typedef SmartPointer<const Self> ConstPointer;
46 
48  itkNewMacro(Self);
49 
51  itkTypeMacro(ImageMatrixFormReconTwoDataSetsWithoutRegMetric, SingleValuedCostFunction);
52 
54  typedef vnl_vector<double> VectorType;
55  typedef vnl_sparse_matrix<double> SparseMatrixType;
56 
59 
68 
73 
76 
78 
80  typedef typename SingleValuedCostFunction::ParametersType ParametersType;
81  typedef typename SingleValuedCostFunction::MeasureType MeasureType;
82  typedef typename SingleValuedCostFunction::DerivativeType DerivativeType;
83 
85  void SetInputVolume( InputVolumePointer inVolume ) { m_inVolume = inVolume; }
86 
88  void SetInputVolumeVector( VectorType &inVolumeVector ) { m_EstimatedVolumeVector = inVolumeVector; }
89 
91  void SetInputTwoProjectionVectors( VectorType &inProjectionOne, VectorType &inProjectionTwo )
92  { m_inProjOne = inProjectionOne; m_inProjTwo = inProjectionTwo; }
93 
95  void SetInputTempProjections( InputProjectionPointer tempProjection ) { m_inProjTemp = tempProjection; }
96 
98  void SetTotalVoxel( const unsigned long int &totalSize3D ) { m_totalSize3D = totalSize3D; }
99 
101  void SetTotalPixel( const unsigned long int &totalSize2D ) { m_totalSize2D = totalSize2D; }
102 
104  void SetTotalProjectionNumber( const unsigned int &projNumber ) { m_ProjectionNumber = projNumber; }
105 
107  void SetTotalProjectionSize( InputProjectionSizeType &projSize ) { m_InProjectionSize = projSize; }
108 
109 
111  void SetProjectionGeometry( ProjectionGeometryType::Pointer pGeometry ) { m_Geometry = pGeometry; }
112 
114  void SetInputVolumeSize(InputVolumeSizeType &inVolumeSize) {m_InVolumeSize = inVolumeSize;};
115  void SetInputVolumeSpacing(InputVolumeSpacingType &inVolumeSpacing) {m_InVolumeSpacing = inVolumeSpacing;};
116  void SetInputVolumeOrigin(InputVolumePointType &inVolumeOrigin) {m_InVolumeOrigin = inVolumeOrigin;};
117 
119  unsigned int GetNumberOfParameters(void) const;
120 
121 #if 0
122  const InputVolumeType *GetReconstructedVolume(void) {
124  return m_FwdAndBackProjDiffFilter->GetPointerToInputVolume();
125  }
126 
129  void SetParametersAddress( const ParametersType & parameters ) const;
132  void SetDerivativesAddress( const DerivativeType & derivatives ) const;
133 
135  void SetParameters( const ParametersType & parameters ) const;
136 
139  void SetIterativeReconEstimateFile( std::string filename ) {
140  fileOutputCurrentEstimate = filename;
141  }
142 
145  void SetIterativeReconEstimateSuffix( std::string suffix ) {
146  suffixOutputCurrentEstimate = suffix;
147  }
148 #endif
149 
152  virtual void GetValueAndDerivative( const ParametersType & parameters,
153  MeasureType & value,
154  DerivativeType & derivative ) const;
155 
162  virtual MeasureType GetValue( const ParametersType & parameters ) const;
163 
170  virtual void GetDerivative( const ParametersType & parameters,
171  DerivativeType & derivative ) const;
172 
173 
174 protected:
175 
176  ImageMatrixFormReconTwoDataSetsWithoutRegMetric();
178 
179  void PrintSelf(std::ostream& os, Indent indent) const;
180 
181 #if 0
182 
184  std::string fileOutputCurrentEstimate;
187  std::string suffixOutputCurrentEstimate;
188 #endif
189 
192  VectorType m_inProjOne, m_inProjTwo;
193 
194  MatrixProjectorPointerType m_MatrixProjector;
196 
197  InputVolumePointer m_inVolume;
198  InputProjectionPointer m_inProjTemp;
199 
200  unsigned long int m_totalSize3D;
201  unsigned long int m_totalSize2D;
202  unsigned int m_ProjectionNumber;
203 
204  InputVolumeSizeType m_InVolumeSize;
205  InputVolumeSpacingType m_InVolumeSpacing;
206  InputVolumePointType m_InVolumeOrigin;
207 
208  InputProjectionSizeType m_InProjectionSize;
209 
211 
212 
213 private:
214  ImageMatrixFormReconTwoDataSetsWithoutRegMetric(const Self&); //purposely not implemented
215  void operator=(const Self&); //purposely not implemented
216 
217 };
218 
219 } // end namespace itk
220 
221 #ifndef ITK_MANUAL_INSTANTIATION
222 #include "itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.txx"
223 #endif
224 
225 #endif
virtual ~ImageMatrixFormReconTwoDataSetsWithoutRegMetric()
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:177
SingleValuedCostFunction Superclass
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:43
InputImageType::PointType InputImagePointType
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:62
MatrixProjectorType::InputImageSizeType InputVolumeSizeType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:64
AffineTransformerType::EulerAffineTransformType EulerAffineTransformType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:75
void SetInputVolumeSize(InputVolumeSizeType &inVolumeSize)
Set the size, resolution and origin of the input volume.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:114
SmartPointer< const Self > ConstPointer
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:45
OutputImageType::SizeType OutputImageSizeType
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:70
Class to apply the affine transformation matrix to a 3D image.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:34
InputVolumeSpacingType m_InVolumeSpacing
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:205
SmartPointer< Self > Pointer
Definition: itkProjectionGeometry.h:36
MatrixProjectorType::OutputImagePointer InputProjectionPointer
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:70
MatrixProjectorType::InputImagePointer InputVolumePointer
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:61
itk::ForwardAndBackwardProjectionMatrix< double, double > MatrixProjectorType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:57
void SetTotalVoxel(const unsigned long int &totalSize3D)
Set the total number of the voxels of the volume.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:98
MatrixProjectorType::InputImagePointType InputVolumePointType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:66
vnl_sparse_matrix< double > SparseMatrixType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:55
Class to apply the affine transformation matrix to a 3D image.
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:37
Definition: niftkITKAffineResampleImage.cxx:74
itk::ProjectionGeometry< double > ProjectionGeometryType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:77
unsigned long int m_totalSize3D
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:200
InputVolumePointType m_InVolumeOrigin
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:206
MatrixProjectorType::InputImageType InputVolumeType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:60
unsigned long int m_totalSize2D
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:201
MatrixProjectorType::InputImageSpacingType InputVolumeSpacingType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:65
Class to compute the difference between a reconstruction estimate and the target set of 2D projection...
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:37
Euler Affine transform.
Definition: itkEulerAffineTransform.h:38
Abstract class to calculate the geometry of a CT or tomo machine.
Definition: itkProjectionGeometry.h:29
GLsizei const GLfloat * value
Definition: glew.h:1833
MatrixProjectorType::OutputImageSizeType InputProjectionSizeType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:72
InputImageType::IndexType InputImageIndexType
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:63
unsigned int m_ProjectionNumber
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:202
InputImageType::Pointer InputImagePointer
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:56
void SetTotalProjectionSize(InputProjectionSizeType &projSize)
Set the total number of the pixels of the projection.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:107
void SetTotalPixel(const unsigned long int &totalSize2D)
Set the total number of the pixels of the projection.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:101
SmartPointer< Self > Pointer
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:44
MatrixProjectorType::InputImageRegionType InputVolumeRegionType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:63
itk::EulerAffineTransformMatrixAndItsVariations< double > AffineTransformerType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:74
InputImageType::SpacingType InputImageSpacingType
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:61
InputProjectionSizeType m_InProjectionSize
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:208
void SetInputVolume(InputVolumePointer inVolume)
Set the 3D reconstruction estimate input volume.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:85
SingleValuedCostFunction::DerivativeType DerivativeType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:82
VectorType m_inProjTwo
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:192
vnl_vector< double > VectorType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:51
MatrixProjectorType::Pointer MatrixProjectorPointerType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:58
ProjectionGeometryType::Pointer m_Geometry
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:210
MatrixProjectorType::OutputImageType InputProjectionType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:69
void SetInputTempProjections(InputProjectionPointer tempProjection)
Set the temporary projection image.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:95
MatrixProjectorType::OutputImageConstPointer InputProjectionConstPointer
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:71
InputVolumePointer m_inVolume
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:197
ImageMatrixFormReconTwoDataSetsWithoutRegMetric Self
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:42
SingleValuedCostFunction::MeasureType MeasureType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:81
void SetProjectionGeometry(ProjectionGeometryType::Pointer pGeometry)
Set the projection geometry.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:111
InputImageType::RegionType InputImageRegionType
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:58
OutputImageType::ConstPointer OutputImageConstPointer
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:67
void SetInputVolumeOrigin(InputVolumePointType &inVolumeOrigin)
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:116
InputImageType::ConstPointer InputImageConstPointer
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:57
SingleValuedCostFunction::ParametersType ParametersType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:80
AffineTransformerType::Pointer m_AffineTransformer
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:195
InputVolumeSizeType m_InVolumeSize
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:204
OutputImageType::Pointer OutputImagePointer
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:66
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
InputImageType::SizeType InputImageSizeType
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:60
MatrixProjectorPointerType m_MatrixProjector
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:194
MatrixProjectorType::InputImageIndexType InputVolumeIndexType
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:67
InputProjectionPointer m_inProjTemp
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:198
MatrixProjectorType::InputImageConstPointer InputVolumeConstPointer
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:62
SmartPointer< Self > Pointer
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:43
void SetInputVolumeVector(VectorType &inVolumeVector)
Set the 3D reconstruction estimate input volume as a vector form.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:88
SmartPointer< Self > Pointer
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:40
VectorType m_EstimatedVolumeVector
Vectors of the image.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:191
GLsizei const GLcharARB ** string
Definition: glew.h:5194
void SetInputTwoProjectionVectors(VectorType &inProjectionOne, VectorType &inProjectionTwo)
Set the input projection images.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:91
void SetTotalProjectionNumber(const unsigned int &projNumber)
Set the total number of the pixels of the projection.
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:104
void SetInputVolumeSpacing(InputVolumeSpacingType &inVolumeSpacing)
Definition: itkImageMatrixFormReconTwoDataSetsWithoutRegMetric.h:115