15 #ifndef __elxComponentLoader_cxx 16 #define __elxComponentLoader_cxx 18 #include "elxComponentLoader.h" 19 #include "elxSupportedImageTypes.h" 20 #include "elxInstallFunctions.h" 22 #include "elxInstallAllComponents.h" 35 template< ComponentDatabase::IndexType VIndex >
42 typedef ElastixTypedef< VIndex >
ET;
43 typedef typename ET::ElastixType ElastixType;
44 typedef ComponentDatabase::ComponentDescriptionType ComponentDescriptionType;
46 static int DO(
const ComponentDescriptionType & name, ComponentDatabase * cdb )
48 int dummy1 = InstallFunctions< ElastixType >::InstallComponent( name, VIndex, cdb );
49 int dummy2 = cdb->SetIndex(
50 ET::fPixelTypeAsString(),
52 ET::mPixelTypeAsString(),
55 if( ElastixTypedef< VIndex + 1 >::Defined() )
59 return ( dummy1 + dummy2 );
73 typedef ComponentDatabase::ComponentDescriptionType ComponentDescriptionType;
74 static int DO(
const ComponentDescriptionType & ,
89 this->m_ImageTypeSupportInstalled =
false;
99 this->UnloadComponents();
120 int _InstallDummy_SupportedImageTypes
123 if( _InstallDummy_SupportedImageTypes == 0 )
125 this->m_ImageTypeSupportInstalled =
true;
128 return _InstallDummy_SupportedImageTypes;
140 int installReturnCode = 0;
143 if( !this->m_ImageTypeSupportInstalled )
145 installReturnCode = this->InstallSupportedImageTypes();
146 if( installReturnCode != 0 )
149 <<
"ERROR: ImageTypeSupport installation failed. " 151 return installReturnCode;
155 elxout <<
"Installing all components." << std::endl;
158 installReturnCode = InstallAllComponents( this->m_ComponentDatabase );
160 if( installReturnCode )
163 <<
"ERROR: Installing of at least one of components failed." << std::endl;
164 return installReturnCode;
167 elxout <<
"InstallingComponents was successful.\n" << std::endl;
193 #endif //#ifndef __elxComponentLoader_cxx
virtual ~ComponentLoader()
virtual int LoadComponents(const char *argv0)
virtual int InstallSupportedImageTypes(void)
virtual void UnloadComponents(void)
ElastixTypedef< VIndex > ET