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  * Copyright UMC Utrecht and contributors
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 __itkGridScheduleComputer_H__
19 #define __itkGridScheduleComputer_H__
20 
21 #include "itkObject.h"
22 #include "itkImageBase.h"
23 #include "itkTransform.h"
24 
25 namespace itk
26 {
27 
39 template< typename TTransformScalarType, unsigned int VImageDimension >
41  public Object
42 {
43 public:
44 
47  typedef Object Superclass;
49  typedef SmartPointer< const Self > ConstPointer;
50 
52  itkNewMacro( Self );
53 
55  itkTypeMacro( GridScheduleComputer, Object );
56 
58  itkStaticConstMacro( Dimension, unsigned int, VImageDimension );
59 
61  typedef TTransformScalarType TransformScalarType;
62  typedef ImageBase<
63  itkGetStaticConstMacro( Dimension ) > ImageBaseType;
64  typedef typename ImageBaseType::PointType PointType;
65  typedef typename ImageBaseType::PointType OriginType;
66  typedef typename ImageBaseType::SpacingType SpacingType;
67  typedef typename ImageBaseType::DirectionType DirectionType;
68  typedef typename ImageBaseType::SizeType SizeType;
69  typedef typename ImageBaseType::SizeValueType SizeValueType;
70  typedef typename ImageBaseType::RegionType RegionType;
71  typedef SpacingType GridSpacingFactorType;
72  typedef std::vector< OriginType > VectorOriginType;
73  typedef std::vector< SpacingType > VectorSpacingType;
74  typedef std::vector< DirectionType > VectorDirectionType;
75  typedef std::vector< RegionType > VectorRegionType;
76  typedef std::vector< GridSpacingFactorType > VectorGridSpacingFactorType;
77 
79  typedef Transform<
81  itkGetStaticConstMacro( Dimension ),
82  itkGetStaticConstMacro( Dimension ) > TransformType;
83  typedef typename TransformType::Pointer TransformPointer;
84  typedef typename TransformType::ConstPointer TransformConstPointer;
85 
87  itkSetMacro( ImageOrigin, OriginType );
88 
90  itkGetConstMacro( ImageOrigin, OriginType );
91 
93  itkSetMacro( ImageSpacing, SpacingType );
94 
96  itkGetConstMacro( ImageSpacing, SpacingType );
97 
99  itkSetMacro( ImageDirection, DirectionType );
100 
102  itkGetConstMacro( ImageDirection, DirectionType );
103 
105  itkSetMacro( ImageRegion, RegionType );
106 
108  itkGetConstMacro( ImageRegion, RegionType );
109 
111  itkSetClampMacro( BSplineOrder, unsigned int, 0, 5 );
112 
114  itkGetConstMacro( BSplineOrder, unsigned int );
115 
117  itkSetMacro( FinalGridSpacing, SpacingType );
118 
120  itkGetConstMacro( FinalGridSpacing, SpacingType );
121 
123  virtual void SetDefaultSchedule(
124  unsigned int levels,
125  double upsamplingFactor );
126 
128  virtual void SetSchedule(
129  const VectorGridSpacingFactorType & schedule );
130 
132  virtual void GetSchedule( VectorGridSpacingFactorType & schedule ) const;
133 
135  itkSetConstObjectMacro( InitialTransform, TransformType );
136 
138  virtual void ComputeBSplineGrid( void );
139 
141  virtual void GetBSplineGrid( unsigned int level,
142  RegionType & gridRegion,
143  SpacingType & gridSpacing,
144  OriginType & gridOrigin,
145  DirectionType & gridDirection );
146 
147 protected:
148 
151 
154 
156  VectorSpacingType m_GridSpacings;
157  VectorOriginType m_GridOrigins;
158  VectorDirectionType m_GridDirections;
159  VectorRegionType m_GridRegions;
160  TransformConstPointer m_InitialTransform;
161  VectorGridSpacingFactorType m_GridSpacingFactors;
162 
164  void PrintSelf( std::ostream & os, Indent indent ) const;
165 
167  itkGetConstMacro( NumberOfLevels, unsigned int );
168 
170  virtual void ApplyInitialTransform(
171  OriginType & imageOrigin,
172  SpacingType & imageSpacing,
173  DirectionType & imageDirection,
174  SpacingType & finalGridSpacing ) const;
175 
176 private:
177 
178  GridScheduleComputer( const Self & ); // purposely not implemented
179  void operator=( const Self & ); // purposely not implemented
180 
182  OriginType m_ImageOrigin;
183  SpacingType m_ImageSpacing;
184  RegionType m_ImageRegion;
185  DirectionType m_ImageDirection;
186  unsigned int m_BSplineOrder;
187  unsigned int m_NumberOfLevels;
188  SpacingType m_FinalGridSpacing;
189 
191  itkSetClampMacro( UpsamplingFactor, float, 1.0, NumericTraits< float >::max() );
192 
194  float m_UpsamplingFactor;
195 
196 };
197 
198 } // end namespace itk
199 
200 #ifndef ITK_MANUAL_INSTANTIATION
201 #include "itkGridScheduleComputer.hxx"
202 #endif
203 
204 #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 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo