]> Creatis software - clitk.git/blob - segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.h
changes in license header
[clitk.git] / segmentation / clitkFilterWithAnatomicalFeatureDatabaseManagement.h
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 #ifndef CLITKFILTERWITHANATOMICALFEATUREDATABASEMANAGEMENT_H
20 #define CLITKFILTERWITHANATOMICALFEATUREDATABASEMANAGEMENT_H
21
22 // clitk
23 #include "clitkAnatomicalFeatureDatabase.h"
24 #include "clitkFilterBase.h"
25
26 namespace clitk {
27   
28   //--------------------------------------------------------------------
29   /*
30     - Convenient class to add AFDB capabilities to a filter 
31     - "virtual" inheritance is needed to avoir ambiguous inherited
32     functions
33   */
34   //--------------------------------------------------------------------
35   class FilterWithAnatomicalFeatureDatabaseManagement: public virtual FilterBase
36   {
37   public:
38     // Standard class typedefs
39     typedef FilterWithAnatomicalFeatureDatabaseManagement Self;
40     
41     // Run-time type information (and related methods)
42     itkTypeMacro(FilterWithAnatomicalFeatureDatabaseManagement, Object);
43
44     // Set/Get filename 
45     itkBooleanMacro(AFDBFilenameGivenFlag);
46     itkSetMacro(AFDBFilenameGivenFlag, bool);
47     itkGetConstMacro(AFDBFilenameGivenFlag, bool);
48     GGO_DefineOption_Flag(afdb, SetAFDBFilenameGivenFlag);
49
50     itkSetMacro(AFDBFilename, std::string);
51     itkGetConstMacro(AFDBFilename, std::string);
52     GGO_DefineOption_WithTest(afdb, SetAFDBFilename, std::string, AFDBFilenameGivenFlag);
53
54     void WriteAFDB();
55     void LoadAFDB();
56
57     AnatomicalFeatureDatabase * GetAFDB();
58     void SetAFDB(AnatomicalFeatureDatabase * a) { m_AFDB = a; }
59
60   protected:
61     FilterWithAnatomicalFeatureDatabaseManagement();
62     virtual ~FilterWithAnatomicalFeatureDatabaseManagement() {}    
63     
64     std::string m_AFDBFilename;
65     bool m_AFDBFilenameGivenFlag;
66     clitk::AnatomicalFeatureDatabase * m_AFDB;
67
68   private:
69     FilterWithAnatomicalFeatureDatabaseManagement(const Self&); //purposely not implemented
70     void operator=(const Self&); //purposely not implemented
71     
72   }; // end class
73   //--------------------------------------------------------------------
74
75 } // end namespace clitk
76 //--------------------------------------------------------------------
77
78 #endif // CLITKFILTERWITHANATOMICALFEATUREDATABASEMANAGEMENT_H