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 
36 template < typename TTransformScalarType, unsigned int VImageDimension >
37 class ITK_EXPORT GridScheduleComputer
38  : public Object
39 {
40 public:
41 
44  typedef Object Superclass;
45  typedef SmartPointer< Self > Pointer;
46  typedef SmartPointer< const Self > ConstPointer;
47 
49  itkNewMacro( Self );
50 
52  itkTypeMacro( GridScheduleComputer, Object );
53 
55  itkStaticConstMacro( Dimension, unsigned int, VImageDimension );
56 
58  typedef TTransformScalarType TransformScalarType;
59  typedef ImageBase<
60  itkGetStaticConstMacro( Dimension ) > ImageBaseType;
61  typedef typename ImageBaseType::PointType PointType;
62  typedef typename ImageBaseType::PointType OriginType;
63  typedef typename ImageBaseType::SpacingType SpacingType;
64  typedef typename ImageBaseType::DirectionType DirectionType;
65  typedef typename ImageBaseType::SizeType SizeType;
66  typedef typename ImageBaseType::SizeValueType SizeValueType;
67  typedef typename ImageBaseType::RegionType RegionType;
69  typedef std::vector< OriginType > VectorOriginType;
70  typedef std::vector< SpacingType > VectorSpacingType;
71  typedef std::vector< DirectionType > VectorDirectionType;
72  typedef std::vector< RegionType > VectorRegionType;
73  typedef std::vector< GridSpacingFactorType > VectorGridSpacingFactorType;
74 
76  typedef Transform<
78  itkGetStaticConstMacro( Dimension ),
79  itkGetStaticConstMacro( Dimension ) > TransformType;
80  typedef typename TransformType::Pointer TransformPointer;
81  typedef typename TransformType::ConstPointer TransformConstPointer;
82 
84  itkSetMacro( ImageOrigin, OriginType );
85 
87  itkGetConstMacro( ImageOrigin, OriginType );
88 
90  itkSetMacro( ImageSpacing, SpacingType );
91 
93  itkGetConstMacro( ImageSpacing, SpacingType );
94 
96  itkSetMacro( ImageDirection, DirectionType );
97 
99  itkGetConstMacro( ImageDirection, DirectionType );
100 
102  itkSetMacro( ImageRegion, RegionType );
103 
105  itkGetConstMacro( ImageRegion, RegionType );
106 
108  itkSetClampMacro( BSplineOrder, unsigned int, 0, 5 );
109 
111  itkGetConstMacro( BSplineOrder, unsigned int );
112 
114  itkSetMacro( FinalGridSpacing, SpacingType );
115 
117  itkGetConstMacro( FinalGridSpacing, SpacingType );
118 
120  virtual void SetDefaultSchedule(
121  unsigned int levels,
122  double upsamplingFactor );
123 
125  virtual void SetSchedule(
126  const VectorGridSpacingFactorType & schedule );
127 
129  virtual void GetSchedule( VectorGridSpacingFactorType & schedule ) const;
130 
132  itkSetConstObjectMacro( InitialTransform, TransformType );
133 
135  virtual void ComputeBSplineGrid( void );
136 
138  virtual void GetBSplineGrid( unsigned int level,
139  RegionType & gridRegion,
140  SpacingType & gridSpacing,
141  OriginType & gridOrigin,
142  DirectionType & gridDirection );
143 
144 protected:
145 
148 
150  virtual ~GridScheduleComputer() {};
151 
153  VectorSpacingType m_GridSpacings;
159 
161  void PrintSelf( std::ostream& os, Indent indent ) const;
162 
164  itkGetConstMacro( NumberOfLevels, unsigned int );
165 
167  virtual void ApplyInitialTransform(
168  OriginType & imageOrigin,
169  SpacingType & imageSpacing,
170  DirectionType & imageDirection,
171  SpacingType & finalGridSpacing ) const;
172 
173 private:
174 
175  GridScheduleComputer( const Self& ); // purposely not implemented
176  void operator=( const Self& ); // purposely not implemented
177 
183  unsigned int m_BSplineOrder;
184  unsigned int m_NumberOfLevels;
186 
188  itkSetClampMacro( UpsamplingFactor, float, 1.0, NumericTraits<float>::max() );
189 
191  float m_UpsamplingFactor;
192 
193 }; // end class GridScheduleComputer
194 
195 } // end namespace itk
196 
197 #ifndef ITK_MANUAL_INSTANTIATION
198 #include "itkGridScheduleComputer.txx"
199 #endif
200 
201 #endif // end #ifndef __itkGridScheduleComputer_H__
202 
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-01-2014 for elastix by doxygen 1.8.5 elastix logo