]> Creatis software - clitk.git/blob - segmentation/clitkExtractLymphStation_5.txx
motion masks with and without bands
[clitk.git] / segmentation / clitkExtractLymphStation_5.txx
1
2
3 //--------------------------------------------------------------------
4 template <class ImageType>
5 void 
6 clitk::ExtractLymphStationsFilter<ImageType>::
7 ExtractStation_5_SetDefaultValues()
8 {
9 }
10 //--------------------------------------------------------------------
11
12
13 //--------------------------------------------------------------------
14 template <class TImageType>
15 void 
16 clitk::ExtractLymphStationsFilter<TImageType>::
17 ExtractStation_5() {
18   if ((!CheckForStation("5")) && (!CheckForStation("5"))) return;
19
20   StartNewStep("Stations 5");
21   StartSubStep(); 
22
23   // Get the current support 
24   StartNewStep("[Station 5] Get the current 5 suppport");
25   m_ListOfStations["5"] = m_ListOfSupports["S5"];
26   StopCurrentStep<MaskImageType>(m_ListOfStations["5"]);
27     
28   // Generic RelativePosition processes
29   m_ListOfStations["5"] = this->ApplyRelativePositionList("Station_5", m_ListOfStations["5"]);
30
31   // Separation Ant/Post -> Like 4SL !
32   m_Working_Support = m_ListOfStations["5"];
33   ExtractStation_S4L_S5_Limits_Aorta_LeftPulmonaryArtery(-10);
34   m_ListOfStations["5"] = m_Working_Support;
35
36   // Ant limit
37   m_Working_Support = m_ListOfStations["5"];
38   ExtractStation_5_Limits_AscendingAorta_Ant();
39   m_ListOfStations["5"] = m_Working_Support;
40
41   // Keep only one single CCL by slice
42   StartNewStep("[Station 5] Keep only one CCL by slice");  
43   m_ListOfStations["5"] = SliceBySliceKeepMainCCL<MaskImageType>(m_ListOfStations["5"], 
44                                                                   GetBackgroundValue(), 
45                                                                   GetForegroundValue());
46
47   // AutoCrop
48   m_ListOfStations["5"] = clitk::AutoCrop<MaskImageType>(m_ListOfStations["5"], GetBackgroundValue());
49   StopCurrentStep<MaskImageType>(m_ListOfStations["5"]);
50
51   // Store image filenames into AFDB 
52   writeImage<MaskImageType>(m_ListOfStations["5"], "seg/Station5.mhd");
53   GetAFDB()->SetImageFilename("Station5", "seg/Station5.mhd"); 
54   WriteAFDB(); 
55   StopSubStep();
56
57 }
58 //--------------------------------------------------------------------
59
60
61 //--------------------------------------------------------------------
62 template <class TImageType>
63 void 
64 clitk::ExtractLymphStationsFilter<TImageType>::
65 ExtractStation_5_Limits_AscendingAorta_Ant() 
66 {
67   // ----------------------------------------------------------
68   StartNewStep("[Station 5] Limits with Ant part of AscendingAorta");
69
70   // Get AscendingAorta
71   MaskImagePointer AscendingAorta = GetAFDB()->template GetImage<MaskImageType>("AscendingAorta");
72
73   // Crop and select most Ant points
74   AscendingAorta = 
75     clitk::ResizeImageLike<MaskImageType>(AscendingAorta, m_Working_Support, GetBackgroundValue());
76   std::vector<MaskImagePointType> A;
77   std::vector<MaskImagePointType> B;
78   clitk::SliceBySliceBuildLineSegmentAccordingToExtremaPosition<MaskImageType>(AscendingAorta, 
79                                                                                GetBackgroundValue(), 
80                                                                                2, 1, true, 0, -1, A, B);
81   //1 mm margin
82
83   // Separate according to AB lines
84   // clitk::WriteListOfLandmarks<MaskImageType>(A, "A.txt");
85   // clitk::WriteListOfLandmarks<MaskImageType>(B, "B.txt");
86   clitk::SliceBySliceSetBackgroundFromLineSeparation<MaskImageType>(m_Working_Support, A, B,
87                                                                     GetBackgroundValue(), 
88                                                                     1, 10); // Keep point along axis 1
89   // End
90   StopCurrentStep<MaskImageType>(m_Working_Support);
91 }
92 //--------------------------------------------------------------------
93
94