Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
itkImageToImageRegistrationMethod.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: RigidRegistrator.h,v $
5  Language: C++
6  Date: $Date: 2006/11/06 14:39:34 $
7  Version: $Revision: 1.15 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef itkImageToImageRegistrationMethod_h
19 #define itkImageToImageRegistrationMethod_h
20 
21 #include "itkSpatialObject.h"
22 #include "itkImageRegistrationMethod.h"
23 
24 namespace itk
25 {
26 
38 template <class TImage>
40  : public ProcessObject
41 {
42 
43 public:
44 
46  typedef ProcessObject Superclass;
47  typedef SmartPointer<Self> Pointer;
48  typedef SmartPointer<const Self> ConstPointer;
49 
51 
52  itkNewMacro( Self );
53 
54  //
55  // Custom Typedefs
56  //
57  itkStaticConstMacro( ImageDimension, unsigned int,
58  TImage::ImageDimension );
59 
60  typedef Transform<double,
61  itkGetStaticConstMacro( ImageDimension ),
62  itkGetStaticConstMacro( ImageDimension )>
64 
65  typedef DataObjectDecorator<TransformType> TransformOutputType;
66 
67  typedef typename DataObject::Pointer DataObjectPointer;
68  typedef Superclass::DataObjectPointerArraySizeType
70 
71  typedef TImage ImageType;
72 
73  typedef typename TImage::PointType PointType;
74 
75  typedef SpatialObject<itkGetStaticConstMacro( ImageDimension )>
77 
78  //
79  // Custom Methods
80  //
81  itkSetMacro( RegistrationNumberOfThreads, unsigned int );
82  itkGetMacro( RegistrationNumberOfThreads, unsigned int );
83 
84  itkSetObjectMacro( Observer, Command );
85  itkGetObjectMacro( Observer, Command );
86 
87  void SetFixedImage( const ImageType * fixedImage );
88 
89  itkGetConstObjectMacro( FixedImage, ImageType );
90 
91  void SetMovingImage( const ImageType * movingImage );
92 
93  itkGetConstObjectMacro( MovingImage, ImageType );
94 
95  void SetRegionOfInterest( const PointType & point1, const PointType & point2 );
96 
97  itkSetMacro(UseRegionOfInterest, bool);
98  itkGetMacro(UseRegionOfInterest, bool);
99  itkSetMacro(RegionOfInterestPoint1, PointType);
100  itkGetMacro(RegionOfInterestPoint1, PointType);
101  itkSetMacro(RegionOfInterestPoint2, PointType);
102  itkGetMacro(RegionOfInterestPoint2, PointType);
103 
104  void SetFixedImageMaskObject( const MaskObjectType * maskObject );
105 
106  itkGetConstObjectMacro( FixedImageMaskObject, MaskObjectType );
107 
108  itkSetMacro( UseFixedImageMaskObject, bool );
109  itkGetMacro( UseFixedImageMaskObject, bool );
110 
111  void SetMovingImageMaskObject( const MaskObjectType * maskObject );
112 
113  itkGetConstObjectMacro( MovingImageMaskObject, MaskObjectType );
114 
115  itkSetMacro( UseMovingImageMaskObject, bool );
116  itkGetMacro( UseMovingImageMaskObject, bool );
117 
118  itkSetMacro( ReportProgress, bool );
119  itkGetMacro( ReportProgress, bool );
120  itkBooleanMacro( ReportProgress );
121 
123  const TransformOutputType* GetOutput() const;
124 
125 protected:
128 
129  virtual void Initialize();
130 
134  void GenerateData() override;
135 
136  void PrintSelf( std::ostream & os, Indent indent ) const override;
137 
139  itkSetObjectMacro( Transform, TransformType );
140  itkGetObjectMacro( Transform, TransformType );
142 
143  using Superclass::MakeOutput;
145 
146  ModifiedTimeType GetMTime() const override;
147 
148 protected:
149 
150  typename TransformType::Pointer m_Transform;
151 private:
152 
153  ImageToImageRegistrationMethod( const Self & ); // Purposely not implemented
154  void operator =( const Self & ); // Purposely not implemented
155 
156  unsigned int m_RegistrationNumberOfThreads;
157 
158  Command::Pointer m_Observer;
159 
160  typename ImageType::ConstPointer m_FixedImage;
161  typename ImageType::ConstPointer m_MovingImage;
162 
163  bool m_UseRegionOfInterest;
164  PointType m_RegionOfInterestPoint1;
165  PointType m_RegionOfInterestPoint2;
166 
167  bool m_UseFixedImageMaskObject;
168  typename MaskObjectType::ConstPointer m_FixedImageMaskObject;
169 
170  bool m_UseMovingImageMaskObject;
171  typename MaskObjectType::ConstPointer m_MovingImageMaskObject;
172 
173  bool m_ReportProgress;
174 
175 };
176 
177 }
178 
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "itkImageToImageRegistrationMethod.txx"
181 #endif
182 
183 #endif
Superclass::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
itkSetMacro(RegistrationNumberOfThreads, unsigned int)
Simplified inverse ITK transforms.
Transform< double, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension)> TransformType
itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension)
void SetMovingImageMaskObject(const MaskObjectType *maskObject)
void SetMovingImage(const ImageType *movingImage)
DataObjectDecorator< TransformType > TransformOutputType
void SetFixedImageMaskObject(const MaskObjectType *maskObject)
void SetFixedImage(const ImageType *fixedImage)
itkGetMacro(RegistrationNumberOfThreads, unsigned int)
const TransformOutputType * GetOutput() const
ModifiedTimeType GetMTime() const override
void PrintSelf(std::ostream &os, Indent indent) const override
itkSetObjectMacro(Observer, Command)
void SetRegionOfInterest(const PointType &point1, const PointType &point2)
itkTypeMacro(ImageToImageRegistrationMethod, ProcessObject)
SpatialObject< itkGetStaticConstMacro(ImageDimension)> MaskObjectType
itkGetConstObjectMacro(FixedImage, ImageType)
itkGetObjectMacro(Observer, Command)