go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxElastixMain.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 __elxElastixMain_h
16 #define __elxElastixMain_h
17 
18 #include "elxComponentDatabase.h"
19 #include "elxComponentLoader.h"
20 
21 #include "elxBaseComponent.h"
22 #include "elxElastixBase.h"
23 #include "itkObject.h"
24 
25 #include <iostream>
26 #include <fstream>
27 
29 
30 namespace elastix
31 {
32 
38 
49 extern int xoutSetup( const char * logfilename, bool setupLogging, bool setupCout );
50 
92 class ElastixMain : public itk::Object
93 {
94 public:
95 
97  typedef ElastixMain Self;
98  typedef itk::Object Superclass;
99  typedef itk::SmartPointer< Self > Pointer;
100  typedef itk::SmartPointer< const Self > ConstPointer;
101 
103  itkNewMacro( Self );
104 
106  itkTypeMacro( ElastixMain, Object );
107 
111  typedef itk::Object ObjectType;
112  typedef ObjectType::Pointer ObjectPointer;
113  typedef itk::DataObject DataObjectType;
114  typedef DataObjectType::Pointer DataObjectPointer;
115 
126 
137 
141 
144 
146  itkSetMacro( FixedImagePixelType, PixelTypeDescriptionType );
147  itkSetMacro( MovingImagePixelType, PixelTypeDescriptionType );
148  itkSetMacro( FixedImageDimension, ImageDimensionType );
149  itkSetMacro( MovingImageDimension, ImageDimensionType );
150  itkGetMacro( FixedImagePixelType, PixelTypeDescriptionType );
151  itkGetMacro( MovingImagePixelType, PixelTypeDescriptionType );
152  itkGetMacro( FixedImageDimension, ImageDimensionType );
153  itkGetMacro( MovingImageDimension, ImageDimensionType );
154 
159  itkSetObjectMacro( FixedImageContainer, DataObjectContainerType );
160  itkSetObjectMacro( MovingImageContainer, DataObjectContainerType );
161  itkGetObjectMacro( FixedImageContainer, DataObjectContainerType );
162  itkGetObjectMacro( MovingImageContainer, DataObjectContainerType );
163 
168  itkSetObjectMacro( FixedMaskContainer, DataObjectContainerType );
169  itkSetObjectMacro( MovingMaskContainer, DataObjectContainerType );
170  itkGetObjectMacro( FixedMaskContainer, DataObjectContainerType );
171  itkGetObjectMacro( MovingMaskContainer, DataObjectContainerType );
172 
177  itkSetObjectMacro( ResultImageContainer, DataObjectContainerType );
178  itkGetObjectMacro( ResultImageContainer, DataObjectContainerType );
179 
181  itkSetObjectMacro( Configuration, ConfigurationType );
182  itkGetObjectMacro( Configuration, ConfigurationType );
183 
188  itkGetObjectMacro( Elastix, ObjectType );
189 
193  virtual ElastixBaseType * GetElastixBase( void ) const;
194 
200  itkGetObjectMacro( FinalTransform, ObjectType );
201 
206  itkSetObjectMacro( InitialTransform, ObjectType );
207  itkGetObjectMacro( InitialTransform, ObjectType );
208 
212  const FlatDirectionCosinesType & arg );
213 
214  virtual const FlatDirectionCosinesType & GetOriginalFixedImageDirectionFlat( void ) const;
215 
217  void SetElastixLevel( unsigned int level );
218 
219  unsigned int GetElastixLevel( void );
220 
222  void SetTotalNumberOfElastixLevels( unsigned int levels );
223 
224  unsigned int GetTotalNumberOfElastixLevels( void );
225 
227  itkGetConstMacro( DBIndex, DBIndexType );
228 
233  virtual void EnterCommandLineArguments( ArgumentMapType & argmap );
234 
235  virtual void EnterCommandLineArguments( ArgumentMapType & argmap,
236  ParameterMapType & inputMap );
237 
238  // Version used when elastix is used as a library.
239  virtual void EnterCommandLineArguments( ArgumentMapType & argmap,
240  std::vector< ParameterMapType > & inputMaps );
241 
247  virtual int Run( void );
248 
253  virtual int Run( ArgumentMapType & argmap );
254 
255  virtual int Run( ArgumentMapType & argmap, ParameterMapType & inputMap );
256 
261  virtual void SetProcessPriority( void ) const;
262 
267  virtual void SetMaximumNumberOfThreads( void ) const;
268 
271  {
272  return s_CDB.GetPointer();
273  }
274 
275 
277  {
278  if( s_CDB != arg )
279  {
280  s_CDB = arg;
281  }
282  }
283 
284 
286  virtual ParameterMapType GetTransformParametersMap( void ) const;
287 
288  static void UnloadComponents( void );
289 
290 protected:
291 
292  ElastixMain();
293  virtual ~ElastixMain();
294 
299 
302 
304  std::vector< ConfigurationPointer > m_Configurations;
305 
311 
313 
320 
323 
330 
332 
335  virtual int LoadComponents( void );
336 
341  virtual int InitDBIndex( void );
342 
347 
364  const ComponentDescriptionType & key,
365  const ComponentDescriptionType & defaultComponentName,
366  int & errorcode,
367  bool mandatoryComponent = true );
368 
370  void GetImageInformationFromFile( const std::string & filename,
371  ImageDimensionType & imageDimension ) const;
372 
373 private:
374 
375  ElastixMain( const Self & ); // purposely not implemented
376  void operator=( const Self & ); // purposely not implemented
377 
378 };
379 
380 } // end namespace elastix
381 
382 #endif // end #ifndef __elxElastixMain_h
DataObjectType::Pointer DataObjectPointer
DataObjectContainerPointer m_FixedImageContainer
DataObjectContainerType::Pointer DataObjectContainerPointer
static ComponentDatabase * GetComponentDatabase(void)
static ComponentLoaderPointer s_ComponentLoader
std::vector< ConfigurationPointer > m_Configurations
static void UnloadComponents(void)
itk::SmartPointer< Self > Pointer
virtual ElastixBaseType * GetElastixBase(void) const
virtual void SetOriginalFixedImageDirectionFlat(const FlatDirectionCosinesType &arg)
virtual void EnterCommandLineArguments(ArgumentMapType &argmap)
ElastixBase::ConfigurationType ConfigurationType
virtual ObjectContainerPointer CreateComponents(const ComponentDescriptionType &key, const ComponentDescriptionType &defaultComponentName, int &errorcode, bool mandatoryComponent=true)
ObjectPointer m_FinalTransform
DataObjectContainerPointer m_ResultImageContainer
static ComponentDatabasePointer s_CDB
ElastixBase::ObjectContainerPointer ObjectContainerPointer
itk::SmartPointer< Self > Pointer
ImageDimensionType m_FixedImageDimension
DataObjectContainerPointer m_MovingMaskContainer
int xoutSetup(const char *logfilename, bool setupLogging, bool setupCout)
ElastixBase::DataObjectContainerType DataObjectContainerType
std::vector< double > FlatDirectionCosinesType
ComponentDatabase ComponentDatabaseType
itk::SmartPointer< Self > Pointer
itk::VectorContainer< unsigned int, ObjectPointer > ObjectContainerType
ParameterFileParser::ParameterMapType ParameterMapType
ConfigurationType::Pointer ConfigurationPointer
ComponentDatabaseType::PtrToCreator PtrToCreator
ElastixBase::FlatDirectionCosinesType FlatDirectionCosinesType
virtual void SetMaximumNumberOfThreads(void) const
ConfigurationType::CommandLineArgumentMapType ArgumentMapType
PixelTypeDescriptionType m_FixedImagePixelType
DataObjectContainerPointer m_FixedMaskContainer
virtual int InitDBIndex(void)
void GetImageInformationFromFile(const std::string &filename, ImageDimensionType &imageDimension) const
ComponentDatabaseType::Pointer ComponentDatabasePointer
ComponentDatabaseType::PixelTypeDescriptionType PixelTypeDescriptionType
itk::SmartPointer< const Self > ConstPointer
ComponentLoaderType::Pointer ComponentLoaderPointer
virtual ParameterMapType GetTransformParametersMap(void) const
ObjectPointer m_Elastix
PixelTypeDescriptionType m_MovingImagePixelType
virtual void SetProcessPriority(void) const
ObjectType::Pointer ObjectPointer
A class with all functionality to configure elastix.
DataObjectContainerPointer m_MovingImageContainer
FlatDirectionCosinesType m_OriginalFixedImageDirection
Determines which components (metrics, transforms, etc.) are available.
virtual ObjectPointer CreateComponent(const ComponentDescriptionType &name)
itk::DataObject DataObjectType
itk::SmartPointer< Self > Pointer
itk::ParameterMapInterface::ParameterMapType ParameterMapType
ElastixBase::ObjectContainerType ObjectContainerType
void SetTotalNumberOfElastixLevels(unsigned int levels)
ImageDimensionType m_MovingImageDimension
void operator=(const Self &)
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
ObjectContainerType::Pointer ObjectContainerPointer
ElastixBase ElastixBaseType
ParameterMapType m_TransformParametersMap
ObjectPointer m_InitialTransform
ConfigurationPointer m_Configuration
ComponentLoader ComponentLoaderType
A class that deals with user given parameters and command line arguments.
ComponentDatabaseType::ImageDimensionType ImageDimensionType
The ComponentDatabase class is a class that stores the New() functions of all components.
ObjectPointer(* PtrToCreator)(void)
ComponentDatabaseType::IndexType DBIndexType
ComponentDatabaseType::ComponentDescriptionType ComponentDescriptionType
virtual int LoadComponents(void)
itk::VectorContainer< unsigned int, DataObjectPointer > DataObjectContainerType
void SetElastixLevel(unsigned int level)
static void SetComponentDatabase(ComponentDatabase *arg)
virtual const FlatDirectionCosinesType & GetOriginalFixedImageDirectionFlat(void) const
itk::Object Superclass
unsigned int GetTotalNumberOfElastixLevels(void)
This class creates an interface for elastix.
std::map< std::string, std::string > CommandLineArgumentMapType
unsigned int GetElastixLevel(void)
virtual int Run(void)


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