]> Creatis software - clitk.git/commitdiff
inverted IO reader order to solve a bug with vox files
authorBenoît Presles <benoit.presles@creatis.insa-lyon.fr>
Wed, 27 Nov 2013 09:54:56 +0000 (10:54 +0100)
committerBenoît Presles <benoit.presles@creatis.insa-lyon.fr>
Wed, 27 Nov 2013 09:54:56 +0000 (10:54 +0100)
common/clitkIO.cxx

index 5c5977baa4fb7326da551a662a1ab44c1cf35459..aa42db89ea2998a3df138f18a8cc5e1de565d2d3 100644 (file)
@@ -45,6 +45,7 @@
 #endif
 #if ITK_VERSION_MAJOR >= 4
   #include "itkGDCMImageIOFactory.h"
+  #include "itkPNGImageIOFactory.h"
 #endif
 
 //--------------------------------------------------------------------
@@ -59,6 +60,14 @@ void clitk::RegisterClitkFactories()
       itk::GDCMImageIOFactory::UnRegisterFactory(*it);
       break;
     }
+
+  std::list< itk::ObjectFactoryBase * > flpng = itk::PNGImageIOFactory::GetRegisteredFactories();
+  for (std::list< itk::ObjectFactoryBase * >::iterator it = flpng.begin(); it != flpng.end(); ++it)
+    if (dynamic_cast<itk::PNGImageIOFactory *>(*it))
+    {
+      itk::PNGImageIOFactory::UnRegisterFactory(*it);
+      break;
+    }
 #endif
 #if CLITK_PRIVATE_FEATURES
   clitk::UsfImageIOFactory::RegisterOneFactory();
@@ -81,6 +90,7 @@ void clitk::RegisterClitkFactories()
   clitk::EsrfHstImageIOFactory::RegisterOneFactory();
 #if ITK_VERSION_MAJOR >= 4
   itk::GDCMImageIOFactory::RegisterOneFactory();
+  itk::PNGImageIOFactory::RegisterOneFactory();
 #endif
 } ////