15 #ifndef itkForwardAndBackwardProjectionMatrix_h
16 #define itkForwardAndBackwardProjectionMatrix_h
21 #include <vnl/vnl_math.h>
22 #include <vnl/vnl_vector.h>
23 #include <vnl/vnl_sparse_matrix.h>
36 template <
class TScalarType =
double,
class IntensityType =
float>
37 class ITK_EXPORT ForwardAndBackwardProjectionMatrix :
public Object
88 itkSetObjectMacro( AffineTransform, EulerAffineTransformType );
90 itkGetObjectMacro( AffineTransform, EulerAffineTransformType );
92 itkSetObjectMacro( PerspectiveTransform, PerspectiveProjectionTransformType );
94 itkGetObjectMacro( PerspectiveTransform, PerspectiveProjectionTransformType );
101 m_OutputImageSpacing = outImageSpacing;
102 this->GetOutput()->SetSpacing(m_OutputImageSpacing);
106 m_OutputImageOrigin = outImageOrigin;
107 this->GetOutput()->SetOrigin(m_OutputImageOrigin);
112 typedef vnl_sparse_matrix<TScalarType> SparseMatrixType;
117 void SetVolumeSize(
const VolumeSizeType &
r) {m_VolumeSize =
r; m_FlagInitialised =
false;}
120 void GetForwardProjectionSparseMatrix(SparseMatrixType &R, InputImageConstPointer inImage, OutputImagePointer outImage,
121 VolumeSizeType &inSize, OutputImageSizeType &outSize,
const unsigned int &projNum);
124 void GetForwardProjectionSparseMatrix(SparseMatrixType &R, InputImagePointer inImage, OutputImagePointer outImage,
125 VolumeSizeType &inSize, OutputImageSizeType &outSize,
const unsigned int &projNum);
128 void GetBackwardProjectionSparseMatrix(SparseMatrixType &R, SparseMatrixType &RTrans,
129 VolumeSizeType &inSize, OutputImageSizeType &outSize,
const unsigned int &projNum);
132 void CalculteMatrixVectorMultiplication(SparseMatrixType &R, VectorType
const &inputImageVector, VectorType &outputImageVector);
138 void PrintSelf(std::ostream& os, Indent indent)
const;
141 VolumeSizeType m_VolumeSize;
142 unsigned long int m_input3DImageTotalSize;
143 unsigned long int m_output2DImageTotalSize;
146 bool m_FlagInitialised;
149 OutputImageSizeType m_OutputImageSize;
151 OutputImageSpacingType m_OutputImageSpacing;
153 OutputImagePointType m_OutputImageOrigin;
159 ProjectionGeometryPointer m_ProjectionGeometry;
162 EulerAffineTransformType::Pointer m_AffineTransform;
165 PerspectiveProjectionTransformType::Pointer m_PerspectiveTransform;
173 UNDEFINED_DIRECTION=0,
178 } TraversalDirection;
189 void operator=(
const Self&);
195 #ifndef ITK_MANUAL_INSTANTIATION
196 #include "itkForwardAndBackwardProjectionMatrix.txx"
void SetVolumeSize(const VolumeSizeType &r)
Set the volume size.
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:117
InputImageType::PointType InputImagePointType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:62
void SetProjectedImageSize(OutputImageSizeType &outImageSize)
Set the size in pixels of the output projected image.
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:98
OutputImageType::SizeType OutputImageSizeType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:70
SmartPointer< Self > Pointer
Definition: itkProjectionGeometry.h:36
OutputImageType::PointType OutputImagePointType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:72
void SetProjectedImageOrigin(OutputImagePointType &outImageOrigin)
Set the origin of the output projected image.
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:105
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
vnl_vector< TScalarType > VectorType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:114
OutputImageType::IndexType OutputImageIndexType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:73
void SetProjectedImageSpacing(OutputImageSpacingType &outImageSpacing)
Set the resolution in mm of the output projected image.
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:100
Image< IntensityType, 3 > InputImageType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:55
itk::EulerAffineTransform< double, 3, 3 > EulerAffineTransformType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:78
Class to apply the affine transformation matrix to a 3D image.
Definition: Projection/itkForwardAndBackwardProjectionMatrix.h:37
Image< IntensityType, 2 > OutputImageType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:65
Definition: niftkITKAffineResampleImage.cxx:74
ProjectionGeometryType::Pointer ProjectionGeometryPointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:76
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
ForwardAndBackwardProjectionMatrix Self
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:41
itk::Size< 3 > VolumeSizeType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:50
PerspectiveProjectionTransformType::Pointer PerspectiveProjectionTransformPointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:82
Abstract class to calculate the geometry of a CT or tomo machine.
Definition: itkProjectionGeometry.h:29
InputImageType::IndexType InputImageIndexType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:63
InputImageType::Pointer InputImagePointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:56
OutputImageType::PixelType OutputImagePixelType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:69
InputImageType::PixelType InputImagePixelType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:59
OutputImageType::SpacingType OutputImageSpacingType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:71
Object Superclass
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:42
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
EulerAffineTransformType::Pointer EulerAffineTransformPointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:79
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
InputImageType::SpacingType InputImageSpacingType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:61
itk::PerspectiveProjectionTransform< double > PerspectiveProjectionTransformType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:81
itk::ProjectionGeometry< IntensityType > ProjectionGeometryType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:75
GLdouble GLdouble GLdouble r
Definition: glew.h:1390
InputImageType::RegionType InputImageRegionType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:58
OutputImageType::ConstPointer OutputImageConstPointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:67
InputImageType::ConstPointer InputImageConstPointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:57
OutputImageType::Pointer OutputImagePointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:66
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
InputImageType::SizeType InputImageSizeType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:60
SmartPointer< const Self > ConstPointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:44
SmartPointer< Self > Pointer
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:43
OutputImageType::RegionType OutputImageRegionType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:68
vnl_matrix< TScalarType > FullMatrixType
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:113
virtual ~ForwardAndBackwardProjectionMatrix(void)
Definition: Transforms/itkForwardAndBackwardProjectionMatrix.h:137