|
|
Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
#include <elxMainBase.h>
Common (abstract) base class of ElastixMain and TransformixMain.
Definition at line 44 of file elxMainBase.h.
Static Public Member Functions | |
| static const ComponentDatabase & | GetComponentDatabase () |
Protected Member Functions | |
| virtual ObjectPointer | CreateComponent (const ComponentDescriptionType &name) |
| virtual ObjectContainerPointer | CreateComponents (const ComponentDescriptionType &key, const ComponentDescriptionType &defaultComponentName, int &errorcode, bool mandatoryComponent=true) |
| virtual int | InitDBIndex ()=0 |
| MainBase () | |
| ~MainBase () override=0 | |
Protected Attributes | |
| DBIndexType | m_DBIndex { 0 } |
| ObjectPointer | m_Elastix { nullptr } |
| ImageDimensionType | m_FixedImageDimension { 0 } |
| PixelTypeDescriptionType | m_FixedImagePixelType {} |
| DataObjectContainerPointer | m_MovingImageContainer { nullptr } |
| ImageDimensionType | m_MovingImageDimension { 0 } |
| PixelTypeDescriptionType | m_MovingImagePixelType {} |
| DataObjectContainerPointer | m_ResultDeformationFieldContainer { nullptr } |
| DataObjectContainerPointer | m_ResultImageContainer { nullptr } |
| std::vector< Configuration::ConstPointer > | m_TransformConfigurations {} |
Static Private Member Functions | |
| static ComponentDatabase & | GetMutableComponentDatabase () |
| static bool | TryLoadComponentPlugin (const ComponentDescriptionType &componentName) |
Private Attributes | |
| Configuration::Pointer | m_Configuration { Configuration::New() } |
elastix components.
Definition at line 65 of file elxMainBase.h.
Typedefs for the database that holds pointers to New() functions. Those functions are used to instantiate components, such as the metric etc.
Definition at line 75 of file elxMainBase.h.
Definition at line 77 of file elxMainBase.h.
| using elastix::MainBase::ConstPointer = itk::SmartPointer<const Self> |
Definition at line 53 of file elxMainBase.h.
Definition at line 69 of file elxMainBase.h.
Definition at line 67 of file elxMainBase.h.
| using elastix::MainBase::DataObjectPointer = itk::DataObject::Pointer |
Definition at line 62 of file elxMainBase.h.
Definition at line 80 of file elxMainBase.h.
Definition at line 70 of file elxMainBase.h.
Definition at line 79 of file elxMainBase.h.
Definition at line 68 of file elxMainBase.h.
Definition at line 66 of file elxMainBase.h.
| using elastix::MainBase::ObjectPointer = itk::Object::Pointer |
Typedef's. ITK base objects.
Definition at line 61 of file elxMainBase.h.
Typedef that is used in the elastix dll version.
Definition at line 83 of file elxMainBase.h.
Definition at line 78 of file elxMainBase.h.
| using elastix::MainBase::Pointer = itk::SmartPointer<Self> |
Definition at line 52 of file elxMainBase.h.
Definition at line 76 of file elxMainBase.h.
| using elastix::MainBase::Self = MainBase |
Standard itk.
Definition at line 50 of file elxMainBase.h.
| using elastix::MainBase::Superclass = itk::Object |
Definition at line 51 of file elxMainBase.h.
|
protected |
|
overrideprotectedpure virtual |
|
protectedvirtual |
Creates an elastix component by name. Make sure InitDBIndex has been called before invoking this function.
The input is a string identifying the component, for example: "MattesMutualInformation" or "Impact".
Component creation follows a two-step strategy:
1) Fast path — static components First, the function queries the already populated ComponentDatabase. This covers all components that are statically linked into elastix and is the normal, zero-overhead code path.
2) Lazy plugin path — optional components If the component is not found, elastix attempts to lazy-load a plugin that may provide it (for example, the IMPACT metric). When the plugin is successfully loaded, it registers its components into the database, and the lookup is retried exactly once.
This design allows elastix to:
If both attempts fail, an exception is thrown with a clear diagnostic message explaining which component could not be created.
|
protectedvirtual |
Create components. Reads from the configuration object (using the provided key) the names of the components to create and store their instantiations in the provided ObjectContainer. The errorcode remains what it was if no error occurred. Otherwise it's set to 1. The 'key' is the entry inspected in the parameter file A component named 'defaultComponentName' is used when the key is not found in the parameter file. If "" is used, no default is assumed, and an error is given when the component was not specified. If the flag mandatoryComponent is set to false, no error is given, because the component may not be needed anyway.
NB: this function should never be called with: ( !mandatoryComponent && defaultComponentName != "" ) == true
|
static |
Const accessor for the ComponentDatabase.
Most of elastix only needs read-only access to the database (querying creators). This overload preserves const-correctness while still sharing the same underlying singleton instance.
|
virtual |
Returns the Index that is used in elx::ComponentDatabase.
| ElastixBase & elastix::MainBase::GetElastixBase | ( | ) | const |
Convenience function that returns the elastix component as a pointer to an ElastixBase. Use only after having called run()!
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
staticprivate |
****************** GetComponentDatabase *********
Returns the global ComponentDatabase instance.
This function provides mutable access to the database. It is required for the lazy plugin mechanism: when a plugin is loaded at runtime, it must be able to register new components into the database. That registration modifies the database, hence a non-const reference is needed.
The database itself is created exactly once using a C++11 "magic static". This guarantees:
At construction time, the ComponentLoader installs all statically linked components. Later, TryLoadComponentPlugin() may add more entries by calling into this same mutable instance.
|
protectedpure virtual |
InitDBIndex sets m_DBIndex by asking the ImageTypes from the Configuration object and obtaining the corresponding DB index from the ComponentDatabase.
Implemented in elastix::ElastixMain, and elastix::TransformixMain.
| elastix::MainBase::ITK_DISALLOW_COPY_AND_MOVE | ( | MainBase | ) |
| elastix::MainBase::itkGetModifiableObjectMacro | ( | Configuration | , |
| Configuration | ) |
| elastix::MainBase::itkGetModifiableObjectMacro | ( | Elastix | , |
| itk::Object | ) |
Functions to get pointers to the elastix components. The components are returned as Object::Pointer. Before calling this functions, call run().
| elastix::MainBase::itkGetModifiableObjectMacro | ( | MovingImageContainer | , |
| DataObjectContainerType | ) |
| elastix::MainBase::itkGetModifiableObjectMacro | ( | ResultDeformationFieldContainer | , |
| DataObjectContainerType | ) |
| elastix::MainBase::itkGetModifiableObjectMacro | ( | ResultImageContainer | , |
| DataObjectContainerType | ) |
| elastix::MainBase::itkOverrideGetNameOfClassMacro | ( | MainBase | ) |
Run-time type information (and related methods).
|
pure virtual |
Start the registration run() without command line parameters; it assumes that EnterCommandLineParameters has been invoked already, or that m_Configuration is initialized in a different way.
Implemented in elastix::ElastixMain, and elastix::TransformixMain.
|
virtual |
Start the registration this version of 'run' first calls this->EnterCommandLineParameters(argc,argv) and then calls run().
Reimplemented in elastix::ElastixMain, and elastix::TransformixMain.
|
virtual |
Reimplemented in elastix::ElastixMain, and elastix::TransformixMain.
|
virtual |
Set/Get the configuration object.
|
virtual |
|
virtual |
Set/Get functions for the description of the image type.
|
virtual |
Set maximum number of threads, which is read from the command line arguments. Syntax: -threads <int>
|
virtual |
Set/Get functions for the moving images (if these are not used, elastix tries to read them from disk, according to the command line parameters).
|
virtual |
|
virtual |
|
virtual |
Set process priority, which is read from the command line arguments. Syntax: -priority <high, belownormal>
|
virtual |
|
virtual |
Set/Get functions for the result images (if these are not used, elastix tries to read them from disk, according to the command line parameters).
|
staticprivate |
Tries to load a component as a runtime plugin and register it in the ComponentDatabase.
This function is called when a component cannot be created because it is not yet present in the ComponentDatabase. It attempts to dynamically load a shared library whose name is derived from componentName (e.g. libImpactMetric.so, ImpactMetric.dll, ...), locate the exported <PluginName>InstallComponent symbol inside that library, and call it.
The install function is expected to register one or more components into the provided ComponentDatabase. After a successful call, the caller can retry component creation using the same name.
The plugin is searched using the system dynamic loader mechanisms (RPATH/RUNPATH, LD_LIBRARY_PATH on Unix, PATH on Windows), exactly like a regular shared library.
| componentName | Name of the component as used in the parameter file (e.g. "Impact"). |
|
private |
The configuration object, containing the parameters and command-line arguments.
Definition at line 310 of file elxMainBase.h.
|
protected |
Definition at line 192 of file elxMainBase.h.
|
protected |
A pointer to elastix as an itk::object. In run() this pointer will be assigned to an ElastixTemplate<>.
Definition at line 181 of file elxMainBase.h.
|
protected |
Definition at line 188 of file elxMainBase.h.
|
protected |
Description of the ImageTypes.
Definition at line 187 of file elxMainBase.h.
|
protected |
The images and masks.
Definition at line 195 of file elxMainBase.h.
|
protected |
Definition at line 190 of file elxMainBase.h.
|
protected |
Definition at line 189 of file elxMainBase.h.
|
protected |
Definition at line 197 of file elxMainBase.h.
|
protected |
Definition at line 196 of file elxMainBase.h.
|
protected |
A vector of configuration objects, needed when transformix is used as library.
Definition at line 184 of file elxMainBase.h.
Generated on 1774142652 for elastix by 1.15.0 |