ITK  4.3.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< class TTransform, class TImage >
51 class ITK_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;
114 
115 private:
116  BSplineDeformableTransformInitializer(const Self &); //purposely not
117  // implemented
118  void operator=(const Self &); //purposely not
119  // implemented
120 
121  TransformPointer m_Transform;
122 
123  ImagePointer m_Image;
124 
125  TransformSizeType m_GridSizeInsideTheImage;
126 
127  unsigned int m_NumberOfGridNodesInsideTheImage;
128 }; //class BSplineDeformableTransformInitializer
129 } // namespace itk
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 #include "itkBSplineDeformableTransformInitializer.hxx"
133 #endif
134 
135 #else // def ITKV3_COMPATIBILITY
136 #error "itkBSplineDeformableTransformInitializer.h should only be included for ITKv3 compatibility. Build with ITKV3_COMPATIBILITY=ON to use this"
137 #endif // def ITKV3_COMPATIBILITY
138 
139 #endif /* __itkBSplineDeformableTransformInitializer_h */
140