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