From 7a2f0905ac66e1540f95dec067abadb303a3f84f Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Mon, 25 Feb 2013 17:32:34 +0100 Subject: [PATCH] Conflict GDCM / private feature - Unregister GDCM and register it after clitk readers so it's called after private features --- common/clitkIO.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 } //// -- 2.47.1