]> Creatis software - clitk.git/commitdiff
Add Station 5 and 6
authorDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Wed, 5 Oct 2011 09:04:42 +0000 (11:04 +0200)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Wed, 5 Oct 2011 09:04:42 +0000 (11:04 +0200)
segmentation/clitkExtractLymphStation_5.txx [new file with mode: 0644]
segmentation/clitkExtractLymphStation_6.txx [new file with mode: 0644]

diff --git a/segmentation/clitkExtractLymphStation_5.txx b/segmentation/clitkExtractLymphStation_5.txx
new file mode 100644 (file)
index 0000000..0a5ea17
--- /dev/null
@@ -0,0 +1,94 @@
+
+
+//--------------------------------------------------------------------
+template <class ImageType>
+void 
+clitk::ExtractLymphStationsFilter<ImageType>::
+ExtractStation_5_SetDefaultValues()
+{
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template <class TImageType>
+void 
+clitk::ExtractLymphStationsFilter<TImageType>::
+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<MaskImageType>(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<MaskImageType>(m_ListOfStations["5"], 
+                                                                  GetBackgroundValue(), 
+                                                                  GetForegroundValue());
+
+  // AutoCrop
+  m_ListOfStations["5"] = clitk::AutoCrop<MaskImageType>(m_ListOfStations["5"], GetBackgroundValue());
+  StopCurrentStep<MaskImageType>(m_ListOfStations["5"]);
+
+  // Store image filenames into AFDB 
+  writeImage<MaskImageType>(m_ListOfStations["5"], "seg/Station5.mhd");
+  GetAFDB()->SetImageFilename("Station5", "seg/Station5.mhd"); 
+  WriteAFDB(); 
+  StopSubStep();
+
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template <class TImageType>
+void 
+clitk::ExtractLymphStationsFilter<TImageType>::
+ExtractStation_5_Limits_AscendingAorta_Ant() 
+{
+  // ----------------------------------------------------------
+  StartNewStep("[Station 5] Limits with Ant part of AscendingAorta");
+
+  // Get AscendingAorta
+  MaskImagePointer AscendingAorta = GetAFDB()->template GetImage<MaskImageType>("AscendingAorta");
+
+  // Crop and select most Ant points
+  AscendingAorta = 
+    clitk::ResizeImageLike<MaskImageType>(AscendingAorta, m_Working_Support, GetBackgroundValue());
+  std::vector<MaskImagePointType> A;
+  std::vector<MaskImagePointType> B;
+  clitk::SliceBySliceBuildLineSegmentAccordingToExtremaPosition<MaskImageType>(AscendingAorta, 
+                                                                               GetBackgroundValue(), 
+                                                                               2, 1, true, 0, -1, A, B);
+  //1 mm margin
+
+  // Separate according to AB lines
+  // clitk::WriteListOfLandmarks<MaskImageType>(A, "A.txt");
+  // clitk::WriteListOfLandmarks<MaskImageType>(B, "B.txt");
+  clitk::SliceBySliceSetBackgroundFromLineSeparation<MaskImageType>(m_Working_Support, A, B,
+                                                                    GetBackgroundValue(), 
+                                                                    1, 10); // Keep point along axis 1
+  // End
+  StopCurrentStep<MaskImageType>(m_Working_Support);
+}
+//--------------------------------------------------------------------
+
+
diff --git a/segmentation/clitkExtractLymphStation_6.txx b/segmentation/clitkExtractLymphStation_6.txx
new file mode 100644 (file)
index 0000000..65c458e
--- /dev/null
@@ -0,0 +1,54 @@
+
+
+//--------------------------------------------------------------------
+template <class ImageType>
+void 
+clitk::ExtractLymphStationsFilter<ImageType>::
+ExtractStation_6_SetDefaultValues()
+{
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template <class TImageType>
+void 
+clitk::ExtractLymphStationsFilter<TImageType>::
+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<MaskImageType>(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<MaskImageType>(m_ListOfStations["6"], 
+                                                                  GetBackgroundValue(), 
+                                                                  GetForegroundValue());
+  StopCurrentStep<MaskImageType>(m_ListOfStations["6"]);
+
+  // Store image filenames into AFDB 
+  writeImage<MaskImageType>(m_ListOfStations["6"], "seg/Station6.mhd");
+  GetAFDB()->SetImageFilename("Station6", "seg/Station6.mhd"); 
+  WriteAFDB(); 
+  StopSubStep();
+
+}
+//--------------------------------------------------------------------
+
+