ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkBSplineDeformableTransformInitializer.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkBSplineDeformableTransformInitializer_h
00019 #define __itkBSplineDeformableTransformInitializer_h
00020 
00021 #include "itkConfigure.h" //Needed to determine value of ITKV3_COMPATIBILITY
00022 #ifdef ITKV3_COMPATIBILITY
00023 
00024 #include "itkObject.h"
00025 #include "itkObjectFactory.h"
00026 
00027 #include <iostream>
00028 
00029 namespace itk
00030 {
00050 template< class TTransform, class TImage >
00051 class ITK_EXPORT BSplineDeformableTransformInitializer:public Object
00052 {
00053 public:
00055   typedef BSplineDeformableTransformInitializer Self;
00056   typedef Object                                Superclass;
00057   typedef SmartPointer< Self >                  Pointer;
00058   typedef SmartPointer< const Self >            ConstPointer;
00059 
00061   itkNewMacro(Self);
00062 
00064   itkTypeMacro(BSplineDeformableTransformInitializer, Object);
00065 
00067   typedef TTransform TransformType;
00068 
00070   typedef typename TransformType::Pointer        TransformPointer;
00071   typedef typename TransformType::RegionType     TransformRegionType;
00072   typedef typename TransformRegionType::SizeType TransformSizeType;
00073 
00075   itkStaticConstMacro(SpaceDimension, unsigned int,
00076                       TransformType::InputSpaceDimension);
00077 
00079   typedef   TImage                           ImageType;
00080   typedef   typename ImageType::ConstPointer ImagePointer;
00081 
00083   itkSetObjectMacro(Transform,   TransformType);
00084 
00086   itkSetConstObjectMacro(Image,  ImageType);
00087 
00091   itkSetMacro(GridSizeInsideTheImage,  TransformSizeType);
00092 
00099   void SetNumberOfGridNodesInsideTheImage(unsigned int numberOfNodes)
00100   {
00101     this->m_GridSizeInsideTheImage.Fill(numberOfNodes);
00102     this->Modified();
00103   }
00105 
00107   virtual void InitializeTransform() const;
00108 
00109 protected:
00110   BSplineDeformableTransformInitializer();
00111   ~BSplineDeformableTransformInitializer(){}
00112 
00113   void PrintSelf(std::ostream & os, Indent indent) const;
00114 
00115 private:
00116   BSplineDeformableTransformInitializer(const Self &); //purposely not
00117                                                        // implemented
00118   void operator=(const Self &);                        //purposely not
00119                                                        // implemented
00120 
00121   TransformPointer m_Transform;
00122 
00123   ImagePointer m_Image;
00124 
00125   TransformSizeType m_GridSizeInsideTheImage;
00126 
00127   unsigned int m_NumberOfGridNodesInsideTheImage;
00128 }; //class BSplineDeformableTransformInitializer
00129 }  // namespace itk
00130 
00131 #ifndef ITK_MANUAL_INSTANTIATION
00132 #include "itkBSplineDeformableTransformInitializer.hxx"
00133 #endif
00134 
00135 #else  // def ITKV3_COMPATIBILITY
00136 #error "itkBSplineDeformableTransformInitializer.h should only be included for ITKv3 compatibility. Build with ITKV3_COMPATIBILITY=ON to use this"
00137 #endif // def ITKV3_COMPATIBILITY
00138 
00139 #endif /* __itkBSplineDeformableTransformInitializer_h */
00140