ITK  4.9.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 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  BSplineDeformableTransformInitializer(const Self &) ITK_DELETE_FUNCTION;
117  void operator=(const Self &) ITK_DELETE_FUNCTION;
118 
119  TransformPointer m_Transform;
120 
121  ImagePointer m_Image;
122 
123  TransformSizeType m_GridSizeInsideTheImage;
124 
125  unsigned int m_NumberOfGridNodesInsideTheImage;
126 }; //class BSplineDeformableTransformInitializer
127 } // namespace itk
128 
129 #ifndef ITK_MANUAL_INSTANTIATION
130 #include "itkBSplineDeformableTransformInitializer.hxx"
131 #endif
132 
133 #else // def ITKV3_COMPATIBILITY
134 #error "itkBSplineDeformableTransformInitializer.h should only be included for ITKv3 compatibility. Build with ITKV3_COMPATIBILITY=ON to use this"
135 #endif // def ITKV3_COMPATIBILITY
136 
137 #endif /* itkBSplineDeformableTransformInitializer_h */