]> Creatis software - clitk.git/blob - segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx
changes in license header
[clitk.git] / segmentation / clitkFilterWithAnatomicalFeatureDatabaseManagement.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 // clitk
20 #include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
21
22 //--------------------------------------------------------------------
23 clitk::FilterWithAnatomicalFeatureDatabaseManagement::
24 FilterWithAnatomicalFeatureDatabaseManagement() 
25 {
26   m_AFDB = NULL; 
27   SetAFDBFilename("default.afdb");
28 }
29 //--------------------------------------------------------------------
30
31
32 //--------------------------------------------------------------------
33 void clitk::FilterWithAnatomicalFeatureDatabaseManagement::WriteAFDB() 
34 {
35   GetAFDB()->SetFilename(GetAFDBFilename());
36   GetAFDB()->Write();
37 }
38 //--------------------------------------------------------------------
39
40     
41 //--------------------------------------------------------------------
42 void clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB() 
43 {
44   GetAFDB()->SetFilename(GetAFDBFilename());
45   try {
46     GetAFDB()->Load();
47   } catch (clitk::ExceptionObject e) {
48     std::cout << "Could not read '" << GetAFDBFilename() << "', create one AFDB." << std::endl;
49     GetAFDB();
50   }
51 }
52 //--------------------------------------------------------------------
53
54
55 //--------------------------------------------------------------------
56 clitk::AnatomicalFeatureDatabase * clitk::FilterWithAnatomicalFeatureDatabaseManagement::GetAFDB() 
57 {
58   if (m_AFDB == NULL) {
59     m_AFDB = new clitk::AnatomicalFeatureDatabase;
60   }
61   return m_AFDB;
62 }
63 //--------------------------------------------------------------------