| 130 | */ |
| 131 | |
| 132 | int |
| 133 | ComponentLoader::LoadComponents() |
| 134 | { |
| 135 | #ifndef ELX_NO_FILESYSTEM_ACCESS |
| 136 | // Retrieve those IOFactoryRegisterManager instances, just to ensure that they are really constructed. |
| 137 | const volatile auto ioFactoryRegisterManagerInstances = |
| 138 | std::make_tuple(itk::ImageIOFactoryRegisterManagerInstance, |
| 139 | itk::MeshIOFactoryRegisterManagerInstance, |
| 140 | itk::TransformIOFactoryRegisterManagerInstance); |
| 141 | (void)ioFactoryRegisterManagerInstances; |
| 142 | #endif |
| 143 | |
| 144 | int installReturnCode = 0; |
| 145 | |
| 146 | /** Generate the mapping between indices and image types */ |
| 147 | if (!this->m_ImageTypeSupportInstalled) |
| 148 | { |
| 149 | installReturnCode = this->InstallSupportedImageTypes(); |
| 150 | if (installReturnCode != 0) |
| 151 | { |
| 152 | log::error("ERROR: ImageTypeSupport installation failed. "); |
| 153 | return installReturnCode; |
| 154 | } |
| 155 | } // end if !ImageTypeSupportInstalled |
| 156 | |
| 157 | log::info("Installing all components."); |
| 158 | |
| 159 | /** Fill the component database */ |
| 160 | installReturnCode = InstallAllComponents(this->m_ComponentDatabase); |
| 161 | |
| 162 | if (installReturnCode) |
| 163 | { |
| 164 | log::error("ERROR: Installing of at least one of components failed."); |
| 165 | return installReturnCode; |
| 166 | } |
| 167 | |
| 168 | log::info("InstallingComponents was successful.\n"); |
| 169 | |
| 170 | return 0; |
| 171 | |
| 172 | } // end LoadComponents |
| 173 | |
| 174 | } // end namespace elastix |
no test coverage detected