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 
19 #ifndef __elxTransformBase_h
20 #define __elxTransformBase_h
21 
23 #include "elxMacro.h"
24 
25 #include "elxBaseComponentSE.h"
26 #include "itkAdvancedTransform.h"
28 #include "elxComponentDatabase.h"
29 #include "elxProgressCommand.h"
30 
31 #include <fstream>
32 #include <iomanip>
33 
34 namespace elastix
35 {
36 //using namespace itk; //Not here, because a TransformBase class was added to ITK...
37 
131 template< class TElastix >
133  public BaseComponentSE< TElastix >
134 {
135 public:
136 
140 
142  itkTypeMacro( TransformBase, BaseComponentSE );
143 
145  typedef typename Superclass::ElastixType ElastixType;
149  typedef typename ConfigurationType
150  ::CommandLineArgumentMapType CommandLineArgumentMapType;
151  typedef typename ConfigurationType
152  ::CommandLineEntryType CommandLineEntryType;
155 
157  typedef typename ElastixType::CoordRepType CoordRepType;
158  typedef typename ElastixType::FixedImageType FixedImageType;
159  typedef typename ElastixType::MovingImageType MovingImageType;
160 
165 
168 
170  itkStaticConstMacro( FixedImageDimension,
171  unsigned int, FixedImageType::ImageDimension );
172 
174  itkStaticConstMacro( MovingImageDimension,
175  unsigned int, MovingImageType::ImageDimension );
176 
178  typedef itk::Object ObjectType;
179  typedef itk::AdvancedTransform<
180  CoordRepType,
181  itkGetStaticConstMacro( FixedImageDimension ),
182  itkGetStaticConstMacro( MovingImageDimension ) > ITKBaseType;
184  itkGetStaticConstMacro( FixedImageDimension ) > CombinationTransformType;
185  typedef typename
187 
190  typedef typename ParametersType::ValueType ValueType;
191 
195 
197  typedef typename RegistrationType::ITKBaseType ITKRegistrationType;
198  typedef typename ITKRegistrationType::OptimizerType OptimizerType;
199  typedef typename OptimizerType::ScalesType ScalesType;
200 
202  typedef typename ElastixType::ParameterMapType ParameterMapType;
203 
205  virtual ITKBaseType * GetAsITKBaseType( void )
206  {
207  return dynamic_cast< ITKBaseType * >( this );
208  }
209 
210 
212  virtual const ITKBaseType * GetAsITKBaseType( void ) const
213  {
214  return dynamic_cast< const ITKBaseType * >( this );
215  }
216 
217 
219  {
220  return dynamic_cast< const CombinationTransformType * >( this );
221  }
222 
223 
225  {
226  return dynamic_cast< CombinationTransformType * >( this );
227  }
228 
229 
233  virtual int BeforeAllBase( void );
234 
238  virtual int BeforeAllTransformix( void );
239 
243  virtual void BeforeRegistrationBase( void );
244 
248  virtual void AfterRegistrationBase( void );
249 
251  virtual const InitialTransformType * GetInitialTransform( void ) const;
252 
254  virtual void SetInitialTransform( InitialTransformType * _arg );
255 
257  virtual void SetTransformParametersFileName( const char * filename );
258 
260  itkGetStringMacro( TransformParametersFileName );
261 
263  virtual void ReadFromFile( void );
264 
266  virtual void CreateTransformParametersMap(
267  const ParametersType & param, ParameterMapType * paramsMap ) const;
268 
270  virtual void WriteToFile( const ParametersType & param ) const;
271 
273  virtual void WriteToFile( void ) const;
274 
276  virtual void SetReadWriteTransformParameters( const bool _arg );
277 
279  virtual void ReadInitialTransformFromFile(
280  const char * transformParameterFileName );
281 
285  virtual void ReadInitialTransformFromVector( const size_t index );
286 
288  virtual void TransformPoints( void ) const;
289 
291  virtual void TransformPointsSomePoints( const std::string filename ) const;
292 
294  virtual void TransformPointsSomePointsVTK( const std::string filename ) const;
295 
297  virtual void TransformPointsAllPoints( void ) const;
298 
300  virtual void ComputeDeterminantOfSpatialJacobian( void ) const;
301 
303  virtual void ComputeSpatialJacobian( void ) const;
304 
308  virtual void SetFinalParameters( void );
309 
310 protected:
311 
313  TransformBase();
315  virtual ~TransformBase();
316 
323  void AutomaticScalesEstimation( ScalesType & scales ) const;
324 
328  ParametersType m_FinalParameters;
329 
330 private:
331 
333  TransformBase( const Self & ); // purposely not implemented
335  void operator=( const Self & ); // purposely not implemented
336 
339 
340 };
341 
342 } // end namespace elastix
343 
344 #ifndef ITK_MANUAL_INSTANTIATION
345 #include "elxTransformBase.hxx"
346 #endif
347 
348 #endif // end #ifndef __elxTransformBase_h
This class combines two transforms: an 'initial transform' with a 'current transform'.
The BaseComponentSE class is a base class for elastix components that provides some basic functionali...
Superclass::RegistrationPointer RegistrationPointer
ElastixType::RegistrationBaseType RegistrationType
ObjectPointer(* PtrToCreator)(void)
ElastixType::ConfigurationPointer ConfigurationPointer
ComponentDatabaseType::ComponentDescriptionType ComponentDescriptionType
ParametersType * m_TransformParametersPointer
ElastixType::Pointer ElastixPointer
ElastixType::ConfigurationType ConfigurationType
ElastixType::ParameterMapType ParameterMapType
virtual int BeforeAllTransformix(void)
std::string m_TransformParametersFileName
ConfigurationType::CommandLineArgumentMapType CommandLineArgumentMapType
void AutomaticScalesEstimation(ScalesType &scales) const
OptimizerType::ScalesType ScalesType
itk::AdvancedCombinationTransform< CoordRepType, itkGetStaticConstMacro(FixedImageDimension) > CombinationTransformType
ParametersType m_FinalParameters
virtual const CombinationTransformType * GetAsCombinationTransform(void) const
ParametersType::ValueType ValueType
virtual const ITKBaseType * GetAsITKBaseType(void) const
RegistrationType * RegistrationPointer
CombinationTransformType::InitialTransformType InitialTransformType
ElastixType::FixedImageType FixedImageType
virtual void SetReadWriteTransformParameters(const bool _arg)
virtual void WriteToFile(void) const
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)
ComponentDatabase ComponentDatabaseType
ITKBaseType::ParametersType ParametersType
virtual void ReadFromFile(void)
virtual const InitialTransformType * GetInitialTransform(void) const
ElastixType::MovingImageType MovingImageType
virtual void TransformPointsSomePoints(const std::string filename) const
virtual void SetInitialTransform(InitialTransformType *_arg)
virtual void TransformPointsSomePointsVTK(const std::string filename) const
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 ComputeDeterminantOfSpatialJacobian(void) const
virtual void ReadInitialTransformFromVector(const vcl_size_t index)
virtual void SetFinalParameters(void)
virtual void SetTransformParametersFileName(const char *filename)
ITKBaseType::InputPointType InputPointType
virtual void TransformPointsAllPoints(void) const
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
virtual CombinationTransformType * GetAsCombinationTransform(void)
Superclass::OutputPointType OutputPointType
A specialized Command object for updating the progress of a filter.
ITKRegistrationType::OptimizerType OptimizerType
Superclass::ConfigurationPointer ConfigurationPointer
virtual void ComputeSpatialJacobian(void) const
ComponentDatabase::PtrToCreator PtrToCreator
virtual void ReadInitialTransformFromFile(const char *transformParameterFileName)
virtual void TransformPoints(void) const
void operator=(const Self &)
ITKBaseType::OutputPointType OutputPointType
itk::AdvancedTransform< CoordRepType, itkGetStaticConstMacro(FixedImageDimension), itkGetStaticConstMacro(MovingImageDimension) > ITKBaseType
virtual void CreateTransformParametersMap(const ParametersType &param, ParameterMapType *paramsMap) const
RegistrationType::ITKBaseType ITKRegistrationType


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo