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
23#include "elxElastixBase.h"
25
26#include <itkObject.h>
27
28// Standard C++ header files:
29#include <fstream>
30#include <iostream>
31#include <string>
32
33
34namespace elastix
35{
36
42
53extern int
54xoutSetup(const char * logfilename, bool setupLogging, bool setupCout);
55
56
60{
61public:
63
65 explicit xoutManager(const std::string & logfilename, const bool setupLogging, const bool setupCout);
66
68 xoutManager() = default;
69
71 ~xoutManager() = default;
72
73private:
74 struct Guard
75 {
77 Guard() = default;
79 };
80
81 const Guard m_Guard{};
82};
83
84
126class ElastixMain : public itk::Object
127{
128public:
130
133 using Superclass = itk::Object;
134 using Pointer = itk::SmartPointer<Self>;
135 using ConstPointer = itk::SmartPointer<const Self>;
136
138 itkNewMacro(Self);
139
141 itkTypeMacro(ElastixMain, Object);
142
146 using ObjectPointer = itk::Object::Pointer;
147 using DataObjectPointer = itk::DataObject::Pointer;
148
157
167
170
172 itkSetMacro(FixedImagePixelType, PixelTypeDescriptionType);
174 itkSetMacro(FixedImageDimension, ImageDimensionType);
175 itkSetMacro(MovingImageDimension, ImageDimensionType);
176 itkGetConstMacro(FixedImagePixelType, PixelTypeDescriptionType);
178 itkGetConstMacro(FixedImageDimension, ImageDimensionType);
179 itkGetConstMacro(MovingImageDimension, ImageDimensionType);
180
185 itkSetObjectMacro(FixedImageContainer, DataObjectContainerType);
186 itkSetObjectMacro(MovingImageContainer, DataObjectContainerType);
189
194 itkSetObjectMacro(FixedMaskContainer, DataObjectContainerType);
195 itkSetObjectMacro(MovingMaskContainer, DataObjectContainerType);
198
203 itkSetObjectMacro(ResultImageContainer, DataObjectContainerType);
205
206 itkSetObjectMacro(ResultDeformationFieldContainer, DataObjectContainerType);
207 itkGetModifiableObjectMacro(ResultDeformationFieldContainer, DataObjectContainerType);
208
210 itkSetObjectMacro(Configuration, Configuration);
212
217 itkGetModifiableObjectMacro(Elastix, itk::Object);
218
224
230 itkGetModifiableObjectMacro(FinalTransform, itk::Object);
231
236 itkSetObjectMacro(InitialTransform, itk::Object);
237 itkGetModifiableObjectMacro(InitialTransform, itk::Object);
238
241 virtual void
243
244 virtual const FlatDirectionCosinesType &
246
248 void
249 SetElastixLevel(unsigned int level);
250
251 unsigned int
253
255 void
256 SetTotalNumberOfElastixLevels(unsigned int levels);
257
258 unsigned int
260
262 itkGetConstMacro(DBIndex, DBIndexType);
263
268 virtual void
270
271 virtual void
273
274 // Version used when elastix is used as a library.
275 virtual void
276 EnterCommandLineArguments(const ArgumentMapType & argmap, const std::vector<ParameterMapType> & inputMaps);
277
283 virtual int
285
290 virtual int
291 Run(const ArgumentMapType & argmap);
292
293 virtual int
294 Run(const ArgumentMapType & argmap, const ParameterMapType & inputMap);
295
300 virtual void
302
307 virtual void
309
311 static const ComponentDatabase &
313
315 virtual ParameterMapType
317
318protected:
320 ~ElastixMain() override;
321
326
329
331 std::vector<ConfigurationPointer> m_Configurations{};
332
338
340
348
351
354
359
361
366 virtual int
368
372 virtual ObjectPointer
374
392 const ComponentDescriptionType & defaultComponentName,
393 int & errorcode,
394 bool mandatoryComponent = true);
395
397 void
398 GetImageInformationFromFile(const std::string & filename, ImageDimensionType & imageDimension) const;
399};
400
401} // end namespace elastix
402
403#endif // end #ifndef elxElastixMain_h
The ComponentDatabase class is a class that stores the New() functions of all components.
itk::SmartPointer< Self > Pointer
A class that deals with user given parameters and command line arguments.
static Pointer New()
std::map< std::string, std::string > CommandLineArgumentMapType
itk::SmartPointer< Self > Pointer
This class creates an interface for elastix.
itk::VectorContainer< unsigned int, DataObjectPointer > DataObjectContainerType
std::vector< double > FlatDirectionCosinesType
itk::VectorContainer< unsigned int, ObjectPointer > ObjectContainerType
DataObjectContainerType::Pointer DataObjectContainerPointer
ObjectContainerType::Pointer ObjectContainerPointer
A class with all functionality to configure elastix.
virtual ParameterMapType GetTransformParametersMap() const
itkGetModifiableObjectMacro(ResultDeformationFieldContainer, DataObjectContainerType)
void SetElastixLevel(unsigned int level)
ElastixBase::FlatDirectionCosinesType FlatDirectionCosinesType
virtual int Run(const ArgumentMapType &argmap)
itk::SmartPointer< const Self > ConstPointer
static const ComponentDatabase & GetComponentDatabase()
virtual void EnterCommandLineArguments(const ArgumentMapType &argmap, const std::vector< ParameterMapType > &inputMaps)
itkGetModifiableObjectMacro(InitialTransform, itk::Object)
virtual ObjectPointer CreateComponent(const ComponentDescriptionType &name)
virtual void SetProcessPriority() const
DataObjectContainerPointer m_MovingMaskContainer
unsigned int GetElastixLevel()
itkGetModifiableObjectMacro(MovingImageContainer, DataObjectContainerType)
ImageDimensionType m_MovingImageDimension
itk::SmartPointer< Self > Pointer
ComponentDatabase::ComponentDescriptionType ComponentDescriptionType
ImageDimensionType m_FixedImageDimension
DataObjectContainerPointer m_ResultDeformationFieldContainer
itk::ParameterMapInterface::ParameterMapType ParameterMapType
itkGetModifiableObjectMacro(Elastix, itk::Object)
Configuration::CommandLineArgumentMapType ArgumentMapType
~ElastixMain() override
virtual void EnterCommandLineArguments(const ArgumentMapType &argmap, const ParameterMapType &inputMap)
virtual int Run(const ArgumentMapType &argmap, const ParameterMapType &inputMap)
ElastixBase::DataObjectContainerType DataObjectContainerType
DataObjectContainerPointer m_FixedImageContainer
ElastixBase::DataObjectContainerPointer DataObjectContainerPointer
ObjectPointer m_Elastix
DataObjectContainerPointer m_FixedMaskContainer
itkGetModifiableObjectMacro(MovingMaskContainer, DataObjectContainerType)
virtual void SetOriginalFixedImageDirectionFlat(const FlatDirectionCosinesType &arg)
itk::DataObject::Pointer DataObjectPointer
ITK_DISALLOW_COPY_AND_MOVE(ElastixMain)
ElastixBase::ObjectContainerPointer ObjectContainerPointer
virtual void EnterCommandLineArguments(const ArgumentMapType &argmap)
unsigned int GetTotalNumberOfElastixLevels()
virtual ObjectContainerPointer CreateComponents(const ComponentDescriptionType &key, const ComponentDescriptionType &defaultComponentName, int &errorcode, bool mandatoryComponent=true)
Configuration::Pointer ConfigurationPointer
itkGetModifiableObjectMacro(FixedImageContainer, DataObjectContainerType)
FlatDirectionCosinesType m_OriginalFixedImageDirection
itkGetModifiableObjectMacro(FinalTransform, itk::Object)
itk::Object::Pointer ObjectPointer
ComponentDatabase::PtrToCreator PtrToCreator
ParameterMapType m_TransformParametersMap
ElastixBase & GetElastixBase() const
ComponentDatabase::PixelTypeDescriptionType PixelTypeDescriptionType
DataObjectContainerPointer m_MovingImageContainer
void GetImageInformationFromFile(const std::string &filename, ImageDimensionType &imageDimension) const
std::vector< ConfigurationPointer > m_Configurations
DataObjectContainerPointer m_ResultImageContainer
itkGetModifiableObjectMacro(ResultImageContainer, DataObjectContainerType)
ElastixBase::ObjectContainerType ObjectContainerType
ConfigurationPointer m_Configuration
virtual int Run()
itkGetModifiableObjectMacro(Configuration, Configuration)
virtual void SetMaximumNumberOfThreads() const
ComponentDatabase::Pointer ComponentDatabasePointer
virtual int InitDBIndex()
PixelTypeDescriptionType m_MovingImagePixelType
virtual const FlatDirectionCosinesType & GetOriginalFixedImageDirectionFlat() const
itkGetModifiableObjectMacro(FixedMaskContainer, DataObjectContainerType)
ObjectPointer m_FinalTransform
ObjectPointer m_InitialTransform
void SetTotalNumberOfElastixLevels(unsigned int levels)
PixelTypeDescriptionType m_FixedImagePixelType
xoutManager(const std::string &logfilename, const bool setupLogging, const bool setupCout)
ITK_DISALLOW_COPY_AND_MOVE(xoutManager)
ParameterFileParser::ParameterMapType ParameterMapType
int xoutSetup(const char *logfilename, bool setupLogging, bool setupCout)


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo