ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkBSplineDeformableTransformInitializer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 #ifndef itkBSplineDeformableTransformInitializer_h
19 #define itkBSplineDeformableTransformInitializer_h
20 
21 #include "itkConfigure.h" //Needed to determine value of ITKV3_COMPATIBILITY
22 #ifdef ITKV3_COMPATIBILITY
23 
24 #include "itkObject.h"
25 #include "itkObjectFactory.h"
26 
27 #include <iostream>
28 
29 namespace itk
30 {
50 template< typename TTransform, typename TImage >
51 class ITK_TEMPLATE_EXPORT BSplineDeformableTransformInitializer:public Object
52 {
53 public:
55  typedef BSplineDeformableTransformInitializer Self;
56  typedef Object Superclass;
57  typedef SmartPointer< Self > Pointer;
58  typedef SmartPointer< const Self > ConstPointer;
59 
61  itkNewMacro(Self);
62 
64  itkTypeMacro(BSplineDeformableTransformInitializer, Object);
65 
67  typedef TTransform TransformType;
68 
70  typedef typename TransformType::Pointer TransformPointer;
71  typedef typename TransformType::RegionType TransformRegionType;
72  typedef typename TransformRegionType::SizeType TransformSizeType;
73 
75  itkStaticConstMacro(SpaceDimension, unsigned int,
76  TransformType::InputSpaceDimension);
77 
79  typedef TImage ImageType;
80  typedef typename ImageType::ConstPointer ImagePointer;
81 
83  itkSetObjectMacro(Transform, TransformType);
84 
86  itkSetConstObjectMacro(Image, ImageType);
87 
91  itkSetMacro(GridSizeInsideTheImage, TransformSizeType);
92 
99  void SetNumberOfGridNodesInsideTheImage(unsigned int numberOfNodes)
100  {
101  this->m_GridSizeInsideTheImage.Fill(numberOfNodes);
102  this->Modified();
103  }
105 
107  virtual void InitializeTransform() const;
108 
109 protected:
110  BSplineDeformableTransformInitializer();
111  ~BSplineDeformableTransformInitializer(){}
112 
113  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
114 
115 private:
116  ITK_DISALLOW_COPY_AND_ASSIGN(BSplineDeformableTransformInitializer);
117 
118  TransformPointer m_Transform;
119 
120  ImagePointer m_Image;
121 
122  TransformSizeType m_GridSizeInsideTheImage;
123 
124  unsigned int m_NumberOfGridNodesInsideTheImage;
125 }; //class BSplineDeformableTransformInitializer
126 } // namespace itk
127 
128 #ifndef ITK_MANUAL_INSTANTIATION
129 #include "itkBSplineDeformableTransformInitializer.hxx"
130 #endif
131 
132 #else // def ITKV3_COMPATIBILITY
133 #error "itkBSplineDeformableTransformInitializer.h should only be included for ITKv3 compatibility. Build with ITKV3_COMPATIBILITY=ON to use this"
134 #endif // def ITKV3_COMPATIBILITY
135 
136 #endif /* itkBSplineDeformableTransformInitializer_h */