go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkTranslationTransformInitializer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef __itkTranslationTransformInitializer_h
20 #define __itkTranslationTransformInitializer_h
21 
22 #include "itkObject.h"
23 #include "itkObjectFactory.h"
24 #include "itkImageMomentsCalculator.h"
25 
26 #include <iostream>
27 
28 namespace itk
29 {
30 
60 template< class TTransform,
61 class TFixedImage,
62 class TMovingImage >
63 class TranslationTransformInitializer : public Object
64 {
65 public:
66 
69  typedef Object Superclass;
71  typedef SmartPointer< const Self > ConstPointer;
72 
74  itkNewMacro( Self );
75 
77  itkTypeMacro( TranslationTransformInitializer, Object );
78 
80  typedef TTransform TransformType;
81  typedef typename TransformType::Pointer TransformPointer;
82 
84  itkStaticConstMacro( SpaceDimension, unsigned int, TransformType::SpaceDimension );
85  itkStaticConstMacro( InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension );
86  itkStaticConstMacro( OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension );
87 
89  typedef TFixedImage FixedImageType;
90  typedef TMovingImage MovingImageType;
91  typedef typename FixedImageType::ConstPointer FixedImagePointer;
92  typedef typename MovingImageType::ConstPointer MovingImagePointer;
95  typedef typename FixedMaskType::ConstPointer FixedMaskPointer;
96  typedef typename MovingMaskType::ConstPointer MovingMaskPointer;
97 
99  typedef ImageMomentsCalculator< FixedImageType > FixedImageCalculatorType;
100  typedef ImageMomentsCalculator< MovingImageType > MovingImageCalculatorType;
101 
102  typedef typename FixedImageCalculatorType::Pointer FixedImageCalculatorPointer;
103  typedef typename MovingImageCalculatorType::Pointer MovingImageCalculatorPointer;
104 
106  typedef typename TransformType::InputPointType InputPointType;
107 
109  typedef typename TransformType::OutputVectorType OutputVectorType;
110 
112  itkSetObjectMacro( Transform, TransformType );
113 
115  itkSetConstObjectMacro( FixedImage, FixedImageType );
116 
118  itkSetConstObjectMacro( MovingImage, MovingImageType );
119 
121  itkSetConstObjectMacro( FixedMask, FixedMaskType );
122 
124  itkSetConstObjectMacro( MovingMask, MovingMaskType );
125 
127  virtual void InitializeTransform() const;
128 
131  void GeometryOn() { m_UseMoments = false; }
132  void MomentsOn() { m_UseMoments = true; }
133 
135  itkGetConstObjectMacro( FixedCalculator, FixedImageCalculatorType );
136  itkGetConstObjectMacro( MovingCalculator, MovingImageCalculatorType );
137 
138 protected:
139 
142 
143  void PrintSelf( std::ostream & os, Indent indent ) const;
144 
145 private:
146 
147  TranslationTransformInitializer( const Self & ); // purposely not implemented
148  void operator=( const Self & ); // purposely not implemented
149 
150  TransformPointer m_Transform;
151  FixedImagePointer m_FixedImage;
152  MovingImagePointer m_MovingImage;
153  FixedMaskPointer m_FixedMask;
154  MovingMaskPointer m_MovingMask;
156 
157  FixedImageCalculatorPointer m_FixedCalculator;
158  MovingImageCalculatorPointer m_MovingCalculator;
159 
160 };
161 
162 } // namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkTranslationTransformInitializer.hxx"
166 #endif
167 
168 #endif /* __itkTranslationTransformInitializer_h */
ImageMomentsCalculator< FixedImageType > FixedImageCalculatorType
itkStaticConstMacro(SpaceDimension, unsigned int, TransformType::SpaceDimension)
virtual void InitializeTransform() const
MovingImageCalculatorType::Pointer MovingImageCalculatorPointer
ImageMomentsCalculator< MovingImageType > MovingImageCalculatorType
void PrintSelf(std::ostream &os, Indent indent) const
TranslationTransformInitializer is a helper class intended to initialize the translation of a Transla...
Image< unsigned char, OutputSpaceDimension > MovingMaskType
Image< unsigned char, InputSpaceDimension > FixedMaskType
FixedImageCalculatorType::Pointer FixedImageCalculatorPointer


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo