]> Creatis software - clitk.git/commitdiff
Conflict GDCM / private feature
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Mon, 25 Feb 2013 16:32:34 +0000 (17:32 +0100)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Mon, 25 Feb 2013 16:32:34 +0000 (17:32 +0100)
- Unregister GDCM and register it after clitk readers so it's called
after private features

common/clitkIO.cxx

index 8b159e7828bb13cbca487c20f517c7586ce47c1a..07af298b5563c35cbe99d62c1f30edf7fd4bf81f 100644 (file)
   #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<itk::GDCMImageIOFactory *>(*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
 } ////