go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkCenteredTransformInitializer2.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 
20  Program: Insight Segmentation & Registration Toolkit
21  Module: $RCSfile: itkCenteredTransformInitializer2.h,v $
22  Language: C++
23  Date: $Date: 2010-07-04 10:30:49 $
24  Version: $Revision: 1.11 $
25 
26  Copyright (c) Insight Software Consortium. All rights reserved.
27  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
28 
29  This software is distributed WITHOUT ANY WARRANTY; without even
30  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
31  PURPOSE. See the above copyright notices for more information.
32 
33 =========================================================================*/
34 #ifndef __itkCenteredTransformInitializer2_h
35 #define __itkCenteredTransformInitializer2_h
36 
37 #include "itkObject.h"
38 #include "itkObjectFactory.h"
39 #include "itkSpatialObject.h"
40 #include "itkImageMomentsCalculator.h"
41 
42 #include <iostream>
43 
44 namespace itk
45 {
46 
91 template < class TTransform,
92  class TFixedImage,
93  class TMovingImage >
94 class CenteredTransformInitializer2 : public Object
95 {
96 public:
97 
100  typedef Object Superclass;
102  typedef SmartPointer< const Self > ConstPointer;
103 
105  itkNewMacro( Self );
106 
108  itkTypeMacro( CenteredTransformInitializer2, Object );
109 
111  typedef TTransform TransformType;
112  typedef typename TransformType::Pointer TransformPointer;
113 
115  itkStaticConstMacro(InputSpaceDimension, unsigned int,
116  TransformType::InputSpaceDimension);
117  itkStaticConstMacro(OutputSpaceDimension, unsigned int,
118  TransformType::OutputSpaceDimension);
119 
121  typedef TFixedImage FixedImageType;
122  typedef TMovingImage MovingImageType;
123 
124  typedef typename FixedImageType::ConstPointer FixedImagePointer;
125  typedef typename MovingImageType::ConstPointer MovingImagePointer;
126 
129  typedef typename FixedImageMaskType::ConstPointer FixedImageMaskPointer;
130  typedef typename MovingImageMaskType::ConstPointer MovingImageMaskPointer;
131 
133  typedef ImageMomentsCalculator< FixedImageType >
135  typedef ImageMomentsCalculator< MovingImageType >
137 
138  typedef typename FixedImageCalculatorType::Pointer
140  typedef typename MovingImageCalculatorType::Pointer
142 
143 
145  typedef typename TransformType::OffsetType OffsetType;
146 
148  typedef typename TransformType::InputPointType InputPointType;
149 
151  typedef typename TransformType::OutputVectorType OutputVectorType;
152 
154  itkSetObjectMacro( Transform, TransformType );
155 
157  itkSetConstObjectMacro( FixedImage, FixedImageType );
158 
160  itkSetConstObjectMacro( MovingImage, MovingImageType );
161 
163  itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
164  itkSetConstObjectMacro( MovingImageMask, MovingImageMaskType );
165 
167  virtual void InitializeTransform();
168 
171  void GeometryOn() { m_UseMoments = false; m_UseOrigins = false; m_UseTop = false; }
172  void MomentsOn() { m_UseMoments = true; m_UseOrigins = false; m_UseTop = false; }
173  void OriginsOn() { m_UseMoments = false; m_UseOrigins = true; m_UseTop = false; }
174  void GeometryTopOn() { m_UseMoments = false; m_UseOrigins = false; m_UseTop = true; }
175 
177  itkGetConstObjectMacro( FixedCalculator, FixedImageCalculatorType );
178  itkGetConstObjectMacro( MovingCalculator, MovingImageCalculatorType );
179 
180 protected:
183 
184  void PrintSelf( std::ostream & os, Indent indent ) const;
185 
186  itkGetObjectMacro( Transform, TransformType );
187 
188 private:
189 
190  CenteredTransformInitializer2( const Self & ); // purposely not implemented
191  void operator=( const Self & ); // purposely not implemented
192 
193  TransformPointer m_Transform;
194 
195  FixedImagePointer m_FixedImage;
196  MovingImagePointer m_MovingImage;
197  FixedImageMaskPointer m_FixedImageMask;
198  MovingImageMaskPointer m_MovingImageMask;
199 
202  bool m_UseTop;
203 
206 
207 };
208 
209 } // namespace itk
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 #include "itkCenteredTransformInitializer2.hxx"
213 #endif
214 
215 #endif /* __itkCenteredTransformInitializer2_h */
itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension)
FixedImageMaskType::ConstPointer FixedImageMaskPointer
CenteredTransformInitializer2 is a helper class intended to initialize the center of rotation and the...
MovingImageCalculatorType::Pointer MovingImageCalculatorPointer
MovingImageMaskType::ConstPointer MovingImageMaskPointer
void PrintSelf(std::ostream &os, Indent indent) const
TransformType::OutputVectorType OutputVectorType
FixedImageCalculatorType::Pointer FixedImageCalculatorPointer
ImageMomentsCalculator< FixedImageType > FixedImageCalculatorType
ImageMomentsCalculator< MovingImageType > MovingImageCalculatorType
Image< unsigned char, OutputSpaceDimension > MovingImageMaskType
Image< unsigned char, InputSpaceDimension > FixedImageMaskType


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