ITK  5.4.0
Insight Toolkit
itkBSplineTransformInitializer.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 itkBSplineTransformInitializer_h
19 #define itkBSplineTransformInitializer_h
20 
21 #include "itkObject.h"
22 #include "itkObjectFactory.h"
23 
24 namespace itk
25 {
40 template <typename TTransform, typename TImage>
41 class ITK_TEMPLATE_EXPORT BSplineTransformInitializer : public Object
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_MOVE(BSplineTransformInitializer);
45 
48  using Superclass = Object;
51 
53  itkNewMacro(Self);
54 
57 
59  using TransformType = TTransform;
60 
62  using ImageType = TImage;
64  using IndexType = typename ImageType::IndexType;
66  using ImagePointCoordRepType = typename ImagePointType::CoordRepType;
67 
71  using SizeType = typename RegionType::SizeType;
72  using SpacingType = typename TransformType::SpacingType;
73  using OriginType = typename TransformType::OriginType;
75  using PhysicalDimensionsType = typename TransformType::PhysicalDimensionsType;
76  using MeshSizeType = typename TransformType::MeshSizeType;
77  using SpacingComponentType = typename SpacingType::ComponentType;
78 
80  static constexpr unsigned int SpaceDimension = TransformType::SpaceDimension;
81 
83  itkGetConstObjectMacro(Transform, TransformType);
84  itkSetObjectMacro(Transform, TransformType);
88  itkGetConstObjectMacro(Image, ImageType);
89  itkSetConstObjectMacro(Image, ImageType);
95  itkGetConstMacro(TransformDomainMeshSize, MeshSizeType);
96  void
97  SetTransformDomainMeshSize(const MeshSizeType);
101  virtual void
102  InitializeTransform() const;
103 
104 protected:
105  BSplineTransformInitializer() = default;
106  ~BSplineTransformInitializer() override = default;
107 
108  void
109  PrintSelf(std::ostream & os, Indent indent) const override;
110 
111 private:
112  ImagePointer m_Image{};
113  TransformPointer m_Transform{};
114 
115  MeshSizeType m_TransformDomainMeshSize{ MeshSizeType::Filled(1) };
116  bool m_SetTransformDomainMeshSizeViaInitializer{ false };
117 
118 }; // class BSplineTransformInitializer
119 } // namespace itk
120 
121 #ifndef ITK_MANUAL_INSTANTIATION
122 # include "itkBSplineTransformInitializer.hxx"
123 #endif
124 
125 #endif /* itkBSplineTransformInitializer_h */
itk::BSplineTransformInitializer::TransformType
TTransform TransformType
Definition: itkBSplineTransformInitializer.h:59
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::BSplineTransformInitializer::IndexType
typename ImageType::IndexType IndexType
Definition: itkBSplineTransformInitializer.h:64
itk::BSplineTransformInitializer::ImageType
TImage ImageType
Definition: itkBSplineTransformInitializer.h:62
itkObjectFactory.h
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::BSplineTransformInitializer::RegionType
typename TransformType::RegionType RegionType
Definition: itkBSplineTransformInitializer.h:70
itk::BSplineTransformInitializer::SpacingType
typename TransformType::SpacingType SpacingType
Definition: itkBSplineTransformInitializer.h:72
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::BSplineTransformInitializer::ImagePointCoordRepType
typename ImagePointType::CoordRepType ImagePointCoordRepType
Definition: itkBSplineTransformInitializer.h:66
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::BSplineTransformInitializer::PhysicalDimensionsType
typename TransformType::PhysicalDimensionsType PhysicalDimensionsType
Definition: itkBSplineTransformInitializer.h:75
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::BSplineTransformInitializer::MeshSizeType
typename TransformType::MeshSizeType MeshSizeType
Definition: itkBSplineTransformInitializer.h:76
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::BSplineTransformInitializer
BSplineTransformInitializer is a helper class intended to initialize the control point grid such that...
Definition: itkBSplineTransformInitializer.h:41
itk::BSplineTransformInitializer::ImagePointType
typename ImageType::PointType ImagePointType
Definition: itkBSplineTransformInitializer.h:65
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::BSplineTransformInitializer::DirectionType
typename TransformType::DirectionType DirectionType
Definition: itkBSplineTransformInitializer.h:74
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkOverrideGetNameOfClassMacro
itkOverrideGetNameOfClassMacro(AddImageFilter)
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::BSplineTransformInitializer::SizeType
typename RegionType::SizeType SizeType
Definition: itkBSplineTransformInitializer.h:71
itk::BSplineTransformInitializer::OriginType
typename TransformType::OriginType OriginType
Definition: itkBSplineTransformInitializer.h:73
itkObject.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::BSplineTransformInitializer::SpacingComponentType
typename SpacingType::ComponentType SpacingComponentType
Definition: itkBSplineTransformInitializer.h:77
itk::BSplineTransformInitializer::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkBSplineTransformInitializer.h:69
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::BSplineTransformInitializer::ImagePointer
typename ImageType::ConstPointer ImagePointer
Definition: itkBSplineTransformInitializer.h:63
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83