]> Creatis software - clitk.git/blob - segmentation/clitkTestStation7.h
Romulo:
[clitk.git] / segmentation / clitkTestStation7.h
1
2
3 //-----------------------------------
4
5 /*
6   - use DB from step to step or ExtractStation_7 mother class
7   - add "temporary flag" to DB to avoid write image 
8
9
10  */
11
12 //-----------------------------------
13 #include "clitkAnatomicalFeatureDatabase.h"
14
15 class SegmentationStepBase;
16
17 class LymphStationSegmentationFilterBase: 
18   public virtual clitk::FilterBase, 
19   public clitk::FilterWithAnatomicalFeatureDatabaseManagement {
20 public:
21   LymphStationSegmentationFilterBase() { DD("LymphStationSegmentationFilterBase const"); }
22
23   void AddStep(SegmentationStepBase * step) {
24     m_Steps.push_back(step);
25   }
26   
27   std::vector<SegmentationStepBase*> m_Steps;
28   // AnatomicalFeatureDatabase * GetAFDB();
29   
30   // HERE GetAFDB
31
32 };
33
34
35 //-----------------------------------
36
37
38 class SegmentationStepBase
39 {
40 public:
41   typedef itk::Image<unsigned char, 3>  ImageType;
42   typedef ImageType::PointType ImagePointType;
43
44   SegmentationStepBase(std::string name);
45   virtual void StartStep();  
46   void InitStep(LymphStationSegmentationFilterBase * p){
47     DD("SegmentationStepBase::InitStep");
48     parent = p;
49   }
50   std::string name;
51   LymphStationSegmentationFilterBase * parent;
52 };
53
54 SegmentationStepBase::SegmentationStepBase(std::string n) {
55   DD("SegmentationStepBase constructor");
56   name = n;
57   DD(name);
58 }
59
60 void SegmentationStepBase::StartStep() {
61   DD("Start step (verbose debug skip)");
62   DD(name);
63   // VERBOSE, DEBUG
64   // IF SKIP
65 }
66
67 //-----------------------------------
68
69 class ExtractStation7_APLimits:public SegmentationStepBase {
70 public:
71   typedef SegmentationStepBase Super;
72   ExtractStation7_APLimits():SegmentationStepBase("Step AP Limits") {}
73   virtual void StartStep();
74   // Accès au types  ==> Super::
75   // Accès au AFDB   ==> parent->
76
77   // TODO
78   // , support, image // herit ; how to set ? 
79   // ggo
80 };
81
82
83 void ExtractStation7_APLimits::StartStep() {
84   Super::StartStep(); // -> needed to verbose, debug, skip etc
85   DD("ExtractStation7_APLimits StartStep");
86   Super::ImagePointType carina;
87   parent->GetAFDB()->GetPoint3D("carina", carina);
88   DD(carina);
89   
90   // Writeimage
91 }
92
93 //-----------------------------------
94
95
96 // template <class TImageType>
97 class ExtractLymphStation_7:public LymphStationSegmentationFilterBase {
98 public:
99   ExtractLymphStation_7() {
100     DD("ExtractStation_7 constructor");    
101     // insert step (could be autolist if needed);
102     AddStep(new ExtractStation7_APLimits);
103   }
104
105   // SET GGO dont (AFDB);
106
107   void StartSegmentation() {
108     DD("ExtractStation_7 Start");    
109     // Loop on list of SegmentationStepBase
110     m_Steps[0]->InitStep(this); // parent (donc AFFB)
111     m_Steps[0]->StartStep();
112     // things todo after a step ? -> if writeimage, to be done inside
113     
114   }
115 };
116