go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxTransformBase.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 __elxTransformBase_h
19 #define __elxTransformBase_h
20 
22 #include "elxMacro.h"
23 
24 #include "elxBaseComponentSE.h"
25 #include "itkAdvancedTransform.h"
27 #include "elxComponentDatabase.h"
28 #include "elxProgressCommand.h"
29 
30 #include <fstream>
31 #include <iomanip>
32 
33 namespace elastix
34 {
35 //using namespace itk; //Not here, because a TransformBase class was added to ITK...
36 
130 template< class TElastix >
132  public BaseComponentSE< TElastix >
133 {
134 public:
135 
139 
141  itkTypeMacro( TransformBase, BaseComponentSE );
142 
144  typedef typename Superclass::ElastixType ElastixType;
148  typedef typename ConfigurationType
149  ::CommandLineArgumentMapType CommandLineArgumentMapType;
150  typedef typename ConfigurationType
151  ::CommandLineEntryType CommandLineEntryType;
154 
156  typedef typename ElastixType::CoordRepType CoordRepType;
157  typedef typename ElastixType::FixedImageType FixedImageType;
158  typedef typename ElastixType::MovingImageType MovingImageType;
159 
164 
167 
169  itkStaticConstMacro( FixedImageDimension,
170  unsigned int, FixedImageType::ImageDimension );
171 
173  itkStaticConstMacro( MovingImageDimension,
174  unsigned int, MovingImageType::ImageDimension );
175 
177  typedef itk::Object ObjectType;
178  typedef itk::AdvancedTransform<
179  CoordRepType,
180  itkGetStaticConstMacro( FixedImageDimension ),
181  itkGetStaticConstMacro( MovingImageDimension ) > ITKBaseType;
183  itkGetStaticConstMacro( FixedImageDimension ) > CombinationTransformType;
184  typedef typename
186 
189  typedef typename ParametersType::ValueType ValueType;
190 
194 
196  typedef itk::Vector<
197  float, FixedImageDimension > VectorPixelType;
198  typedef itk::Image<
200 
202  typedef typename RegistrationType::ITKBaseType ITKRegistrationType;
203  typedef typename ITKRegistrationType::OptimizerType OptimizerType;
204  typedef typename OptimizerType::ScalesType ScalesType;
205 
207  typedef typename ElastixType::ParameterMapType ParameterMapType;
208 
210  virtual ITKBaseType * GetAsITKBaseType( void )
211  {
212  return dynamic_cast< ITKBaseType * >( this );
213  }
214 
215 
217  virtual const ITKBaseType * GetAsITKBaseType( void ) const
218  {
219  return dynamic_cast< const ITKBaseType * >( this );
220  }
221 
222 
224  {
225  return dynamic_cast< const CombinationTransformType * >( this );
226  }
227 
228 
230  {
231  return dynamic_cast< CombinationTransformType * >( this );
232  }
233 
234 
238  virtual int BeforeAllBase( void );
239 
243  virtual int BeforeAllTransformix( void );
244 
248  virtual void BeforeRegistrationBase( void );
249 
253  virtual void AfterRegistrationBase( void );
254 
256  virtual const InitialTransformType * GetInitialTransform( void ) const;
257 
259  virtual void SetInitialTransform( InitialTransformType * _arg );
260 
262  virtual void SetTransformParametersFileName( const char * filename );
263 
265  itkGetStringMacro( TransformParametersFileName );
266 
268  virtual void ReadFromFile( void );
269 
271  virtual void CreateTransformParametersMap(
272  const ParametersType & param, ParameterMapType * paramsMap ) const;
273 
275  virtual void WriteToFile( const ParametersType & param ) const;
276 
278  virtual void WriteToFile( void ) const;
279 
281  virtual void SetReadWriteTransformParameters( const bool _arg );
282 
284  virtual void ReadInitialTransformFromFile(
285  const char * transformParameterFileName );
286 
290  virtual void ReadInitialTransformFromVector( const size_t index );
291 
293  virtual void TransformPoints( void ) const;
294 
296  virtual void TransformPointsSomePoints( const std::string filename ) const;
297 
299  virtual void TransformPointsSomePointsVTK( const std::string filename ) const;
300 
308 
313 
316 
319 
324 
329 
331 
339 
348 
359 
361 
364 
This class combines two transforms: an &#39;initial transform&#39; with a &#39;current transform&#39;.
The BaseComponentSE class is a base class for elastix components that provides some basic functionali...
virtual void CreateTransformParametersMap(const ParametersType &param, ParameterMapType *paramsMap) const
Superclass::RegistrationPointer RegistrationPointer
ElastixType::RegistrationBaseType RegistrationType
ObjectPointer(* PtrToCreator)(void)
ElastixType::ConfigurationPointer ConfigurationPointer
itk::Image< VectorPixelType, FixedImageDimension > DeformationFieldImageType
ComponentDatabaseType::ComponentDescriptionType ComponentDescriptionType
ElastixType::ConfigurationType ConfigurationType
virtual void WriteToFile(void) const
ElastixType::ParameterMapType ParameterMapType
virtual int BeforeAllTransformix(void)
ConfigurationType ::CommandLineArgumentMapType CommandLineArgumentMapType
OptimizerType::ScalesType ScalesType
itk::AdvancedCombinationTransform< CoordRepType, itkGetStaticConstMacro(FixedImageDimension) > CombinationTransformType
virtual const ITKBaseType * GetAsITKBaseType(void) const
ParametersType::ValueType ValueType
virtual const InitialTransformType * GetInitialTransform(void) const
RegistrationType * RegistrationPointer
CombinationTransformType::InitialTransformType InitialTransformType
ElastixType::FixedImageType FixedImageType
virtual void SetReadWriteTransformParameters(const bool _arg)
virtual int BeforeAllBase(void)
Superclass::ElastixType ElastixType
Superclass::ParametersType ParametersType
Transform maps points, vectors and covariant vectors from an input space to an output space...
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
virtual ITKBaseType * GetAsITKBaseType(void)
virtual void TransformPointsSomePoints(const std::string filename) const
ComponentDatabase ComponentDatabaseType
ITKBaseType::ParametersType ParametersType
virtual void TransformPointsSomePointsVTK(const std::string filename) const
virtual void ReadFromFile(void)
ElastixType::MovingImageType MovingImageType
virtual void SetInitialTransform(InitialTransformType *_arg)
Superclass::ElastixPointer ElastixPointer
ElastixType::CoordRepType CoordRepType
elx::ProgressCommand ProgressCommandType
Superclass::RegistrationType RegistrationType
BaseComponentSE< TElastix > Superclass
virtual void AfterRegistrationBase(void)
virtual void BeforeRegistrationBase(void)
Superclass::InputPointType InputPointType
virtual void ReadInitialTransformFromVector(const vcl_size_t index)
virtual void TransformPoints(void) const
virtual void SetTransformParametersFileName(const char *filename)
ITKBaseType::InputPointType InputPointType
The ComponentDatabase class is a class that stores the New() functions of all components.
This class is the elastix base class for all Transforms.
ConfigurationType ::CommandLineEntryType CommandLineEntryType
Superclass::ConfigurationType ConfigurationType
itk::WeakPointer< ElastixType > ElastixPointer
virtual CombinationTransformType * GetAsCombinationTransform(void)
Superclass::OutputPointType OutputPointType
itk::Vector< float, FixedImageDimension > VectorPixelType
A specialized Command object for updating the progress of a filter.
ITKRegistrationType::OptimizerType OptimizerType
Superclass::ConfigurationPointer ConfigurationPointer
ComponentDatabase::PtrToCreator PtrToCreator
virtual void ReadInitialTransformFromFile(const char *transformParameterFileName)
ITKBaseType::OutputPointType OutputPointType
itk::AdvancedTransform< CoordRepType, itkGetStaticConstMacro(FixedImageDimension), itkGetStaticConstMacro(MovingImageDimension) > ITKBaseType
virtual const CombinationTransformType * GetAsCombinationTransform(void) const
RegistrationType::ITKBaseType ITKRegistrationType


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.13 elastix logo