ITK  6.0.0
Insight Toolkit
itkCenteredTransformInitializer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 #ifndef itkCenteredTransformInitializer_h
19 #define itkCenteredTransformInitializer_h
20 
21 #include "itkObject.h"
22 #include "itkObjectFactory.h"
24 
25 #include <iostream>
26 
27 namespace itk
28 {
60 template <typename TTransform, typename TFixedImage, typename TMovingImage>
61 class ITK_TEMPLATE_EXPORT CenteredTransformInitializer : public Object
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_MOVE(CenteredTransformInitializer);
65 
68  using Superclass = Object;
71 
73  itkNewMacro(Self);
74 
76  itkOverrideGetNameOfClassMacro(CenteredTransformInitializer);
77 
79  using TransformType = TTransform;
81 
83  static constexpr unsigned int InputSpaceDimension = TransformType::InputSpaceDimension;
84  static constexpr unsigned int OutputSpaceDimension = TransformType::OutputSpaceDimension;
85 
87  using FixedImageType = TFixedImage;
88  using MovingImageType = TMovingImage;
89 
92 
96 
99 
102 
105 
108 
110  itkSetObjectMacro(Transform, TransformType);
111 
113  itkSetConstObjectMacro(FixedImage, FixedImageType);
114 
116  itkSetConstObjectMacro(MovingImage, MovingImageType);
117 
119  virtual void
120  InitializeTransform();
121 
124  void
126  {
127  m_UseMoments = false;
128  }
129  void
131  {
132  m_UseMoments = true;
133  }
137  itkGetModifiableObjectMacro(FixedCalculator, FixedImageCalculatorType);
138  itkGetModifiableObjectMacro(MovingCalculator, MovingImageCalculatorType);
141 protected:
142  CenteredTransformInitializer() = default;
143  ~CenteredTransformInitializer() override = default;
144 
145  void
146  PrintSelf(std::ostream & os, Indent indent) const override;
147 
148  itkGetModifiableObjectMacro(Transform, TransformType);
149 
150 private:
151  TransformPointer m_Transform{};
152 
153  FixedImagePointer m_FixedImage{};
154 
155  MovingImagePointer m_MovingImage{};
156 
157  bool m_UseMoments{ false };
158 
161 }; // class CenteredTransformInitializer
162 } // namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 # include "itkCenteredTransformInitializer.hxx"
166 #endif
167 
168 #endif /* itkCenteredTransformInitializer_h */
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itkObjectFactory.h
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::MovingImageType
TMovingImage MovingImageType
Definition: itkCenteredTransformInitializer.h:88
itk::VersorRigid3DTransform
VersorRigid3DTransform of a vector space (e.g. space coordinates)
Definition: itkVersorRigid3DTransform.h:46
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::InputPointType
typename TransformType::InputPointType InputPointType
Definition: itkCenteredTransformInitializer.h:104
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::OffsetType
typename TransformType::OffsetType OffsetType
Definition: itkCenteredTransformInitializer.h:101
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::OutputVectorType
typename TransformType::OutputVectorType OutputVectorType
Definition: itkCenteredTransformInitializer.h:107
itkImageMomentsCalculator.h
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkCenteredTransformInitializer.h:80
itk::CenteredTransformInitializer::GeometryOn
void GeometryOn()
Definition: itkCenteredTransformInitializer.h:125
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::FixedImageType
TFixedImage FixedImageType
Definition: itkCenteredTransformInitializer.h:87
itkObject.h
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::FixedImageCalculatorPointer
typename FixedImageCalculatorType::Pointer FixedImageCalculatorPointer
Definition: itkCenteredTransformInitializer.h:97
itk::CenteredTransformInitializer::MomentsOn
void MomentsOn()
Definition: itkCenteredTransformInitializer.h:130
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::FixedImagePointer
typename FixedImageType::ConstPointer FixedImagePointer
Definition: itkCenteredTransformInitializer.h:90
itk::ImageMomentsCalculator
Compute moments of an n-dimensional image.
Definition: itkImageMomentsCalculator.h:60
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::MovingImagePointer
typename MovingImageType::ConstPointer MovingImagePointer
Definition: itkCenteredTransformInitializer.h:91
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
New
static Pointer New()
itk::CenteredTransformInitializer< VersorRigid3DTransform< double >, TFixedImage, TMovingImage >::MovingImageCalculatorPointer
typename MovingImageCalculatorType::Pointer MovingImageCalculatorPointer
Definition: itkCenteredTransformInitializer.h:98
itk::CenteredTransformInitializer
CenteredTransformInitializer is a helper class intended to initialize the center of rotation and the ...
Definition: itkCenteredTransformInitializer.h:61