3 //--------------------------------------------------------------------
4 template <class ImageType>
6 clitk::ExtractLymphStationsFilter<ImageType>::
7 ExtractStation_4RL_SetDefaultValues()
10 //--------------------------------------------------------------------
13 //--------------------------------------------------------------------
14 template <class TImageType>
16 clitk::ExtractLymphStationsFilter<TImageType>::
18 if (!CheckForStation("4R")) return;
19 StartNewStep("Stations 4R");
22 // Get the current support
23 StartNewStep("[Station 4R] Get the current 4RL suppport");
24 m_ListOfStations["4R"] = m_ListOfSupports["S4R"];
25 StopCurrentStep<MaskImageType>(m_ListOfStations["4R"]);
27 // Generic RelativePosition processes
28 m_ListOfStations["4R"] = this->ApplyRelativePositionList("Station_4R", m_ListOfStations["4R"]);
30 // Store image filenames into AFDB
31 WriteImageStation("4R");
33 ComputeOverlapWithRef("4R");
35 //--------------------------------------------------------------------
38 //--------------------------------------------------------------------
39 template <class TImageType>
41 clitk::ExtractLymphStationsFilter<TImageType>::
43 if (!CheckForStation("4L")) return;
44 StartNewStep("Stations 4L");
47 // Get the current support
48 StartNewStep("[Station 4L] Get the current 4RL suppport");
49 m_ListOfStations["4L"] = m_ListOfSupports["S4L"];
50 StopCurrentStep<MaskImageType>(m_ListOfStations["4L"]);
52 // Generic RelativePosition processes
53 m_ListOfStations["4L"] = this->ApplyRelativePositionList("Station_4L", m_ListOfStations["4L"]);
55 // Separation Ant/Post
56 m_Working_Support = m_ListOfStations["4L"];
57 ExtractStation_S4L_S5_Limits_Aorta_LeftPulmonaryArtery(10);
58 m_ListOfStations["4L"] = m_Working_Support;
60 // Keep only one single CCL by slice
61 StartNewStep("[Station 4L] Keep only one CCL by slice");
62 m_ListOfStations["4L"] = SliceBySliceKeepMainCCL<MaskImageType>(m_ListOfStations["4L"],
64 GetForegroundValue());
65 StopCurrentStep<MaskImageType>(m_ListOfStations["4L"]);
67 // Store image filenames into AFDB
68 WriteImageStation("4L");
70 ComputeOverlapWithRef("4L");
72 //--------------------------------------------------------------------
75 //--------------------------------------------------------------------
76 template <class TImageType>
78 clitk::ExtractLymphStationsFilter<TImageType>::
79 ExtractStation_S4L_S5_Limits_Aorta_LeftPulmonaryArtery(int KeepPoint)
81 // ----------------------------------------------------------
82 StartNewStep("[Station 4L] Limits between Asc and Desc Aorta, and with LeftPulmonaryArtery ");
84 // Separate Aorta into DescendingAorta AscendingAorta
85 MaskImagePointer AscendingAorta = GetAFDB()->template GetImage<MaskImageType>("AscendingAorta");
86 MaskImagePointer DescendingAorta = GetAFDB()->template GetImage<MaskImageType>("DescendingAorta");
88 // Crop like support (inferiorly)
89 m_Working_Support = clitk::AutoCrop<MaskImageType>(m_Working_Support, GetBackgroundValue());
91 clitk::ResizeImageLike<MaskImageType>(AscendingAorta, m_Working_Support, GetBackgroundValue());
93 clitk::ResizeImageLike<MaskImageType>(DescendingAorta, m_Working_Support, GetBackgroundValue());
95 // Crop superior part (when AscendingAorta and DescendingAorta join)
97 clitk::FindExtremaPointInAGivenDirection<MaskImageType>(AscendingAorta,
98 GetBackgroundValue(), 2, false, p);
99 double max = p[2]+AscendingAorta->GetSpacing()[2];
101 clitk::CropImageRemoveGreaterThan<MaskImageType>(AscendingAorta, 2, max, false, GetBackgroundValue());
103 clitk::CropImageRemoveGreaterThan<MaskImageType>(DescendingAorta, 2, max, false, GetBackgroundValue());
105 // Crop inferior part, where LeftPulmonaryArtery start
106 MaskImagePointer AscendingAortaCopy = clitk::Clone<MaskImageType>(AscendingAorta);
107 MaskImagePointer LeftPulmonaryArtery = GetAFDB()->template GetImage<MaskImageType>("LeftPulmonaryArtery");
108 clitk::FindExtremaPointInAGivenDirection<MaskImageType>(LeftPulmonaryArtery,
109 GetBackgroundValue(), 2, false, p);
110 max = p[2]+LeftPulmonaryArtery->GetSpacing()[2];
112 clitk::CropImageRemoveLowerThan<MaskImageType>(AscendingAorta, 2, max, false, GetBackgroundValue());
114 clitk::CropImageRemoveLowerThan<MaskImageType>(DescendingAorta, 2, max, false, GetBackgroundValue());
116 // Find closest points
117 std::vector<MaskImagePointType> A;
118 std::vector<MaskImagePointType> B;
119 clitk::SliceBySliceBuildLineSegmentAccordingToMinimalDistanceBetweenStructures<MaskImageType>(AscendingAorta,
121 GetBackgroundValue(),
123 // Separate according to AB lines
124 // clitk::WriteListOfLandmarks<MaskImageType>(A, "A.txt");
125 // clitk::WriteListOfLandmarks<MaskImageType>(B, "B.txt");
126 clitk::SliceBySliceSetBackgroundFromLineSeparation<MaskImageType>(m_Working_Support, A, B,
127 GetBackgroundValue(),
128 1, KeepPoint); // Keep point along axis 1
130 // Now, same principle between AscendingAorta and LeftPulmonaryArtery
132 clitk::ResizeImageLike<MaskImageType>(AscendingAortaCopy, m_Working_Support, GetBackgroundValue());
133 LeftPulmonaryArtery =
134 clitk::ResizeImageLike<MaskImageType>(LeftPulmonaryArtery, m_Working_Support, GetBackgroundValue());
136 clitk::CropImageRemoveGreaterThan<MaskImageType>(AscendingAorta, 2, max, false, GetBackgroundValue());
137 LeftPulmonaryArtery =
138 clitk::CropImageRemoveGreaterThan<MaskImageType>(LeftPulmonaryArtery, 2, max, false, GetBackgroundValue());
141 clitk::SliceBySliceBuildLineSegmentAccordingToMinimalDistanceBetweenStructures<MaskImageType>(AscendingAorta,
143 GetBackgroundValue(),
145 clitk::SliceBySliceSetBackgroundFromLineSeparation<MaskImageType>(m_Working_Support, A, B,
146 GetBackgroundValue(),
147 1, KeepPoint); // Keep point along axis 1
150 m_Working_Support = clitk::AutoCrop<MaskImageType>(m_Working_Support, GetBackgroundValue());
153 StopCurrentStep<MaskImageType>(m_Working_Support);
155 //--------------------------------------------------------------------