2 //--------------------------------------------------------------------
3 template <class TImageType>
5 clitk::ExtractLymphStationsFilter<TImageType>::
6 ExtractStation_7_SetDefaultValues()
8 SetFuzzyThreshold("7", "Bronchi", 0.1);
9 SetFuzzyThreshold("7", "LeftSuperiorPulmonaryVein", 0.3);
10 SetFuzzyThreshold("7", "RightSuperiorPulmonaryVein", 0.2);
11 SetFuzzyThreshold("7", "RightPulmonaryArtery", 0.3);
12 SetFuzzyThreshold("7", "LeftPulmonaryArtery", 0.5);
13 SetFuzzyThreshold("7", "SVC", 0.2);
14 SetS7_UseMostInferiorPartOnlyFlag(false);
16 //--------------------------------------------------------------------
19 //--------------------------------------------------------------------
20 template <class TImageType>
22 clitk::ExtractLymphStationsFilter<TImageType>::
24 if (CheckForStation("7")) {
25 ExtractStation_7_SI_Limits();
26 ExtractStation_7_RL_Interior_Limits();
28 // ExtractStation_7_Posterior_Limits();
29 ExtractStation_8_Single_CCL_Limits();
30 ExtractStation_7_Remove_Structures();
31 // Store image filenames into AFDB
32 writeImage<MaskImageType>(m_ListOfStations["7"], "seg/Station7.mhd");
33 GetAFDB()->SetImageFilename("Station7", "seg/Station7.mhd");
37 //--------------------------------------------------------------------
40 //--------------------------------------------------------------------
41 template <class TImageType>
43 clitk::ExtractLymphStationsFilter<TImageType>::
44 ExtractStation_7_SI_Limits()
46 StartNewStep("[Station7] Inf/Sup mediastinum limits with carina/LLL-RMLBronchus");
48 MaskImagePointer Trachea = GetAFDB()->template GetImage <MaskImageType>("Trachea");
50 // Create line from A to B with
51 // A = upper border of LLL at left
52 // B = lower border of bronchus intermedius (BI) or RightMiddleLobeBronchus
55 FindLineForS7S8Separation(A, B);
57 // // if option -> replace A[0] with B[0]
58 // if (GetS7_UseMostInferiorPartOnlyFlag()) {
62 // Use line to remove the inferior part
64 SliceBySliceSetBackgroundFromSingleLine<MaskImageType>(m_Working_Support, GetBackgroundValue(),
67 // Get the CarinaZ position
68 double m_CarinaZ = FindCarina();
72 clitk::CropImageAlongOneAxis<MaskImageType>(m_Working_Support, 2,
73 A[2], m_CarinaZ, true,
74 GetBackgroundValue());
77 clitk::CropImageAlongOneAxis<MaskImageType>(Trachea, 2,
78 A[2], m_CarinaZ, true,
79 GetBackgroundValue());
81 StopCurrentStep<MaskImageType>(m_Working_Support);
82 m_ListOfStations["7"] = m_Working_Support;
84 //--------------------------------------------------------------------
87 //--------------------------------------------------------------------
88 template <class TImageType>
90 clitk::ExtractLymphStationsFilter<TImageType>::
91 ExtractStation_7_RL_Interior_Limits()
93 // ----------------------------------------------------------------
94 StartNewStep("[Station7] RL limits with bronchi");
97 Slice by Slice, consider most Left point of the Right
98 bronchus. Remove the Ant/Right corner
101 // First consider bronchi
102 FindLeftAndRightBronchi();
103 m_RightBronchus = GetAFDB()->template GetImage <MaskImageType>("RightBronchus");
104 m_LeftBronchus = GetAFDB()->template GetImage <MaskImageType>("LeftBronchus");
106 // Resize like m_Working_Support
108 clitk::ResizeImageLike<MaskImageType>(m_LeftBronchus, m_Working_Support, GetBackgroundValue());
110 clitk::ResizeImageLike<MaskImageType>(m_RightBronchus, m_Working_Support, GetBackgroundValue());
112 // Extract slices, Label, compute centroid, keep most central connected component
113 std::vector<MaskSlicePointer> slices_leftbronchus;
114 std::vector<MaskSlicePointer> slices_rightbronchus;
115 std::vector<MaskSlicePointer> slices_support;
116 clitk::ExtractSlices<MaskImageType>(m_LeftBronchus, 2, slices_leftbronchus);
117 clitk::ExtractSlices<MaskImageType>(m_RightBronchus, 2, slices_rightbronchus);
118 clitk::ExtractSlices<MaskImageType>(m_Working_Support, 2, slices_support);
120 // Keep only the CCL of the bronchus with the closest to the center
121 // Loop on slices for left bronchus
122 for(uint i=0; i<slices_leftbronchus.size(); i++) {
123 slices_leftbronchus[i] = Labelize<MaskSliceType>(slices_leftbronchus[i], 0, false, 10);
124 std::vector<typename MaskSliceType::PointType> c;
125 clitk::ComputeCentroids<MaskSliceType>(slices_leftbronchus[i], GetBackgroundValue(), c);
127 double most_at_left = c[1][0];
128 int most_at_left_index=1;
129 for(uint j=1; j<c.size(); j++) {
130 if (c[j][0] < most_at_left) {
131 most_at_left = c[j][0];
132 most_at_left_index = j;
135 // Put all other CCL to Background
136 slices_leftbronchus[i] =
137 clitk::Binarize<MaskSliceType>(slices_leftbronchus[i], most_at_left_index,
138 most_at_left_index, GetBackgroundValue(), GetForegroundValue());
142 // Loop on slices for right bronchus
143 for(uint i=0; i<slices_rightbronchus.size(); i++) {
144 slices_rightbronchus[i] = Labelize<MaskSliceType>(slices_rightbronchus[i], 0, false, 10);
145 std::vector<typename MaskSliceType::PointType> c;
146 clitk::ComputeCentroids<MaskSliceType>(slices_rightbronchus[i], GetBackgroundValue(), c);
148 double most_at_right = c[1][0];
149 int most_at_right_index=1;
150 for(uint j=1; j<c.size(); j++) {
151 if (c[j][0] > most_at_right) {
152 most_at_right = c[j][0];
153 most_at_right_index = j;
156 // Put all other CCL to Background
157 slices_rightbronchus[i] =
158 clitk::Binarize<MaskSliceType>(slices_rightbronchus[i], most_at_right_index,
159 most_at_right_index, GetBackgroundValue(), GetForegroundValue());
164 m_LeftBronchus = clitk::JoinSlices<MaskImageType>(slices_leftbronchus, m_LeftBronchus, 2);
165 m_RightBronchus = clitk::JoinSlices<MaskImageType>(slices_rightbronchus, m_RightBronchus, 2);
167 // For Right bronchus, Find most Left point. Remove corner Ant/Right corner
168 for(uint i=0; i<slices_rightbronchus.size(); i++) {
169 // Find most point most at left
170 MaskSlicePointType p_left;
171 MaskSlicePointType p_post;
172 bool b = clitk::FindExtremaPointInAGivenDirection<MaskSliceType>(slices_rightbronchus[i], GetBackgroundValue(), 0, false, p_left);
174 b = clitk::FindExtremaPointInAGivenDirection<MaskSliceType>(slices_rightbronchus[i], GetBackgroundValue(), 1, false, p_post);
177 MaskSlicePointType p = p_left;
179 MaskSliceIndexType pi;
180 slices_rightbronchus[i]->TransformPhysicalPointToIndex(p, pi);
182 // Build region to remove
183 MaskSliceRegionType region = slices_rightbronchus[i]->GetLargestPossibleRegion();
184 MaskSliceIndexType index = region.GetIndex();
185 MaskSliceSizeType size = region.GetSize();
186 size[0] = pi[0] - index[0];
187 size[1] = pi[1] - index[1];
188 region.SetSize(size);
190 // Fill region with Background value
191 clitk::FillRegionWithValue<MaskSliceType>(slices_support[i], GetBackgroundValue(), region);
195 // For Left bronchus, Find most Right point. Remove corner Ant/Left corner
196 for(uint i=0; i<slices_leftbronchus.size(); i++) {
197 // Find most point most at right
198 MaskSlicePointType p_right;
199 MaskSlicePointType p_post;
200 bool b = clitk::FindExtremaPointInAGivenDirection<MaskSliceType>(slices_leftbronchus[i], GetBackgroundValue(), 0, true, p_right);
202 b = clitk::FindExtremaPointInAGivenDirection<MaskSliceType>(slices_rightbronchus[i], GetBackgroundValue(), 1, false, p_post);
205 MaskSlicePointType p = p_right;
207 MaskSliceIndexType pi;
208 slices_leftbronchus[i]->TransformPhysicalPointToIndex(p, pi);
210 /* typedef itk::ImageRegionIterator<ImageType> IteratorType;
211 IteratorType iter(input, region);
213 while (!iter.IsAtEnd()) {
214 MaskSliceIndexType index = iter.GetIndex();
215 if (index[0] > pi[0]) && (index[1] > pi[1]) iter.Set(GetBackgroundValue());
222 // Build region to remove
223 MaskSliceRegionType region = slices_leftbronchus[i]->GetLargestPossibleRegion();
224 MaskSliceIndexType index = region.GetIndex();
225 MaskSliceSizeType size = region.GetSize();
227 size[0] = slices_leftbronchus[i]->GetLargestPossibleRegion().GetSize()[0] - pi[0];
228 size[1] = pi[1] - index[1];
229 region.SetSize(size);
230 region.SetIndex(index);
232 // Fill region with Background value
233 clitk::FillRegionWithValue<MaskSliceType>(slices_support[i], GetBackgroundValue(), region);
237 m_Working_Support = clitk::JoinSlices<MaskImageType>(slices_support, m_Working_Support, 2);
239 // Also remove what is at right of the Right bronchus (left respectively)
241 clitk::SliceBySliceRelativePosition<MaskImageType>(m_Working_Support, m_LeftBronchus, 2,
242 GetFuzzyThreshold("7", "Bronchi"), "NotLeftTo",
245 clitk::SliceBySliceRelativePosition<MaskImageType>(m_Working_Support, m_RightBronchus, 2,
246 GetFuzzyThreshold("7", "Bronchi"), "NotRightTo",
251 StopCurrentStep<MaskImageType>(m_Working_Support);
253 //--------------------------------------------------------------------
256 //--------------------------------------------------------------------
257 template <class TImageType>
259 clitk::ExtractLymphStationsFilter<TImageType>::
260 ExtractStation_7_RL_Limits_OLD()
262 // ----------------------------------------------------------------
263 StartNewStep("[Station7] Limits with bronchus : RightTo the left bronchus");
265 // First consider bronchus and keep the main CCL by slice
266 m_RightBronchus = GetAFDB()->template GetImage <MaskImageType>("RightBronchus");
267 m_LeftBronchus = GetAFDB()->template GetImage <MaskImageType>("LeftBronchus");
269 // Extract slices, Label, compute centroid, keep most central connected component
270 std::vector<MaskSlicePointer> slices_leftbronchus;
271 std::vector<MaskSlicePointer> slices_rightbronchus;
272 clitk::ExtractSlices<MaskImageType>(m_LeftBronchus, 2, slices_leftbronchus);
273 clitk::ExtractSlices<MaskImageType>(m_RightBronchus, 2, slices_rightbronchus);
275 // Version #1 with limit = centroid of the bronchus (OUTDATED)
276 // Step1 = keep only the CCL of the bronchus with the closest to the center
277 // Step2 = SliceBySlice Rel pos to both bronchi
280 for(uint i=0; i<slices_leftbronchus.size(); i++) {
281 slices_leftbronchus[i] = Labelize<MaskSliceType>(slices_leftbronchus[i], 0, false, 10);
282 std::vector<typename MaskSliceType::PointType> c;
283 clitk::ComputeCentroids<MaskSliceType>(slices_leftbronchus[i], GetBackgroundValue(), c);
285 double most_at_left = c[1][0];
286 int most_at_left_index=1;
287 for(uint j=1; j<c.size(); j++) {
288 if (c[j][0] < most_at_left) {
289 most_at_left = c[j][0];
290 most_at_left_index = j;
293 // Put all other CCL to Background
294 slices_leftbronchus[i] =
295 clitk::Binarize<MaskSliceType>(slices_leftbronchus[i], most_at_left_index,
296 most_at_left_index, GetBackgroundValue(), GetForegroundValue());
300 for(uint i=0; i<slices_rightbronchus.size(); i++) {
301 slices_rightbronchus[i] = Labelize<MaskSliceType>(slices_rightbronchus[i], 0, false, 10);
302 std::vector<typename MaskSliceType::PointType> c;
303 clitk::ComputeCentroids<MaskSliceType>(slices_rightbronchus[i], GetBackgroundValue(), c);
305 double most_at_right = c[1][0];
306 int most_at_right_index=1;
307 for(uint j=1; j<c.size(); j++) {
308 if (c[j][0] > most_at_right) {
309 most_at_right = c[j][0];
310 most_at_right_index = j;
313 // Put all other CCL to Background
314 slices_rightbronchus[i] =
315 clitk::Binarize<MaskSliceType>(slices_rightbronchus[i], most_at_right_index,
316 most_at_right_index, GetBackgroundValue(), GetForegroundValue());
321 m_LeftBronchus = clitk::JoinSlices<MaskImageType>(slices_leftbronchus, m_LeftBronchus, 2);
322 m_RightBronchus = clitk::JoinSlices<MaskImageType>(slices_rightbronchus, m_RightBronchus, 2);
324 writeImage<MaskImageType>(m_LeftBronchus, "step-left.mhd");
325 writeImage<MaskImageType>(m_RightBronchus, "step-right.mhd");
328 clitk::SliceBySliceRelativePosition<MaskImageType>(m_Working_Support, m_LeftBronchus, 2,
329 GetFuzzyThreshold("7", "Bronchi"), "RightTo",
331 StopCurrentStep<MaskImageType>(m_Working_Support);
334 // ----------------------------------------------------------------
335 StartNewStep("[Station7] Limits with bronchus : LeftTo the right bronchus");
337 clitk::SliceBySliceRelativePosition<MaskImageType>(m_Working_Support, m_RightBronchus, 2,
338 GetFuzzyThreshold("7", "Bronchi"), "LeftTo",
340 StopCurrentStep<MaskImageType>(m_Working_Support);
343 // ----------------------------------------------------------------
344 StartNewStep("[Station7] Limits with LeftSuperiorPulmonaryVein");
346 MaskImagePointer LeftSuperiorPulmonaryVein = GetAFDB()->template GetImage<MaskImageType>("LeftSuperiorPulmonaryVein");
347 typedef SliceBySliceRelativePositionFilter<MaskImageType> SliceRelPosFilterType;
348 typename SliceRelPosFilterType::Pointer sliceRelPosFilter = SliceRelPosFilterType::New();
349 sliceRelPosFilter->SetInput(m_Working_Support);
350 sliceRelPosFilter->SetInputObject(LeftSuperiorPulmonaryVein);
351 sliceRelPosFilter->SetDirection(2);
352 sliceRelPosFilter->SetFuzzyThreshold(GetFuzzyThreshold("7", "LeftSuperiorPulmonaryVein"));
353 sliceRelPosFilter->AddOrientationTypeString("NotLeftTo");
354 sliceRelPosFilter->AddOrientationTypeString("NotAntTo");
355 sliceRelPosFilter->SetIntermediateSpacingFlag(true);
356 sliceRelPosFilter->SetIntermediateSpacing(3);
357 sliceRelPosFilter->SetUniqueConnectedComponentBySliceFlag(false);
358 sliceRelPosFilter->SetAutoCropFlag(false);
359 sliceRelPosFilter->IgnoreEmptySliceObjectFlagOn();
360 sliceRelPosFilter->Update();
361 m_Working_Support = sliceRelPosFilter->GetOutput();
362 StopCurrentStep<MaskImageType>(m_Working_Support);
364 catch (clitk::ExceptionObject e) {
365 std::cout << "Not LeftSuperiorPulmonaryVein, skip" << std::endl;
368 // ----------------------------------------------------------------
369 StartNewStep("[Station7] Limits with RightSuperiorPulmonaryVein");
371 MaskImagePointer RightSuperiorPulmonaryVein = GetAFDB()->template GetImage<MaskImageType>("RightSuperiorPulmonaryVein");
372 typedef SliceBySliceRelativePositionFilter<MaskImageType> SliceRelPosFilterType;
373 typename SliceRelPosFilterType::Pointer sliceRelPosFilter = SliceRelPosFilterType::New();
374 sliceRelPosFilter->SetInput(m_Working_Support);
375 sliceRelPosFilter->SetInputObject(RightSuperiorPulmonaryVein);
376 sliceRelPosFilter->SetDirection(2);
377 sliceRelPosFilter->SetFuzzyThreshold(GetFuzzyThreshold("7", "RightSuperiorPulmonaryVein"));
378 sliceRelPosFilter->AddOrientationTypeString("NotRightTo");
379 sliceRelPosFilter->AddOrientationTypeString("NotAntTo");
380 sliceRelPosFilter->AddOrientationTypeString("NotPostTo");
381 sliceRelPosFilter->SetIntermediateSpacingFlag(true);
382 sliceRelPosFilter->SetIntermediateSpacing(3);
383 sliceRelPosFilter->SetUniqueConnectedComponentBySliceFlag(false);
384 sliceRelPosFilter->SetAutoCropFlag(false);
385 sliceRelPosFilter->IgnoreEmptySliceObjectFlagOn();
386 sliceRelPosFilter->Update();
387 m_Working_Support = sliceRelPosFilter->GetOutput();
388 StopCurrentStep<MaskImageType>(m_Working_Support);
390 catch (clitk::ExceptionObject e) {
391 std::cout << "Not RightSuperiorPulmonaryVein, skip" << std::endl;
394 // ----------------------------------------------------------------
395 StartNewStep("[Station7] Limits with RightPulmonaryArtery");
396 MaskImagePointer RightPulmonaryArtery = GetAFDB()->template GetImage<MaskImageType>("RightPulmonaryArtery");
397 typedef SliceBySliceRelativePositionFilter<MaskImageType> SliceRelPosFilterType;
398 typename SliceRelPosFilterType::Pointer sliceRelPosFilter = SliceRelPosFilterType::New();
399 sliceRelPosFilter->SetInput(m_Working_Support);
400 sliceRelPosFilter->SetInputObject(RightPulmonaryArtery);
401 sliceRelPosFilter->SetDirection(2);
402 sliceRelPosFilter->SetFuzzyThreshold(GetFuzzyThreshold("7", "RightPulmonaryArtery"));
403 sliceRelPosFilter->AddOrientationTypeString("NotAntTo");
404 sliceRelPosFilter->SetIntermediateSpacingFlag(true);
405 sliceRelPosFilter->SetIntermediateSpacing(3);
406 sliceRelPosFilter->SetUniqueConnectedComponentBySliceFlag(false);
407 sliceRelPosFilter->SetAutoCropFlag(false);
408 sliceRelPosFilter->IgnoreEmptySliceObjectFlagOn();
409 sliceRelPosFilter->Update();
410 m_Working_Support = sliceRelPosFilter->GetOutput();
411 StopCurrentStep<MaskImageType>(m_Working_Support);
413 // ----------------------------------------------------------------
414 StartNewStep("[Station7] Limits with LeftPulmonaryArtery");
415 MaskImagePointer LeftPulmonaryArtery = GetAFDB()->template GetImage<MaskImageType>("LeftPulmonaryArtery");
416 sliceRelPosFilter = SliceRelPosFilterType::New();
417 sliceRelPosFilter->SetInput(m_Working_Support);
418 sliceRelPosFilter->SetInputObject(LeftPulmonaryArtery);
419 sliceRelPosFilter->SetDirection(2);
420 sliceRelPosFilter->SetFuzzyThreshold(GetFuzzyThreshold("7", "LeftPulmonaryArtery"));
421 sliceRelPosFilter->AddOrientationTypeString("NotAntTo");
422 sliceRelPosFilter->SetIntermediateSpacingFlag(true);
423 sliceRelPosFilter->SetIntermediateSpacing(3);
424 sliceRelPosFilter->SetUniqueConnectedComponentBySliceFlag(false);
425 sliceRelPosFilter->SetAutoCropFlag(false);
426 sliceRelPosFilter->IgnoreEmptySliceObjectFlagOn();
427 sliceRelPosFilter->Update();
428 m_Working_Support = sliceRelPosFilter->GetOutput();
429 StopCurrentStep<MaskImageType>(m_Working_Support);
431 StartNewStep("[Station7] Limits with SVC");
432 MaskImagePointer SVC = GetAFDB()->template GetImage<MaskImageType>("SVC");
433 sliceRelPosFilter = SliceRelPosFilterType::New();
434 sliceRelPosFilter->SetInput(m_Working_Support);
435 sliceRelPosFilter->SetInputObject(SVC);
436 sliceRelPosFilter->SetDirection(2);
437 sliceRelPosFilter->SetFuzzyThreshold(GetFuzzyThreshold("7", "SVC"));
438 sliceRelPosFilter->AddOrientationTypeString("NotRightTo");
439 sliceRelPosFilter->AddOrientationTypeString("NotAntTo");
440 sliceRelPosFilter->SetIntermediateSpacingFlag(true);
441 sliceRelPosFilter->SetIntermediateSpacing(3);
442 sliceRelPosFilter->SetUniqueConnectedComponentBySliceFlag(false);
443 sliceRelPosFilter->SetAutoCropFlag(true);
444 sliceRelPosFilter->IgnoreEmptySliceObjectFlagOn();
445 sliceRelPosFilter->Update();
446 m_Working_Support = sliceRelPosFilter->GetOutput();
447 StopCurrentStep<MaskImageType>(m_Working_Support);
450 m_ListOfStations["7"] = m_Working_Support;
452 //--------------------------------------------------------------------
455 //--------------------------------------------------------------------
456 template <class TImageType>
458 clitk::ExtractLymphStationsFilter<TImageType>::
459 ExtractStation_7_Posterior_Limits()
461 StartNewStep("[Station7] Posterior limits -> must be AntTo post wall of the bronchi (OLD CLASSIF)");
463 // Search for points that are the most left/post/ant and most
464 // right/post/ant of the left and right bronchus
466 // extract, loop slices, label/keep, find extrema x 3
467 /* FindExtremaPointsInBronchus(m_LeftBronchus, 0, 15, m_RightMostInLeftBronchus,
468 m_AntMostInLeftBronchus, m_PostMostInLeftBronchus);
469 FindExtremaPointsInBronchus(m_RightBronchus, 1, 15, m_LeftMostInRightBronchus,
470 m_AntMostInRightBronchus, m_PostMostInRightBronchus);
473 // First cut bronchus to the correct sup/inf support
474 MaskImagePointer RightBronchus = clitk::ResizeImageLike<MaskImageType>(m_RightBronchus, m_Working_Support, GetBackgroundValue());
475 MaskImagePointer LeftBronchus = clitk::ResizeImageLike<MaskImageType>(m_LeftBronchus, m_Working_Support, GetBackgroundValue());
477 // Find extrema points
478 FindExtremaPointsInBronchus(RightBronchus, 0, 10, m_LeftMostInRightBronchus,
479 m_AntMostInRightBronchus, m_PostMostInRightBronchus);
481 FindExtremaPointsInBronchus(LeftBronchus, 1, 10, m_RightMostInLeftBronchus,
482 m_AntMostInLeftBronchus, m_PostMostInLeftBronchus);
487 std::ofstream osrl; openFileForWriting(osrl, "osrl.txt"); osrl << "LANDMARKS1" << std::endl;
488 std::ofstream osal; openFileForWriting(osal, "osal.txt"); osal << "LANDMARKS1" << std::endl;
489 std::ofstream ospl; openFileForWriting(ospl, "ospl.txt"); ospl << "LANDMARKS1" << std::endl;
490 std::ofstream osrr; openFileForWriting(osrr, "osrr.txt"); osrr << "LANDMARKS1" << std::endl;
491 std::ofstream osar; openFileForWriting(osar, "osar.txt"); osar << "LANDMARKS1" << std::endl;
492 std::ofstream ospr; openFileForWriting(ospr, "ospr.txt"); ospr << "LANDMARKS1" << std::endl;
494 for(uint i=0; i<m_RightMostInLeftBronchus.size(); i++) {
495 osrl << i << " " << m_RightMostInLeftBronchus[i][0] << " " << m_RightMostInLeftBronchus[i][1]
496 << " " << m_RightMostInLeftBronchus[i][2] << " 0 0 " << std::endl;
497 osal << i << " " << m_AntMostInLeftBronchus[i][0] << " " << m_AntMostInLeftBronchus[i][1]
498 << " " << m_AntMostInLeftBronchus[i][2] << " 0 0 " << std::endl;
499 ospl << i << " " << m_PostMostInLeftBronchus[i][0] << " " << m_PostMostInLeftBronchus[i][1]
500 << " " << m_PostMostInLeftBronchus[i][2] << " 0 0 " << std::endl;
503 for(uint i=0; i<m_LeftMostInRightBronchus.size(); i++) {
504 osrr << i << " " << m_LeftMostInRightBronchus[i][0] << " " << m_LeftMostInRightBronchus[i][1]
505 << " " << m_LeftMostInRightBronchus[i][2] << " 0 0 " << std::endl;
506 osar << i << " " << m_AntMostInRightBronchus[i][0] << " " << m_AntMostInRightBronchus[i][1]
507 << " " << m_AntMostInRightBronchus[i][2] << " 0 0 " << std::endl;
508 ospr << i << " " << m_PostMostInRightBronchus[i][0] << " " << m_PostMostInRightBronchus[i][1]
509 << " " << m_PostMostInRightBronchus[i][2] << " 0 0 " << std::endl;
518 clitk::SliceBySliceSetBackgroundFromLineSeparation<MaskImageType>(m_Working_Support,
519 m_PostMostInRightBronchus,
520 m_PostMostInLeftBronchus,
521 GetBackgroundValue(), 1, -10);
522 // If needed -> can do the same with AntMost.
525 StopCurrentStep<MaskImageType>(m_Working_Support);
526 m_ListOfStations["7"] = m_Working_Support;
528 //--------------------------------------------------------------------
530 //--------------------------------------------------------------------
531 template <class ImageType>
533 clitk::ExtractLymphStationsFilter<ImageType>::
534 ExtractStation_7_Remove_Structures()
537 //--------------------------------------------------------------------
538 StartNewStep("[Station7] remove some structures");
540 Remove_Structures("7", "AzygousVein");
541 Remove_Structures("7", "Aorta");
542 Remove_Structures("7", "RightPulmonaryArtery");
543 Remove_Structures("7", "LeftPulmonaryArtery");
544 Remove_Structures("7", "LeftSuperiorPulmonaryVein");
545 Remove_Structures("7", "PulmonaryTrunk");
546 Remove_Structures("7", "VertebralBody");
548 // Keep only one CCL by slice (before removing Esophagus)
549 // DD("SliceBySliceKeepMainCCL");
551 // TODO -> replace by keep the one that contains point at the middle of the line between the bronchus
552 // -> new function "keep/select" the ccl that contains this point (2D)
554 //m_Working_Support = clitk::SliceBySliceKeepMainCCL<MaskImageType>(m_Working_Support, GetBackgroundValue(), GetForegroundValue());
556 Remove_Structures("7", "Esophagus");
559 StopCurrentStep<MaskImageType>(m_Working_Support);
560 m_ListOfStations["7"] = m_Working_Support;
563 //--------------------------------------------------------------------