From a8081a1ac5087832d0e37db84cc319867b976423 Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Wed, 5 Oct 2011 11:04:42 +0200 Subject: [PATCH] Add Station 5 and 6 --- segmentation/clitkExtractLymphStation_5.txx | 94 +++++++++++++++++++++ segmentation/clitkExtractLymphStation_6.txx | 54 ++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 segmentation/clitkExtractLymphStation_5.txx create mode 100644 segmentation/clitkExtractLymphStation_6.txx diff --git a/segmentation/clitkExtractLymphStation_5.txx b/segmentation/clitkExtractLymphStation_5.txx new file mode 100644 index 0000000..0a5ea17 --- /dev/null +++ b/segmentation/clitkExtractLymphStation_5.txx @@ -0,0 +1,94 @@ + + +//-------------------------------------------------------------------- +template +void +clitk::ExtractLymphStationsFilter:: +ExtractStation_5_SetDefaultValues() +{ +} +//-------------------------------------------------------------------- + + +//-------------------------------------------------------------------- +template +void +clitk::ExtractLymphStationsFilter:: +ExtractStation_5() { + if ((!CheckForStation("5")) && (!CheckForStation("5"))) return; + + StartNewStep("Stations 5"); + StartSubStep(); + + // Get the current support + StartNewStep("[Station 5] Get the current 5 suppport"); + m_ListOfStations["5"] = m_ListOfSupports["S5"]; + StopCurrentStep(m_ListOfStations["5"]); + + // Generic RelativePosition processes + m_ListOfStations["5"] = this->ApplyRelativePositionList("Station_5", m_ListOfStations["5"]); + + // Separation Ant/Post -> Like 4SL ! + m_Working_Support = m_ListOfStations["5"]; + ExtractStation_S4L_S5_Limits_Aorta_LeftPulmonaryArtery(-10); + m_ListOfStations["5"] = m_Working_Support; + + // Ant limit + m_Working_Support = m_ListOfStations["5"]; + ExtractStation_5_Limits_AscendingAorta_Ant(); + m_ListOfStations["5"] = m_Working_Support; + + // Keep only one single CCL by slice + StartNewStep("[Station 5] Keep only one CCL by slice"); + m_ListOfStations["5"] = SliceBySliceKeepMainCCL(m_ListOfStations["5"], + GetBackgroundValue(), + GetForegroundValue()); + + // AutoCrop + m_ListOfStations["5"] = clitk::AutoCrop(m_ListOfStations["5"], GetBackgroundValue()); + StopCurrentStep(m_ListOfStations["5"]); + + // Store image filenames into AFDB + writeImage(m_ListOfStations["5"], "seg/Station5.mhd"); + GetAFDB()->SetImageFilename("Station5", "seg/Station5.mhd"); + WriteAFDB(); + StopSubStep(); + +} +//-------------------------------------------------------------------- + + +//-------------------------------------------------------------------- +template +void +clitk::ExtractLymphStationsFilter:: +ExtractStation_5_Limits_AscendingAorta_Ant() +{ + // ---------------------------------------------------------- + StartNewStep("[Station 5] Limits with Ant part of AscendingAorta"); + + // Get AscendingAorta + MaskImagePointer AscendingAorta = GetAFDB()->template GetImage("AscendingAorta"); + + // Crop and select most Ant points + AscendingAorta = + clitk::ResizeImageLike(AscendingAorta, m_Working_Support, GetBackgroundValue()); + std::vector A; + std::vector B; + clitk::SliceBySliceBuildLineSegmentAccordingToExtremaPosition(AscendingAorta, + GetBackgroundValue(), + 2, 1, true, 0, -1, A, B); + //1 mm margin + + // Separate according to AB lines + // clitk::WriteListOfLandmarks(A, "A.txt"); + // clitk::WriteListOfLandmarks(B, "B.txt"); + clitk::SliceBySliceSetBackgroundFromLineSeparation(m_Working_Support, A, B, + GetBackgroundValue(), + 1, 10); // Keep point along axis 1 + // End + StopCurrentStep(m_Working_Support); +} +//-------------------------------------------------------------------- + + diff --git a/segmentation/clitkExtractLymphStation_6.txx b/segmentation/clitkExtractLymphStation_6.txx new file mode 100644 index 0000000..65c458e --- /dev/null +++ b/segmentation/clitkExtractLymphStation_6.txx @@ -0,0 +1,54 @@ + + +//-------------------------------------------------------------------- +template +void +clitk::ExtractLymphStationsFilter:: +ExtractStation_6_SetDefaultValues() +{ +} +//-------------------------------------------------------------------- + + +//-------------------------------------------------------------------- +template +void +clitk::ExtractLymphStationsFilter:: +ExtractStation_6() { + if ((!CheckForStation("6")) && (!CheckForStation("6"))) return; + + StartNewStep("Stations 6"); + StartSubStep(); + + // Get the current support + StartNewStep("[Station 6] Get the current 6 suppport"); + m_ListOfStations["6"] = m_ListOfSupports["S6"]; + StopCurrentStep(m_ListOfStations["6"]); + + // Generic RelativePosition processes + m_ListOfStations["6"] = this->ApplyRelativePositionList("Station_6", m_ListOfStations["6"]); + + // Remove some structures + m_Working_Support = m_ListOfStations["6"]; + Remove_Structures(" 6", "Aorta"); + Remove_Structures(" 6", "SVC"); + Remove_Structures(" 6", "BrachioCephalicVein"); + m_ListOfStations["6"] = m_Working_Support; + + // Keep only one single CCL by slice + StartNewStep("[Station 6] Keep only one CCL by slice"); + m_ListOfStations["6"] = SliceBySliceKeepMainCCL(m_ListOfStations["6"], + GetBackgroundValue(), + GetForegroundValue()); + StopCurrentStep(m_ListOfStations["6"]); + + // Store image filenames into AFDB + writeImage(m_ListOfStations["6"], "seg/Station6.mhd"); + GetAFDB()->SetImageFilename("Station6", "seg/Station6.mhd"); + WriteAFDB(); + StopSubStep(); + +} +//-------------------------------------------------------------------- + + -- 2.47.1