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 Date: $Date: 2010-07-04 10:30:49 $
23 Version: $Revision: 1.11 $
24
25 Copyright (c) Insight Software Consortium. All rights reserved.
26 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
27
28 This software is distributed WITHOUT ANY WARRANTY; without even
29 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30 PURPOSE. See the above copyright notices for more information.
31
32=========================================================================*/
33#ifndef itkCenteredTransformInitializer2_h
34#define itkCenteredTransformInitializer2_h
35
36#include "itkObject.h"
37#include "itkObjectFactory.h"
38#include "itkImageMaskSpatialObject.h"
40
41#include <iostream>
42
43namespace itk
44{
45
90template <class TTransform, class TFixedImage, class TMovingImage>
91class ITK_TEMPLATE_EXPORT CenteredTransformInitializer2 : public Object
92{
93public:
95
98 using Superclass = Object;
99 using Pointer = SmartPointer<Self>;
100 using ConstPointer = SmartPointer<const Self>;
101
103 itkNewMacro(Self);
104
106 itkTypeMacro(CenteredTransformInitializer2, Object);
107
109 using TransformType = TTransform;
110 using TransformPointer = typename TransformType::Pointer;
111
113 itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension);
114 itkStaticConstMacro(OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension);
115
117 using FixedImageType = TFixedImage;
118 using MovingImageType = TMovingImage;
119
120 using FixedImagePointer = typename FixedImageType::ConstPointer;
121 using MovingImagePointer = typename MovingImageType::ConstPointer;
122
125 using FixedImageMaskPointer = typename FixedImageMaskType::ConstPointer;
126 using MovingImageMaskPointer = typename MovingImageMaskType::ConstPointer;
127 using FixedImageMaskConstPointer = typename FixedImageMaskType::ConstPointer;
128 using MovingImageMaskConstPointer = typename MovingImageMaskType::ConstPointer;
129
133
136
138 using OffsetType = typename TransformType::OffsetType;
139
141 using InputPointType = typename TransformType::InputPointType;
142
144 using OutputVectorType = typename TransformType::OutputVectorType;
145
146 using InputPixelType = typename FixedImageType::PixelType;
147
149 itkSetObjectMacro(Transform, TransformType);
150
152 itkSetConstObjectMacro(FixedImage, FixedImageType);
153
155 itkSetConstObjectMacro(MovingImage, MovingImageType);
156
158 itkSetConstObjectMacro(FixedImageMask, FixedImageMaskType);
159 itkSetConstObjectMacro(MovingImageMask, MovingImageMaskType);
160
162 itkSetMacro(NumberOfSamplesForCenteredTransformInitialization, SizeValueType);
163 itkSetMacro(LowerThresholdForCenterGravity, InputPixelType);
164 itkSetMacro(CenterOfGravityUsesLowerThreshold, bool);
165
167 virtual void
169
172 void
174 {
175 m_UseMoments = false;
176 m_UseOrigins = false;
177 m_UseTop = false;
178 }
179 void
181 {
182 m_UseMoments = true;
183 m_UseOrigins = false;
184 m_UseTop = false;
185 }
186 void
188 {
189 m_UseMoments = false;
190 m_UseOrigins = true;
191 m_UseTop = false;
192 }
193 void
195 {
196 m_UseMoments = false;
197 m_UseOrigins = false;
198 m_UseTop = true;
199 }
200
202 itkGetConstObjectMacro(FixedCalculator, FixedImageCalculatorType);
203 itkGetConstObjectMacro(MovingCalculator, MovingImageCalculatorType);
204
205protected:
207 ~CenteredTransformInitializer2() override = default;
208
209 void
210 PrintSelf(std::ostream & os, Indent indent) const override;
211
213
215 SizeValueType m_NumberOfSamplesForCenteredTransformInitialization{};
216 InputPixelType m_LowerThresholdForCenterGravity{};
217 bool m_CenterOfGravityUsesLowerThreshold{};
218
219private:
220 TransformPointer m_Transform{};
221
222 FixedImagePointer m_FixedImage{};
223 MovingImagePointer m_MovingImage{};
224 FixedImageMaskPointer m_FixedImageMask{};
225 MovingImageMaskPointer m_MovingImageMask{};
226
227 bool m_UseMoments{};
228 bool m_UseOrigins{};
229 bool m_UseTop{};
230
231 FixedImageCalculatorPointer m_FixedCalculator{};
232 MovingImageCalculatorPointer m_MovingCalculator{};
233};
234
235} // namespace itk
236
237#ifndef ITK_MANUAL_INSTANTIATION
238# include "itkCenteredTransformInitializer2.hxx"
239#endif
240
241#endif /* itkCenteredTransformInitializer2_h */
Compute moments of an n-dimensional image.
CenteredTransformInitializer2 is a helper class intended to initialize the center of rotation and the...
itkGetModifiableObjectMacro(Transform, TransformType)
typename TransformType::OffsetType OffsetType
typename FixedImageType::PixelType InputPixelType
void PrintSelf(std::ostream &os, Indent indent) const override
typename TransformType::InputPointType InputPointType
itkStaticConstMacro(InputSpaceDimension, unsigned int, TransformType::InputSpaceDimension)
typename MovingImageMaskType::ConstPointer MovingImageMaskConstPointer
typename TransformType::OutputVectorType OutputVectorType
typename MovingImageMaskType::ConstPointer MovingImageMaskPointer
typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
typename MovingImageType::ConstPointer MovingImagePointer
typename FixedImageType::ConstPointer FixedImagePointer
typename FixedImageCalculatorType::Pointer FixedImageCalculatorPointer
ITK_DISALLOW_COPY_AND_MOVE(CenteredTransformInitializer2)
typename FixedImageMaskType::ConstPointer FixedImageMaskPointer
~CenteredTransformInitializer2() override=default
typename MovingImageCalculatorType::Pointer MovingImageCalculatorPointer
itkStaticConstMacro(OutputSpaceDimension, unsigned int, TransformType::OutputSpaceDimension)


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo