From: Vivien Delmon Date: Mon, 25 Feb 2013 16:32:34 +0000 (+0100) Subject: Conflict GDCM / private feature X-Git-Tag: v1.4.0~236^2~9 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7a2f0905ac66e1540f95dec067abadb303a3f84f;p=clitk.git Conflict GDCM / private feature - Unregister GDCM and register it after clitk readers so it's called after private features --- diff --git a/common/clitkIO.cxx b/common/clitkIO.cxx index 8b159e7..07af298 100644 --- a/common/clitkIO.cxx +++ b/common/clitkIO.cxx @@ -42,11 +42,23 @@ #include "clitkUSVoxImageIOFactory.h" #include "clitkSvlImageIOFactory.h" #endif +#if ITK_VERSION_MAJOR >= 4 + #include "itkGDCMImageIOFactory.h" +#endif //-------------------------------------------------------------------- // Register factories void clitk::RegisterClitkFactories() { +#if ITK_VERSION_MAJOR >= 4 + std::list< itk::ObjectFactoryBase * > fl = itk::GDCMImageIOFactory::GetRegisteredFactories(); + for (std::list< itk::ObjectFactoryBase * >::iterator it = fl.begin(); it != fl.end(); ++it) + if (dynamic_cast(*it)) + { + itk::GDCMImageIOFactory::UnRegisterFactory(*it); + break; + } +#endif #if CLITK_PRIVATE_FEATURES clitk::UsfImageIOFactory::RegisterOneFactory(); clitk::USVoxImageIOFactory::RegisterOneFactory(); @@ -65,5 +77,8 @@ void clitk::RegisterClitkFactories() rtk::EdfImageIOFactory::RegisterOneFactory(); rtk::ImagXImageIOFactory::RegisterOneFactory(); clitk::EsrfHstImageIOFactory::RegisterOneFactory(); +#if ITK_VERSION_MAJOR >= 4 + itk::GDCMImageIOFactory::RegisterOneFactory(); +#endif } ////