ITK  6.0.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 
56  itkOverrideGetNameOfClassMacro(BSplineTransformInitializer);
57 
59  using TransformType = TTransform;
60 
62  using ImageType = TImage;
64  using IndexType = typename ImageType::IndexType;
66  using ImagePointCoordinateType = typename ImagePointType::CoordinateType;
67 #ifndef ITK_FUTURE_LEGACY_REMOVE
68  using ImagePointCoordRepType ITK_FUTURE_DEPRECATED(
69  "ITK 6 discourages using `ImagePointCoordRepType`. Please use `ImagePointCoordinateType` instead!") =
71 #endif
72 
76  using SizeType = typename RegionType::SizeType;
77  using SpacingType = typename TransformType::SpacingType;
78  using OriginType = typename TransformType::OriginType;
80  using PhysicalDimensionsType = typename TransformType::PhysicalDimensionsType;
81  using MeshSizeType = typename TransformType::MeshSizeType;
82  using SpacingComponentType = typename SpacingType::ComponentType;
83 
85  static constexpr unsigned int SpaceDimension = TransformType::SpaceDimension;
86 
88  itkGetConstObjectMacro(Transform, TransformType);
89  itkSetObjectMacro(Transform, TransformType);
93  itkGetConstObjectMacro(Image, ImageType);
94  itkSetConstObjectMacro(Image, ImageType);
100  itkGetConstMacro(TransformDomainMeshSize, MeshSizeType);
101  void
102  SetTransformDomainMeshSize(const MeshSizeType);
106  virtual void
107  InitializeTransform() const;
108 
109 protected:
110  BSplineTransformInitializer() = default;
111  ~BSplineTransformInitializer() override = default;
112 
113  void
114  PrintSelf(std::ostream & os, Indent indent) const override;
115 
116 private:
117  ImagePointer m_Image{};
118  TransformPointer m_Transform{};
119 
120  MeshSizeType m_TransformDomainMeshSize{ MeshSizeType::Filled(1) };
121  bool m_SetTransformDomainMeshSizeViaInitializer{ false };
122 
123 }; // class BSplineTransformInitializer
124 } // namespace itk
125 
126 #ifndef ITK_MANUAL_INSTANTIATION
127 # include "itkBSplineTransformInitializer.hxx"
128 #endif
129 
130 #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:75
itk::BSplineTransformInitializer::SpacingType
typename TransformType::SpacingType SpacingType
Definition: itkBSplineTransformInitializer.h:77
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::BSplineTransformInitializer::ImagePointCoordinateType
typename ImagePointType::CoordinateType ImagePointCoordinateType
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:80
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::BSplineTransformInitializer::MeshSizeType
typename TransformType::MeshSizeType MeshSizeType
Definition: itkBSplineTransformInitializer.h:81
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:79
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::BSplineTransformInitializer::SizeType
typename RegionType::SizeType SizeType
Definition: itkBSplineTransformInitializer.h:76
itk::BSplineTransformInitializer::OriginType
typename TransformType::OriginType OriginType
Definition: itkBSplineTransformInitializer.h:78
itkObject.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::BSplineTransformInitializer::SpacingComponentType
typename SpacingType::ComponentType SpacingComponentType
Definition: itkBSplineTransformInitializer.h:82
itk::BSplineTransformInitializer::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkBSplineTransformInitializer.h:74
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