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 #ifndef __itkGridScheduleComputer_H__
15 #define __itkGridScheduleComputer_H__
16 
17 #include "itkObject.h"
18 #include "itkImageBase.h"
19 #include "itkTransform.h"
20 
21 namespace itk
22 {
23 
35 template< typename TTransformScalarType, unsigned int VImageDimension >
37  public Object
38 {
39 public:
40 
43  typedef Object Superclass;
44  typedef SmartPointer< Self > Pointer;
45  typedef SmartPointer< const Self > ConstPointer;
46 
48  itkNewMacro( Self );
49 
51  itkTypeMacro( GridScheduleComputer, Object );
52 
54  itkStaticConstMacro( Dimension, unsigned int, VImageDimension );
55 
57  typedef TTransformScalarType TransformScalarType;
58  typedef ImageBase<
59  itkGetStaticConstMacro( Dimension ) > ImageBaseType;
60  typedef typename ImageBaseType::PointType PointType;
61  typedef typename ImageBaseType::PointType OriginType;
62  typedef typename ImageBaseType::SpacingType SpacingType;
63  typedef typename ImageBaseType::DirectionType DirectionType;
64  typedef typename ImageBaseType::SizeType SizeType;
65  typedef typename ImageBaseType::SizeValueType SizeValueType;
66  typedef typename ImageBaseType::RegionType RegionType;
68  typedef std::vector< OriginType > VectorOriginType;
69  typedef std::vector< SpacingType > VectorSpacingType;
70  typedef std::vector< DirectionType > VectorDirectionType;
71  typedef std::vector< RegionType > VectorRegionType;
72  typedef std::vector< GridSpacingFactorType > VectorGridSpacingFactorType;
73 
75  typedef Transform<
77  itkGetStaticConstMacro( Dimension ),
78  itkGetStaticConstMacro( Dimension ) > TransformType;
79  typedef typename TransformType::Pointer TransformPointer;
80  typedef typename TransformType::ConstPointer TransformConstPointer;
81 
83  itkSetMacro( ImageOrigin, OriginType );
84 
86  itkGetConstMacro( ImageOrigin, OriginType );
87 
89  itkSetMacro( ImageSpacing, SpacingType );
90 
92  itkGetConstMacro( ImageSpacing, SpacingType );
93 
95  itkSetMacro( ImageDirection, DirectionType );
96 
98  itkGetConstMacro( ImageDirection, DirectionType );
99 
101  itkSetMacro( ImageRegion, RegionType );
102 
104  itkGetConstMacro( ImageRegion, RegionType );
105 
107  itkSetClampMacro( BSplineOrder, unsigned int, 0, 5 );
108 
110  itkGetConstMacro( BSplineOrder, unsigned int );
111 
113  itkSetMacro( FinalGridSpacing, SpacingType );
114 
116  itkGetConstMacro( FinalGridSpacing, SpacingType );
117 
119  virtual void SetDefaultSchedule(
120  unsigned int levels,
121  double upsamplingFactor );
122 
124  virtual void SetSchedule(
125  const VectorGridSpacingFactorType & schedule );
126 
128  virtual void GetSchedule( VectorGridSpacingFactorType & schedule ) const;
129 
131  itkSetConstObjectMacro( InitialTransform, TransformType );
132 
134  virtual void ComputeBSplineGrid( void );
135 
137  virtual void GetBSplineGrid( unsigned int level,
138  RegionType & gridRegion,
139  SpacingType & gridSpacing,
140  OriginType & gridOrigin,
141  DirectionType & gridDirection );
142 
143 protected:
144 
147 
150 
158 
160  void PrintSelf( std::ostream & os, Indent indent ) const;
161 
163  itkGetConstMacro( NumberOfLevels, unsigned int );
164 
166  virtual void ApplyInitialTransform(
167  OriginType & imageOrigin,
168  SpacingType & imageSpacing,
169  DirectionType & imageDirection,
170  SpacingType & finalGridSpacing ) const;
171 
172 private:
173 
174  GridScheduleComputer( const Self & ); // purposely not implemented
175  void operator=( const Self & ); // purposely not implemented
176 
182  unsigned int m_BSplineOrder;
183  unsigned int m_NumberOfLevels;
185 
187  itkSetClampMacro( UpsamplingFactor, float, 1.0, NumericTraits< float >::max() );
188 
190  float m_UpsamplingFactor;
191 
192 };
193 
194 } // end namespace itk
195 
196 #ifndef ITK_MANUAL_INSTANTIATION
197 #include "itkGridScheduleComputer.hxx"
198 #endif
199 
200 #endif // end #ifndef __itkGridScheduleComputer_H__
itkStaticConstMacro(Dimension, unsigned int, VImageDimension)
std::vector< DirectionType > VectorDirectionType
void operator=(const Self &)
std::vector< GridSpacingFactorType > VectorGridSpacingFactorType
virtual void GetSchedule(VectorGridSpacingFactorType &schedule) const
ImageBaseType::PointType PointType
TransformType::ConstPointer TransformConstPointer
virtual void ApplyInitialTransform(OriginType &imageOrigin, SpacingType &imageSpacing, DirectionType &imageDirection, SpacingType &finalGridSpacing) const
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
virtual void ComputeBSplineGrid(void)
void PrintSelf(std::ostream &os, Indent indent) const
ImageBaseType::RegionType RegionType
std::vector< SpacingType > VectorSpacingType
ImageBaseType::PointType OriginType
virtual void SetSchedule(const VectorGridSpacingFactorType &schedule)
VectorDirectionType m_GridDirections
ImageBaseType::DirectionType DirectionType
virtual void SetDefaultSchedule(unsigned int levels, double upsamplingFactor)
ImageBaseType::SizeType SizeType
virtual void GetBSplineGrid(unsigned int level, RegionType &gridRegion, SpacingType &gridSpacing, OriginType &gridOrigin, DirectionType &gridDirection)
VectorGridSpacingFactorType m_GridSpacingFactors
std::vector< OriginType > VectorOriginType


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo