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, class TFixedImage, class TMovingImage >
92 class CenteredTransformInitializer2 : public Object
93 {
94 public:
95 
98  typedef Object Superclass;
100  typedef SmartPointer< const Self > ConstPointer;
101 
103  itkNewMacro( Self );
104 
106  itkTypeMacro( CenteredTransformInitializer2, Object );
107 
109  typedef TTransform TransformType;
110  typedef typename TransformType::Pointer TransformPointer;
111 
113  itkStaticConstMacro( InputSpaceDimension, unsigned int,
114  TransformType::InputSpaceDimension );
115  itkStaticConstMacro( OutputSpaceDimension, unsigned int,
116  TransformType::OutputSpaceDimension );
117 
119  typedef TFixedImage FixedImageType;
120  typedef TMovingImage MovingImageType;
121 
122  typedef typename FixedImageType::ConstPointer FixedImagePointer;
123  typedef typename MovingImageType::ConstPointer MovingImagePointer;
124 
127  typedef typename FixedImageMaskType::ConstPointer FixedImageMaskPointer;
128  typedef typename MovingImageMaskType::ConstPointer MovingImageMaskPointer;
129 
131  typedef ImageMomentsCalculator< FixedImageType >
133  typedef ImageMomentsCalculator< MovingImageType >
135 
136  typedef typename FixedImageCalculatorType::Pointer
138  typedef typename MovingImageCalculatorType::Pointer
140 
142  typedef typename TransformType::OffsetType OffsetType;
143 
145  typedef typename TransformType::InputPointType InputPointType;
146 
148  typedef typename TransformType::OutputVectorType OutputVectorType;
149 
151  itkSetObjectMacro( Transform, TransformType );
152 
154  itkSetConstObjectMacro( FixedImage, FixedImageType );
155 
157  itkSetConstObjectMacro( MovingImage, MovingImageType );
158 
160  itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
161  itkSetConstObjectMacro( MovingImageMask, MovingImageMaskType );
162 
164  virtual void InitializeTransform();
165 
168  void GeometryOn() { m_UseMoments = false; m_UseOrigins = false; m_UseTop = false; }
169  void MomentsOn() { m_UseMoments = true; m_UseOrigins = false; m_UseTop = false; }
170  void OriginsOn() { m_UseMoments = false; m_UseOrigins = true; m_UseTop = false; }
171  void GeometryTopOn() { m_UseMoments = false; m_UseOrigins = false; m_UseTop = true; }
172 
174  itkGetConstObjectMacro( FixedCalculator, FixedImageCalculatorType );
175  itkGetConstObjectMacro( MovingCalculator, MovingImageCalculatorType );
176 
177 protected:
178 
181 
182  void PrintSelf( std::ostream & os, Indent indent ) const;
183 
184  itkGetObjectMacro( Transform, TransformType );
185 
186 private:
187 
188  CenteredTransformInitializer2( const Self & ); // purposely not implemented
189  void operator=( const Self & ); // purposely not implemented
190 
191  TransformPointer m_Transform;
192 
193  FixedImagePointer m_FixedImage;
194  MovingImagePointer m_MovingImage;
195  FixedImageMaskPointer m_FixedImageMask;
196  MovingImageMaskPointer m_MovingImageMask;
197 
200  bool m_UseTop;
201 
204 
205 };
206 
207 } // namespace itk
208 
209 #ifndef ITK_MANUAL_INSTANTIATION
210 #include "itkCenteredTransformInitializer2.hxx"
211 #endif
212 
213 #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 OURCE_DATE_EPOCH for elastix by doxygen 1.8.13 elastix logo