]> Creatis software - clitk.git/blob - common/clitkIO.cxx
Merge branch 'master' of git.creatis.insa-lyon.fr:clitk
[clitk.git] / common / clitkIO.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18
19 // std include
20 #include <iostream>
21 #include <fstream>
22
23 // itk include
24 #include "itkMacro.h"
25
26 // clitk include
27 #include "clitkIO.h"
28 #include "clitkImageCommon.h"
29 #include "clitkDicomRTDoseIOFactory.h"
30 #include "clitkVoxImageIOFactory.h"
31 #include "clitkVfImageIOFactory.h"
32 #include "clitkXdrImageIOFactory.h"
33 #include "rtkHisImageIOFactory.h"
34 #include "rtkHndImageIOFactory.h"
35 #include "rtkEdfImageIOFactory.h"
36 #include "rtkImagXImageIOFactory.h"
37 #include "clitkEsrfHstImageIOFactory.h"
38 #include "clitkGateAsciiImageIOFactory.h"
39 #include "clitkConfiguration.h"
40 #if CLITK_PRIVATE_FEATURES
41   #include "clitkUsfImageIOFactory.h"
42   #include "clitkUSVoxImageIOFactory.h"
43   #include "clitkSvlImageIOFactory.h"
44 #endif
45 #if ITK_VERSION_MAJOR >= 4
46   #include "itkGDCMImageIOFactory.h"
47 #endif
48
49 //--------------------------------------------------------------------
50 // Register factories
51 void clitk::RegisterClitkFactories()
52 {
53 #if ITK_VERSION_MAJOR >= 4
54   std::list< itk::ObjectFactoryBase * > fl = itk::GDCMImageIOFactory::GetRegisteredFactories();
55   for (std::list< itk::ObjectFactoryBase * >::iterator it = fl.begin(); it != fl.end(); ++it)
56     if (dynamic_cast<itk::GDCMImageIOFactory *>(*it))
57     {
58       itk::GDCMImageIOFactory::UnRegisterFactory(*it);
59       break;
60     }
61 #endif
62 #if CLITK_PRIVATE_FEATURES
63   clitk::UsfImageIOFactory::RegisterOneFactory();
64   clitk::USVoxImageIOFactory::RegisterOneFactory();
65   clitk::SvlImageIOFactory::RegisterOneFactory();
66 #endif
67   clitk::GateAsciiImageIOFactory::RegisterOneFactory();
68   clitk::DicomRTDoseIOFactory::RegisterOneFactory();
69 #if ITK_VERSION_MAJOR <= 3
70   itk::ImageIOFactory::RegisterBuiltInFactories();
71 #endif
72   clitk::VoxImageIOFactory::RegisterOneFactory();
73   clitk::VfImageIOFactory::RegisterOneFactory();
74   clitk::XdrImageIOFactory::RegisterOneFactory();
75   rtk::HisImageIOFactory::RegisterOneFactory();
76   rtk::HndImageIOFactory::RegisterOneFactory();
77   rtk::EdfImageIOFactory::RegisterOneFactory();
78   rtk::ImagXImageIOFactory::RegisterOneFactory();
79   clitk::EsrfHstImageIOFactory::RegisterOneFactory();
80 #if ITK_VERSION_MAJOR >= 4
81   itk::GDCMImageIOFactory::RegisterOneFactory();
82 #endif
83 } ////
84