NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkCreateEulerAffineTransformMatrix.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 itkCreateEulerAffineTransformMatrix_h
16 #define itkCreateEulerAffineTransformMatrix_h
17 
20 #include <itk_hash_map.h>
21 
22 #include <vnl/vnl_math.h>
23 #include <vnl/vnl_vector.h>
24 #include <vnl/vnl_sparse_matrix.h>
25 
26 
27 namespace itk
28 {
29 
34 template <class IntensityType = float>
36  public CreateEulerAffineTransformMatrixBaseClass<Image< IntensityType, 3>, // Input image
37  Image< IntensityType, 3> > // Output image
38 {
39 public:
42  typedef SmartPointer<Self> Pointer;
43  typedef SmartPointer<const Self> ConstPointer;
45 
47  itkNewMacro(Self);
48 
51 
54  typedef typename InputImageType::Pointer InputImagePointer;
55  typedef typename InputImageType::ConstPointer InputImageConstPointer;
58  typedef typename InputImageType::SpacingType InputImageSpacingType;
59  typedef typename InputImageType::PointType InputImagePointType;
62 
63 
65  typedef typename OutputImageType::Pointer OutputImagePointer;
66  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
69  typedef typename OutputImageType::SpacingType OutputImageSpacingType;
70  typedef typename OutputImageType::PointType OutputImagePointType;
73 
75 
77  typedef vnl_sparse_matrix<double> SparseMatrixType;
78  typedef vnl_matrix<double> FullMatrixType;
79  typedef vnl_vector<double> VectorType;
80 
82  typedef itk::hash_map<int, VectorType> VectorMapType;
83  typedef typename itk::hash_map<int, VectorType>::iterator VectorMapIterator;
84  typedef typename itk::hash_map<int, VectorType>::const_iterator VectorMapConstIterator;
85 
87  itkStaticConstMacro(InputImageDimension, unsigned int, 3);
88  itkStaticConstMacro(OutputImageDimension, unsigned int, 3);
90  itkSetObjectMacro( AffineTransform, EulerAffineTransformType );
92  itkGetObjectMacro( AffineTransform, EulerAffineTransformType );
93 
101  virtual void GenerateOutputInformation(void);
102 
110  virtual void GenerateInputRequestedRegion(void);
111  virtual void EnlargeOutputRequestedRegion(DataObject *output);
112 
114  void SetTransformedImageSize(OutputImageSizeType &outImageSize) {m_OutputImageSize = outImageSize;};
116  void SetTransformedImageSpacing(OutputImageSpacingType &outImageSpacing) {
117  m_OutputImageSpacing = outImageSpacing;
118  this->GetOutput()->SetSpacing(m_OutputImageSpacing);
119  };
121  void SetTransformedImageOrigin(OutputImagePointType &outImageOrigin) {
122  m_OutputImageOrigin = outImageOrigin;
123  this->GetOutput()->SetOrigin(m_OutputImageOrigin);
124  };
125 
127  void SetSingleThreadedExecution(void) {m_FlagMultiThreadedExecution = false;}
128 
129 protected:
132  void PrintSelf(std::ostream& os, Indent indent) const;
133 
144  virtual void BeforeThreadedGenerateData(void);
145 
156  virtual void AfterThreadedGenerateData(void);
157 
160  void GenerateData();
161 
172  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
173  ThreadIdType threadId );
174 
176  OutputImageSizeType m_OutputImageSize;
178  OutputImageSpacingType m_OutputImageSpacing;
180  OutputImagePointType m_OutputImageOrigin;
181 
184 
186  FullMatrixType m_affineCoreMatrix;
188 
192 
195 
198 
201 
202 private:
203  CreateEulerAffineTransformMatrix(const Self&); //purposely not implemented
204  void operator=(const Self&); //purposely not implemented
205 
206 };
207 
208 } // end namespace itk
209 
210 #ifndef ITK_MANUAL_INSTANTIATION
211 #include "itkCreateEulerAffineTransformMatrix.txx"
212 #endif
213 
214 #endif
EulerAffineTransform< double, 3, 3 > EulerAffineTransformType
Definition: itkCreateEulerAffineTransformMatrix.h:74
void SetTransformedImageSpacing(OutputImageSpacingType &outImageSpacing)
Definition: itkCreateEulerAffineTransformMatrix.h:116
itk::hash_map< int, VectorType >::const_iterator VectorMapConstIterator
Definition: itkCreateEulerAffineTransformMatrix.h:84
InputImageType::SpacingType InputImageSpacingType
Definition: itkCreateEulerAffineTransformMatrix.h:58
itk::hash_map< int, VectorType >::iterator VectorMapIterator
Definition: itkCreateEulerAffineTransformMatrix.h:83
Class to apply the affine transformation matrix to a 3D image.
Definition: itkCreateEulerAffineTransformMatrix.h:35
InputImageType::RegionType InputImageRegionType
Definition: itkCreateEulerAffineTransformMatrix.h:56
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
void SetTransformedImageSize(OutputImageSizeType &outImageSize)
Definition: itkCreateEulerAffineTransformMatrix.h:114
void SetSingleThreadedExecution(void)
Definition: itkCreateEulerAffineTransformMatrix.h:127
InputImageType::ConstPointer InputImageConstPointer
Definition: itkCreateEulerAffineTransformMatrix.h:55
OutputImagePointType m_OutputImageOrigin
Definition: itkCreateEulerAffineTransformMatrix.h:180
virtual ~CreateEulerAffineTransformMatrix(void)
Definition: itkCreateEulerAffineTransformMatrix.h:131
OutputImageType::Pointer OutputImagePointer
Definition: itkCreateEulerAffineTransformMatrix.h:65
Definition: niftkITKAffineResampleImage.cxx:74
SmartPointer< Self > Pointer
Definition: itkCreateEulerAffineTransformMatrix.h:42
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
InputImageType::PointType InputImagePointType
Definition: itkCreateEulerAffineTransformMatrix.h:59
InputImageType::PixelType InputImagePixelType
Definition: itkCreateEulerAffineTransformMatrix.h:60
The base class for 3D-3D affine transformation matrix.
Definition: itkCreateEulerAffineTransformMatrixBaseClass.h:30
Image< IntensityType, 3 > InputImageType
Definition: itkCreateEulerAffineTransformMatrix.h:50
EulerAffineTransformType::Pointer m_AffineTransform
Definition: itkCreateEulerAffineTransformMatrix.h:194
Euler Affine transform.
Definition: itkEulerAffineTransform.h:38
CreateEulerAffineTransformMatrix Self
Definition: itkCreateEulerAffineTransformMatrix.h:41
OutputImageType::IndexType OutputImageIndexType
Definition: itkCreateEulerAffineTransformMatrix.h:72
OutputImageType::SpacingType OutputImageSpacingType
Definition: itkCreateEulerAffineTransformMatrix.h:69
vnl_matrix< double > FullMatrixType
Definition: itkCreateEulerAffineTransformMatrix.h:78
vnl_vector< double > VectorType
Definition: itkCreateEulerAffineTransformMatrix.h:79
FullMatrixType m_affineCoreMatrix
Definition: itkCreateEulerAffineTransformMatrix.h:186
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
SparseMatrixType m_sparseAffineTransformMatrix
Definition: itkCreateEulerAffineTransformMatrix.h:197
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
VectorType m_outputCoordinateVector
Definition: itkCreateEulerAffineTransformMatrix.h:191
InputImageType::Pointer InputImagePointer
Definition: itkCreateEulerAffineTransformMatrix.h:54
VectorType m_inputCoordinateVector
Definition: itkCreateEulerAffineTransformMatrix.h:190
FullMatrixType m_affineCoreMatrixInverse
Definition: itkCreateEulerAffineTransformMatrix.h:187
bool m_FlagMultiThreadedExecution
Definition: itkCreateEulerAffineTransformMatrix.h:183
InputImageType::IndexType InputImageIndexType
Definition: itkCreateEulerAffineTransformMatrix.h:61
OutputImageType::PointType OutputImagePointType
Definition: itkCreateEulerAffineTransformMatrix.h:70
OutputImageSpacingType m_OutputImageSpacing
Definition: itkCreateEulerAffineTransformMatrix.h:178
OutputImageType::SizeType OutputImageSizeType
Definition: itkCreateEulerAffineTransformMatrix.h:68
Image< IntensityType, 3 > OutputImageType
Definition: itkCreateEulerAffineTransformMatrix.h:64
OutputImageType::PixelType OutputImagePixelType
Definition: itkCreateEulerAffineTransformMatrix.h:71
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
OutputImageSizeType m_OutputImageSize
Definition: itkCreateEulerAffineTransformMatrix.h:176
void SetTransformedImageOrigin(OutputImagePointType &outImageOrigin)
Definition: itkCreateEulerAffineTransformMatrix.h:121
InputImageType::SizeType InputImageSizeType
Definition: itkCreateEulerAffineTransformMatrix.h:57
itk::hash_map< int, VectorType > VectorMapType
Definition: itkCreateEulerAffineTransformMatrix.h:82
SmartPointer< const Self > ConstPointer
Definition: itkCreateEulerAffineTransformMatrix.h:43
SmartPointer< Self > Pointer
Definition: itkEulerAffineTransform.h:49
OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkCreateEulerAffineTransformMatrix.h:66
vnl_sparse_matrix< double > SparseMatrixType
Definition: itkCreateEulerAffineTransformMatrix.h:77
SparseMatrixType m_sparseTransposeAffineTransformMatrix
Definition: itkCreateEulerAffineTransformMatrix.h:200
CreateEulerAffineTransformMatrixBaseClass< Image< IntensityType, 3 >, Image< IntensityType, 3 > > Superclass
Definition: itkCreateEulerAffineTransformMatrix.h:44
OutputImageType::RegionType OutputImageRegionType
Definition: itkCreateEulerAffineTransformMatrix.h:67