]> Creatis software - clitk.git/blob - segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.h
Merge branch 'master' into GammaIndex3D
[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     itkSetMacro(AFDBFilename, std::string);
45     itkGetConstMacro(AFDBFilename, std::string);
46
47     itkSetMacro(AFDBPath, std::string);
48     itkGetConstMacro(AFDBPath, std::string);
49
50     itkGetConstMacro(DisplayUsedStructuresOnlyFlag, bool);
51     itkSetMacro(DisplayUsedStructuresOnlyFlag, bool);
52     itkBooleanMacro(DisplayUsedStructuresOnlyFlag);
53
54     void WriteAFDB();
55     void LoadAFDB();
56
57     AnatomicalFeatureDatabase::Pointer GetAFDB();
58     void SetAFDB(AnatomicalFeatureDatabase * a) { m_AFDB = a; }
59
60   protected:
61     FilterWithAnatomicalFeatureDatabaseManagement();
62     virtual ~FilterWithAnatomicalFeatureDatabaseManagement() {}    
63     
64     std::string m_AFDBFilename;
65     std::string m_AFDBPath;
66     clitk::AnatomicalFeatureDatabase::Pointer m_AFDB;
67
68     // For debug: display used structures but do not perform
69     // segmentation
70     bool m_DisplayUsedStructuresOnlyFlag;
71     void AddUsedStructures(std::string station, std::string structure);    
72
73   private:
74     FilterWithAnatomicalFeatureDatabaseManagement(const Self&); //purposely not implemented
75     void operator=(const Self&); //purposely not implemented
76     
77   }; // end class
78   //--------------------------------------------------------------------
79
80 } // end namespace clitk
81 //--------------------------------------------------------------------
82
83 #endif // CLITKFILTERWITHANATOMICALFEATUREDATABASEMANAGEMENT_H