]> Creatis software - clitk.git/blob - segmentation/clitkExtractLymphStation_3P.txx
effcd4fd6f51a88a6d407bd81faf0895c50b47c7
[clitk.git] / segmentation / clitkExtractLymphStation_3P.txx
1
2 #include <itkBinaryDilateImageFilter.h>
3 #include <itkMirrorPadImageFilter.h>
4
5 //--------------------------------------------------------------------
6 template <class ImageType>
7 void 
8 clitk::ExtractLymphStationsFilter<ImageType>::
9 ExtractStation_3P_SetDefaultValues()
10 {
11 }
12 //--------------------------------------------------------------------
13
14 //--------------------------------------------------------------------
15 template <class ImageType>
16 void 
17 clitk::ExtractLymphStationsFilter<ImageType>::
18 ExtractStation_3P_SI_Limits() 
19 {
20   /*
21     Apex of the chest & Carina.
22    */
23   StartNewStep("[Station 3P] Inf/Sup limits with apex of the chest and carina");
24
25   writeImage<MaskImageType>(m_Working_Support, "support.mhd");
26
27   // Get Carina position (has been determined in Station8)
28   m_CarinaZ = GetAFDB()->GetDouble("CarinaZ");
29   DD(m_CarinaZ);
30   
31   // Get Apex of the Chest
32   MaskImagePointer Lungs = GetAFDB()->template GetImage<MaskImageType>("Lungs");
33   DD("lung ok");
34   MaskImagePointType p;
35   bool found = clitk::FindExtremaPointInAGivenDirection<MaskImageType>(Lungs, 
36                                                                        GetBackgroundValue(), 
37                                                                        1, true, p);
38   DD(found);
39   DD(p);
40   double m_ApexOfTheChest = p[2];
41   DD(m_ApexOfTheChest);
42
43   /* Crop support :
44      Superior limit = carina
45      Inferior limit = Apex of the chest */
46   m_Working_Support = 
47     clitk::CropImageAlongOneAxis<MaskImageType>(m_Working_Support, 2, 
48                                                 m_ApexOfTheChest,
49                                                 m_CarinaZ, true,
50                                                 GetBackgroundValue());
51
52   StopCurrentStep<MaskImageType>(m_Working_Support);
53   m_ListOfStations["3P"] = m_Working_Support;
54 }
55 //--------------------------------------------------------------------