]> Creatis software - clitk.git/blobdiff - segmentation/clitkExtractLymphStation_3P.txx
remove tools (now in tests_dav)
[clitk.git] / segmentation / clitkExtractLymphStation_3P.txx
index 58549dfcfce17ac5919fd4d51335b64d01ccfa0d..274fc867c740596227b8c2c92f84b31b4a5d5a02 100644 (file)
@@ -17,27 +17,33 @@ ExtractStation_3P()
 {
   if (!CheckForStation("3P")) return;
 
+  StartNewStep("Station 3P");
+  StartSubStep();  
+
   // Get the current support 
   StartNewStep("[Station 3P] Get the current 3P suppport");
   m_Working_Support = m_ListOfSupports["S3P"];
   m_ListOfStations["3P"] = m_Working_Support;
   StopCurrentStep<MaskImageType>(m_Working_Support);
-  
-  // LR limits inferiorly
-  ExtractStation_3P_LR_inf_Limits();
-  
-  // LR limits superiorly => not here for the moment because not
-  //  clear in the def
-  // ExtractStation_3P_LR_sup_Limits_2(); //TODO
-  // ExtractStation_3P_LR_sup_Limits();   // old version to change
-  
+
+  // Generic RelativePosition processes
+  m_ListOfStations["3P"] = this->ApplyRelativePositionList("Station_3P", m_ListOfStations["3P"]);
+  m_Working_Support = m_ListOfStations["3P"];
   ExtractStation_8_Single_CCL_Limits(); // YES 8 !
   ExtractStation_3P_Remove_Structures(); // after CCL
-  
+  m_ListOfStations["3P"] = m_Working_Support;
+
+  // Old stuff
+  // LR limits superiorly => not here for the moment because not clear in the def
+  // ExtractStation_3P_LR_sup_Limits_2(); //TODO
+  // ExtractStation_3P_LR_sup_Limits();   // old version to change
+  // ExtractStation_3P_LR_inf_Limits();  // <-- done in RelPosList 
+
   // Store image filenames into AFDB 
   writeImage<MaskImageType>(m_ListOfStations["3P"], "seg/Station3P.mhd");
   GetAFDB()->SetImageFilename("Station3P", "seg/Station3P.mhd"); 
   WriteAFDB();   
+  StopSubStep();
 }
 //--------------------------------------------------------------------
 
@@ -49,16 +55,9 @@ clitk::ExtractLymphStationsFilter<ImageType>::
 ExtractStation_3P_Remove_Structures() 
 {
   StartNewStep("[Station 3P] Remove some structures.");
-
-  Remove_Structures("3P", "Aorta");
-  Remove_Structures("3P", "VertebralBody");
-  Remove_Structures("3P", "SubclavianArteryLeft");
-  Remove_Structures("3P", "SubclavianArteryRight");
   Remove_Structures("3P", "Esophagus");
-  Remove_Structures("3P", "AzygousVein");
   Remove_Structures("3P", "Thyroid");
-  Remove_Structures("3P", "VertebralArtery");
-
+  Remove_Structures("3P", "VertebralArtery"); // (inside the station)
   StopCurrentStep<MaskImageType>(m_Working_Support);
   m_ListOfStations["3P"] = m_Working_Support;
 }
@@ -94,8 +93,8 @@ ExtractStation_3P_LR_sup_Limits()
   Trachea = clitk::ResizeImageLike<MaskImageType>(Trachea, m_Working_Support, GetBackgroundValue());
   SubclavianArtery = clitk::ResizeImageLike<MaskImageType>(SubclavianArtery, m_Working_Support, GetBackgroundValue());
   
-  writeImage<MaskImageType>(Trachea, "tr.mhd");
-  writeImage<MaskImageType>(SubclavianArtery, "sca.mhd");
+  // writeImage<MaskImageType>(Trachea, "tr.mhd");
+  // writeImage<MaskImageType>(SubclavianArtery, "sca.mhd");
   
   // Get list of slices
   std::vector<MaskSlicePointer> slices_support;
@@ -166,7 +165,7 @@ ExtractStation_3P_LR_sup_Limits()
         relPosFilter->SetBackgroundValue(GetBackgroundValue());
         relPosFilter->SetInput(slices_support[i]); 
         relPosFilter->SetInputObject(object); 
-        relPosFilter->AddOrientationTypeString("R");
+        relPosFilter->AddOrientationTypeString("RightTo");
         relPosFilter->SetInverseOrientationFlag(true);
         //      relPosFilter->SetIntermediateSpacing(3);
         relPosFilter->SetIntermediateSpacingFlag(false);
@@ -182,7 +181,7 @@ ExtractStation_3P_LR_sup_Limits()
         relPosFilter->SetBackgroundValue(GetBackgroundValue());
         relPosFilter->SetInput(slices_support[i]); 
         relPosFilter->SetInputObject(object); 
-        relPosFilter->AddOrientationTypeString("A");
+        relPosFilter->AddOrientationTypeString("AntTo");
         relPosFilter->SetInverseOrientationFlag(true);
         //      relPosFilter->SetIntermediateSpacing(3);
         relPosFilter->SetIntermediateSpacingFlag(false);
@@ -281,60 +280,3 @@ ExtractStation_3P_LR_sup_Limits_2()
 }
 //--------------------------------------------------------------------
 
-//--------------------------------------------------------------------
-template <class ImageType>
-void 
-clitk::ExtractLymphStationsFilter<ImageType>::
-ExtractStation_3P_LR_inf_Limits() 
-{
-  /*
-    "On the right side, the limit is defined by the air–soft-tissue
-    interface. On the left side, it is defined by the air–tissue
-    interface superiorly (Fig. 2A–C) and the aorta inferiorly
-    (Figs. 2D–I and 3A–C)."
-
-    inf : not Right to Azygousvein    
-  */
-  StartNewStep("[Station 3P] Left/Right limits (inferior part) with Azygousvein and Aorta");
-
-  // Load structures
-  MaskImagePointer AzygousVein = GetAFDB()->template GetImage<MaskImageType>("AzygousVein");
-  MaskImagePointer Aorta = GetAFDB()->template GetImage<MaskImageType>("Aorta");
-
-  DD("ici");
-  writeImage<MaskImageType>(m_Working_Support, "ws.mhd");
-
-  typedef clitk::AddRelativePositionConstraintToLabelImageFilter<MaskImageType> RelPosFilterType;
-  typename RelPosFilterType::Pointer relPosFilter = RelPosFilterType::New();
-  relPosFilter->VerboseStepFlagOff();
-  relPosFilter->WriteStepFlagOff();
-  relPosFilter->SetBackgroundValue(GetBackgroundValue());
-  relPosFilter->SetInput(m_Working_Support); 
-  relPosFilter->SetInputObject(AzygousVein); 
-  relPosFilter->AddOrientationTypeString("R");
-  relPosFilter->SetInverseOrientationFlag(true);
-  relPosFilter->SetIntermediateSpacing(3);
-  relPosFilter->SetIntermediateSpacingFlag(false);
-  relPosFilter->SetFuzzyThreshold(0.7);
-  relPosFilter->AutoCropFlagOn();
-  relPosFilter->Update();
-  m_Working_Support = relPosFilter->GetOutput();
-
-  DD("la");
-  writeImage<MaskImageType>(m_Working_Support, "before-L-aorta.mhd");
-  relPosFilter->SetInput(m_Working_Support); 
-  relPosFilter->SetInputObject(Aorta); 
-  relPosFilter->AddOrientationTypeString("L");
-  relPosFilter->SetInverseOrientationFlag(true);
-  relPosFilter->SetIntermediateSpacing(3);
-  relPosFilter->SetIntermediateSpacingFlag(false);
-  relPosFilter->SetFuzzyThreshold(0.7);
-  relPosFilter->AutoCropFlagOn();
-  relPosFilter->Update();
-  m_Working_Support = relPosFilter->GetOutput();
-  writeImage<MaskImageType>(m_Working_Support, "after-L-aorta.mhd");
-
-  StopCurrentStep<MaskImageType>(m_Working_Support);
-  m_ListOfStations["3P"] = m_Working_Support;
-}
-//--------------------------------------------------------------------