]> Creatis software - clitk.git/blob - segmentation/clitkExtractLymphStation_Supports.txx
Merge commit '488f24aa984ae24adc9458bf5fbf3b2351415742'
[clitk.git] / segmentation / clitkExtractLymphStation_Supports.txx
1
2 #include <itkBinaryDilateImageFilter.h>
3 #include <itkMirrorPadImageFilter.h>
4
5 //--------------------------------------------------------------------
6 template <class ImageType>
7 void 
8 clitk::ExtractLymphStationsFilter<ImageType>::
9 ExtractStationSupports()
10 {
11   DD("ExtractStationSupports");
12
13   // Get initial Mediastinum
14   m_Working_Support = m_Mediastinum = GetAFDB()->template GetImage<MaskImageType>("Mediastinum", true);
15
16   // Superior limits: CricoidCartilag
17   // Inferior limits: lung
18   //  (the Mediastinum support already stop at this limit)
19
20   // Consider above Carina
21   m_CarinaZ = FindCarinaSlicePosition();
22   MaskImagePointer m_Support_Superior_to_Carina = 
23     clitk::CropImageRemoveLowerThan<MaskImageType>(m_Working_Support, 2, 
24                                                    m_CarinaZ, true, GetBackgroundValue());
25   MaskImagePointer m_Support_Inferior_to_Carina = 
26     clitk::CropImageRemoveGreaterThan<MaskImageType>(m_Working_Support, 2, 
27                                                      m_CarinaZ, true, GetBackgroundValue());
28
29   // Consider only Superior to Carina
30   m_Working_Support = m_Support_Superior_to_Carina;
31
32   // Step : S1RL
33   StartNewStep("[Support] sup-inf S1RL");
34   /*
35     Lower border: clavicles bilaterally and, in the midline, the upper
36     border of the manubrium, 1R designates right-sided nodes, 1L,
37     left-sided nodes in this region
38     
39     2R: Upper border: apex of the right lung and pleural space, and in
40     the midline, the upper border of the manubrium
41     
42     2L: Upper border: apex of the left lung and pleural space, and in the
43     midline, the upper border of the manubrium
44   */
45
46
47
48
49
50
51
52
53
54   // //  LeftRight cut along trachea
55   // MaskImagePointer Trachea = GetAFDB()->GetImage("Trachea");
56   // // build a ant-post line for each slice
57
58   // MaskImagePointer m_Support_SupRight = 
59   //   clitk::CropImageRemoveLowerThan<MaskImageType>(m_Working_Support, 2, 
60   //                                                  m_CarinaZ, true, GetBackgroundValue());
61
62
63
64
65
66   // Store image filenames into AFDB 
67   m_ListOfSupports["S1R"] = m_Working_Support;
68   writeImage<MaskImageType>(m_ListOfSupports["S1R"], "seg/Support_S1R.mhd");
69   GetAFDB()->SetImageFilename("Support_S1R", "seg/Support_S1R.mhd");
70   WriteAFDB();
71 }
72 //--------------------------------------------------------------------
73
74