go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkGridScheduleComputer.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __itkGridScheduleComputer_H__
16 #define __itkGridScheduleComputer_H__
17 
18 #include "itkObject.h"
19 #include "itkImageBase.h"
20 #include "itkTransform.h"
21 
22 namespace itk
23 {
24 
37 template < typename TTransformScalarType, unsigned int VImageDimension >
38 class ITK_EXPORT GridScheduleComputer
39  : public Object
40 {
41 public:
42 
45  typedef Object Superclass;
46  typedef SmartPointer< Self > Pointer;
47  typedef SmartPointer< const Self > ConstPointer;
48 
50  itkNewMacro( Self );
51 
53  itkTypeMacro( GridScheduleComputer, Object );
54 
56  itkStaticConstMacro( Dimension, unsigned int, VImageDimension );
57 
59  typedef TTransformScalarType TransformScalarType;
60  typedef ImageBase<
61  itkGetStaticConstMacro( Dimension ) > ImageBaseType;
62  typedef typename ImageBaseType::PointType PointType;
63  typedef typename ImageBaseType::PointType OriginType;
64  typedef typename ImageBaseType::SpacingType SpacingType;
65  typedef typename ImageBaseType::DirectionType DirectionType;
66  typedef typename ImageBaseType::SizeType SizeType;
67  typedef typename ImageBaseType::SizeValueType SizeValueType;
68  typedef typename ImageBaseType::RegionType RegionType;
70  typedef std::vector< OriginType > VectorOriginType;
71  typedef std::vector< SpacingType > VectorSpacingType;
72  typedef std::vector< DirectionType > VectorDirectionType;
73  typedef std::vector< RegionType > VectorRegionType;
74  typedef std::vector< GridSpacingFactorType > VectorGridSpacingFactorType;
75 
77  typedef Transform<
79  itkGetStaticConstMacro( Dimension ),
80  itkGetStaticConstMacro( Dimension ) > TransformType;
81  typedef typename TransformType::Pointer TransformPointer;
82  typedef typename TransformType::ConstPointer TransformConstPointer;
83 
85  itkSetMacro( ImageOrigin, OriginType );
86 
88  itkGetConstMacro( ImageOrigin, OriginType );
89 
91  itkSetMacro( ImageSpacing, SpacingType );
92 
94  itkGetConstMacro( ImageSpacing, SpacingType );
95 
97  itkSetMacro( ImageDirection, DirectionType );
98 
100  itkGetConstMacro( ImageDirection, DirectionType );
101 
103  itkSetMacro( ImageRegion, RegionType );
104 
106  itkGetConstMacro( ImageRegion, RegionType );
107 
109  itkSetClampMacro( BSplineOrder, unsigned int, 0, 5 );
110 
112  itkGetConstMacro( BSplineOrder, unsigned int );
113 
115  itkSetMacro( FinalGridSpacing, SpacingType );
116 
118  itkGetConstMacro( FinalGridSpacing, SpacingType );
119 
121  virtual void SetDefaultSchedule(
122  unsigned int levels,
123  double upsamplingFactor );
124 
126  virtual void SetSchedule(
127  const VectorGridSpacingFactorType & schedule );
128 
130  virtual void GetSchedule( VectorGridSpacingFactorType & schedule ) const;
131 
133  itkSetConstObjectMacro( InitialTransform, TransformType );
134 
136  virtual void ComputeBSplineGrid( void );
137 
139  virtual void GetBSplineGrid( unsigned int level,
140  RegionType & gridRegion,
141  SpacingType & gridSpacing,
142  OriginType & gridOrigin,
143  DirectionType & gridDirection );
144 
145 protected:
146 
149 
151  virtual ~GridScheduleComputer() {};
152 
154  VectorSpacingType m_GridSpacings;
160 
162  void PrintSelf( std::ostream& os, Indent indent ) const;
163 
165  itkGetConstMacro( NumberOfLevels, unsigned int );
166 
168  virtual void ApplyInitialTransform(
169  OriginType & imageOrigin,
170  SpacingType & imageSpacing,
171  DirectionType & imageDirection,
172  SpacingType & finalGridSpacing ) const;
173 
174 private:
175 
176  GridScheduleComputer( const Self& ); // purposely not implemented
177  void operator=( const Self& ); // purposely not implemented
178 
184  unsigned int m_BSplineOrder;
185  unsigned int m_NumberOfLevels;
187 
189  itkSetClampMacro( UpsamplingFactor, float, 1.0, NumericTraits<float>::max() );
190 
192  float m_UpsamplingFactor;
193 
194 }; // end class GridScheduleComputer
195 
196 } // end namespace itk
197 
198 #ifndef ITK_MANUAL_INSTANTIATION
199 #include "itkGridScheduleComputer.txx"
200 #endif
201 
202 #endif // end #ifndef __itkGridScheduleComputer_H__
203 
std::vector< DirectionType > VectorDirectionType
std::vector< GridSpacingFactorType > VectorGridSpacingFactorType
ImageBaseType::PointType PointType
TransformType::ConstPointer TransformConstPointer
std::vector< RegionType > VectorRegionType
This class computes all information about the B-spline grid, given the image information and the desi...
TransformConstPointer m_InitialTransform
ImageBaseType::SpacingType SpacingType
TransformType::Pointer TransformPointer
Transform< TransformScalarType, itkGetStaticConstMacro(Dimension), itkGetStaticConstMacro(Dimension) > TransformType
TTransformScalarType TransformScalarType
ImageBaseType::SizeValueType SizeValueType
int max(int a, int b)
ImageBase< itkGetStaticConstMacro(Dimension) > ImageBaseType
SmartPointer< const Self > ConstPointer
ImageBaseType::RegionType RegionType
std::vector< SpacingType > VectorSpacingType
ImageBaseType::PointType OriginType
VectorDirectionType m_GridDirections
ImageBaseType::DirectionType DirectionType
ImageBaseType::SizeType SizeType
VectorGridSpacingFactorType m_GridSpacingFactors
std::vector< OriginType > VectorOriginType


Generated on 05-12-2013 for elastix by doxygen 1.8.5 elastix logo