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 * 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 __elxElastixMain_h
19#define __elxElastixMain_h
20
22#include "elxComponentLoader.h"
23
24#include "elxElastixBase.h"
25#include "itkObject.h"
26
27#include <iostream>
28#include <fstream>
29
31
32namespace elastix
33{
34
40
51extern int xoutSetup( const char * logfilename, bool setupLogging, bool setupCout );
52
94class ElastixMain : public itk::Object
95{
96public:
97
100 typedef itk::Object Superclass;
101 typedef itk::SmartPointer< Self > Pointer;
102 typedef itk::SmartPointer< const Self > ConstPointer;
103
105 itkNewMacro( Self );
106
108 itkTypeMacro( ElastixMain, Object );
109
113 typedef itk::Object ObjectType;
114 typedef ObjectType::Pointer ObjectPointer;
115 typedef itk::DataObject DataObjectType;
116 typedef DataObjectType::Pointer DataObjectPointer;
117
128
139
143
146
148 itkSetMacro( FixedImagePixelType, PixelTypeDescriptionType );
149 itkSetMacro( MovingImagePixelType, PixelTypeDescriptionType );
150 itkSetMacro( FixedImageDimension, ImageDimensionType );
151 itkSetMacro( MovingImageDimension, ImageDimensionType );
152 itkGetMacro( FixedImagePixelType, PixelTypeDescriptionType );
153 itkGetMacro( MovingImagePixelType, PixelTypeDescriptionType );
154 itkGetMacro( FixedImageDimension, ImageDimensionType );
155 itkGetMacro( MovingImageDimension, ImageDimensionType );
156
161 itkSetObjectMacro( FixedImageContainer, DataObjectContainerType );
162 itkSetObjectMacro( MovingImageContainer, DataObjectContainerType );
165
170 itkSetObjectMacro( FixedMaskContainer, DataObjectContainerType );
171 itkSetObjectMacro( MovingMaskContainer, DataObjectContainerType );
174
179 itkSetObjectMacro( ResultImageContainer, DataObjectContainerType );
181
182 itkSetObjectMacro( ResultDeformationFieldContainer, DataObjectContainerType );
183 itkGetModifiableObjectMacro( ResultDeformationFieldContainer, DataObjectContainerType );
184
186 itkSetObjectMacro( Configuration, ConfigurationType );
188
194
198 virtual ElastixBaseType * GetElastixBase( void ) const;
199
206
211 itkSetObjectMacro( InitialTransform, ObjectType );
213
217 const FlatDirectionCosinesType & arg );
218
220
222 void SetElastixLevel( unsigned int level );
223
224 unsigned int GetElastixLevel( void );
225
227 void SetTotalNumberOfElastixLevels( unsigned int levels );
228
229 unsigned int GetTotalNumberOfElastixLevels( void );
230
232 itkGetConstMacro( DBIndex, DBIndexType );
233
238 virtual void EnterCommandLineArguments( const ArgumentMapType & argmap );
239
240 virtual void EnterCommandLineArguments( const ArgumentMapType & argmap,
241 const ParameterMapType & inputMap );
242
243 // Version used when elastix is used as a library.
244 virtual void EnterCommandLineArguments( const ArgumentMapType & argmap,
245 const std::vector< ParameterMapType > & inputMaps );
246
252 virtual int Run( void );
253
258 virtual int Run( const ArgumentMapType & argmap );
259
260 virtual int Run( const ArgumentMapType & argmap, const ParameterMapType & inputMap );
261
266 virtual void SetProcessPriority( void ) const;
267
272 virtual void SetMaximumNumberOfThreads( void ) const;
273
276 {
277 return s_CDB.GetPointer();
278 }
279
280
282 {
283 if( s_CDB != arg )
284 {
285 s_CDB = arg;
286 }
287 }
288
289
292
293 static void UnloadComponents( void );
294
295protected:
296
298 ~ElastixMain() override;
299
304
307
309 std::vector< ConfigurationPointer > m_Configurations;
310
316
318
326
329
336
338
341 virtual int LoadComponents( void );
342
347 virtual int InitDBIndex( void );
348
353
370 const ComponentDescriptionType & key,
371 const ComponentDescriptionType & defaultComponentName,
372 int & errorcode,
373 bool mandatoryComponent = true );
374
376 void GetImageInformationFromFile( const std::string & filename,
377 ImageDimensionType & imageDimension ) const;
378
379private:
380
381 ElastixMain( const Self & ); // purposely not implemented
382 void operator=( const Self & ); // purposely not implemented
383
384};
385
386} // end namespace elastix
387
388#endif // end #ifndef __elxElastixMain_h
The ComponentDatabase class is a class that stores the New() functions of all components.
ObjectPointer(* PtrToCreator)(void)
itk::SmartPointer< Self > Pointer
Determines which components (metrics, transforms, etc.) are available.
itk::SmartPointer< Self > Pointer
A class that deals with user given parameters and command line arguments.
itk::SmartPointer< Self > Pointer
std::map< std::string, std::string > CommandLineArgumentMapType
This class creates an interface for elastix.
itk::VectorContainer< unsigned int, ObjectPointer > ObjectContainerType
itk::VectorContainer< unsigned int, DataObjectPointer > DataObjectContainerType
DataObjectContainerType::Pointer DataObjectContainerPointer
std::vector< double > FlatDirectionCosinesType
ObjectContainerType::Pointer ObjectContainerPointer
A class with all functionality to configure elastix.
itkGetModifiableObjectMacro(ResultDeformationFieldContainer, DataObjectContainerType)
ElastixBase::FlatDirectionCosinesType FlatDirectionCosinesType
void SetElastixLevel(unsigned int level)
virtual int Run(const ArgumentMapType &argmap)
ConfigurationType::Pointer ConfigurationPointer
virtual void SetMaximumNumberOfThreads(void) const
ComponentLoaderType::Pointer ComponentLoaderPointer
void operator=(const Self &)
virtual ElastixBaseType * GetElastixBase(void) const
ComponentDatabaseType::IndexType DBIndexType
unsigned int GetElastixLevel(void)
virtual void EnterCommandLineArguments(const ArgumentMapType &argmap, const std::vector< ParameterMapType > &inputMaps)
ElastixMain(const Self &)
itk::SmartPointer< const Self > ConstPointer
virtual ObjectPointer CreateComponent(const ComponentDescriptionType &name)
ObjectType::Pointer ObjectPointer
static ComponentDatabasePointer s_CDB
virtual const FlatDirectionCosinesType & GetOriginalFixedImageDirectionFlat(void) const
DataObjectContainerPointer m_MovingMaskContainer
itkGetModifiableObjectMacro(MovingImageContainer, DataObjectContainerType)
ImageDimensionType m_MovingImageDimension
itkGetModifiableObjectMacro(FinalTransform, ObjectType)
unsigned int GetTotalNumberOfElastixLevels(void)
itk::DataObject DataObjectType
ComponentDatabaseType::PtrToCreator PtrToCreator
ImageDimensionType m_FixedImageDimension
virtual int Run(void)
DataObjectType::Pointer DataObjectPointer
ComponentDatabase ComponentDatabaseType
DataObjectContainerPointer m_ResultDeformationFieldContainer
ElastixBase ElastixBaseType
ComponentDatabaseType::ComponentDescriptionType ComponentDescriptionType
~ElastixMain() override
virtual void EnterCommandLineArguments(const ArgumentMapType &argmap, const ParameterMapType &inputMap)
virtual int Run(const ArgumentMapType &argmap, const ParameterMapType &inputMap)
virtual int InitDBIndex(void)
ComponentLoader ComponentLoaderType
DataObjectContainerPointer m_FixedImageContainer
std::vector< ConfigurationPointer > m_Configurations
ObjectPointer m_Elastix
ElastixBase::DataObjectContainerType DataObjectContainerType
DataObjectContainerPointer m_FixedMaskContainer
itkGetModifiableObjectMacro(MovingMaskContainer, DataObjectContainerType)
virtual void SetOriginalFixedImageDirectionFlat(const FlatDirectionCosinesType &arg)
virtual int LoadComponents(void)
virtual void EnterCommandLineArguments(const ArgumentMapType &argmap)
ComponentDatabaseType::PixelTypeDescriptionType PixelTypeDescriptionType
virtual ObjectContainerPointer CreateComponents(const ComponentDescriptionType &key, const ComponentDescriptionType &defaultComponentName, int &errorcode, bool mandatoryComponent=true)
ElastixBase::ObjectContainerType ObjectContainerType
static ComponentLoaderPointer s_ComponentLoader
itkGetModifiableObjectMacro(FixedImageContainer, DataObjectContainerType)
static ComponentDatabase * GetComponentDatabase(void)
FlatDirectionCosinesType m_OriginalFixedImageDirection
virtual ParameterMapType GetTransformParametersMap(void) const
ConfigurationType::CommandLineArgumentMapType ArgumentMapType
ParameterMapType m_TransformParametersMap
ComponentDatabaseType::Pointer ComponentDatabasePointer
DataObjectContainerPointer m_MovingImageContainer
void GetImageInformationFromFile(const std::string &filename, ImageDimensionType &imageDimension) const
ElastixBase::ConfigurationType ConfigurationType
itkGetModifiableObjectMacro(Configuration, ConfigurationType)
itk::ParameterMapInterface::ParameterMapType ParameterMapType
static void UnloadComponents(void)
DataObjectContainerPointer m_ResultImageContainer
itkGetModifiableObjectMacro(ResultImageContainer, DataObjectContainerType)
itk::SmartPointer< Self > Pointer
static void SetComponentDatabase(ComponentDatabase *arg)
ConfigurationPointer m_Configuration
itkGetModifiableObjectMacro(InitialTransform, ObjectType)
ComponentDatabaseType::ImageDimensionType ImageDimensionType
PixelTypeDescriptionType m_MovingImagePixelType
itkGetModifiableObjectMacro(Elastix, ObjectType)
virtual void SetProcessPriority(void) const
itkGetModifiableObjectMacro(FixedMaskContainer, DataObjectContainerType)
ElastixBase::ObjectContainerPointer ObjectContainerPointer
ObjectPointer m_FinalTransform
ObjectPointer m_InitialTransform
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
void SetTotalNumberOfElastixLevels(unsigned int levels)
PixelTypeDescriptionType m_FixedImagePixelType
ParameterFileParser::ParameterMapType ParameterMapType
int xoutSetup(const char *logfilename, bool setupLogging, bool setupCout)


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo