]> Creatis software - clitk.git/blob - segmentation/clitkExtractLymphStation_3A.txx
merge cvs -> git
[clitk.git] / segmentation / clitkExtractLymphStation_3A.txx
1
2 //--------------------------------------------------------------------
3 template <class ImageType>
4 void 
5 clitk::ExtractLymphStationsFilter<ImageType>::
6 ExtractStation_3A_SetDefaultValues()
7 {
8   SetFuzzyThreshold("3A", "Sternum", 0.5);
9   SetFuzzyThreshold("3A", "SubclavianArtery", 0.5);
10 }
11 //--------------------------------------------------------------------
12
13
14 //--------------------------------------------------------------------
15 template <class ImageType>
16 void 
17 clitk::ExtractLymphStationsFilter<ImageType>::
18 ExtractStation_3A_SI_Limits() 
19 {
20   // Apex of the chest or Sternum & Carina.
21   StartNewStep("[Station 3A] Inf/Sup limits with Sternum and Carina");
22
23   // Get Carina position (has been determined in Station8)
24   m_CarinaZ = GetAFDB()->GetDouble("CarinaZ");
25   
26   // Get Sternum and search for the upper position
27   MaskImagePointer Sternum = GetAFDB()->template GetImage<MaskImageType>("Sternum");
28
29   // Search most sup point
30   MaskImagePointType ps = Sternum->GetOrigin(); // initialise to avoid warning 
31   clitk::FindExtremaPointInAGivenDirection<MaskImageType>(Sternum, GetBackgroundValue(), 2, false, ps);
32   double m_SternumZ = ps[2]+Sternum->GetSpacing()[2]; // One more slice, because it is below this point
33
34   //* Crop support :
35   m_Working_Support = 
36     clitk::CropImageAlongOneAxis<MaskImageType>(m_Working_Support, 2, 
37                                                 m_CarinaZ, m_SternumZ, true,
38                                                 GetBackgroundValue());
39
40   StopCurrentStep<MaskImageType>(m_Working_Support);
41   m_ListOfStations["3A"] = m_Working_Support;
42 }
43 //--------------------------------------------------------------------
44
45
46 //--------------------------------------------------------------------
47 template <class ImageType>
48 void 
49 clitk::ExtractLymphStationsFilter<ImageType>::
50 ExtractStation_3A_Ant_Limits() 
51 {
52   StartNewStep("[Station 3A] Ant limits with Sternum");
53
54   // Get Sternum, keep posterior part.
55   MaskImagePointer Sternum = GetAFDB()->template GetImage<MaskImageType>("Sternum");
56   m_Working_Support = 
57     clitk::SliceBySliceRelativePosition<MaskImageType>(m_Working_Support, Sternum, 2, 
58                                                        GetFuzzyThreshold("3A", "Sternum"), "PostTo", 
59                                                        false, 3, true, false);
60   StopCurrentStep<MaskImageType>(m_Working_Support);
61   m_ListOfStations["3A"] = m_Working_Support;
62 }
63 //--------------------------------------------------------------------
64
65
66 //--------------------------------------------------------------------
67 template <class ImageType>
68 void 
69 clitk::ExtractLymphStationsFilter<ImageType>::
70 ExtractStation_3A_Post_Limits() 
71 {
72   StartNewStep("[Station 3A] Post limits with SubclavianArtery");
73
74   // Get Sternum, keep posterior part.
75   MaskImagePointer SubclavianArtery = GetAFDB()->template GetImage<MaskImageType>("SubclavianArtery");
76   m_Working_Support = 
77     clitk::SliceBySliceRelativePosition<MaskImageType>(m_Working_Support, SubclavianArtery, 2, 
78                                                        GetFuzzyThreshold("3A", "SubclavianArtery"), "AntTo", 
79                                                        false, 3, true, false);
80   StopCurrentStep<MaskImageType>(m_Working_Support);
81   m_ListOfStations["3A"] = m_Working_Support;
82 }
83 //--------------------------------------------------------------------
84
85