]> Creatis software - clitk.git/blobdiff - segmentation/clitkExtractMediastinumFilter.txx
Moved from repository clitk to clitk.private/tests_dav
[clitk.git] / segmentation / clitkExtractMediastinumFilter.txx
index b3e17bf719ba32047ea1b48e91c776cf9684e257..675718082192ea3663ada290675da3648b91a5e2 100644 (file)
@@ -263,6 +263,7 @@ GenerateOutputInformation() {
   MaskImagePointer bones_ant;
   MaskImagePointer bones_post;
   MaskImagePointType middle_AntPost_position;
+  middle_AntPost_position.Fill(NumericTraits<MaskImagePointType::ValueType>::Zero);
   if (GetUseBones()) { 
     this->StartNewStep("[Mediastinum] Ant/Post limits with bones");
 
@@ -340,18 +341,27 @@ GenerateOutputInformation() {
   // Generic RelativePosition processes
   output = this->ApplyRelativePositionList("Mediastinum", output);
 
+
   //--------------------------------------------------------------------
+  // FIXME --> do not put this limits here !
+  /*
   // Step : SI limits It is better to do this limit *AFTER* the
   // RelativePosition to avoid some issue due to superior boundaries.
   this->StartNewStep("[Mediastinum] Keep inferior to CricoidCartilag");
   // load Cricoid, get centroid, cut above (or below), lower bound
-  MaskImagePointer CricoidCartilag = this->GetAFDB()->template GetImage <MaskImageType>("CricoidCartilag");
   MaskImagePointType p;
-  p[0] = p[1] = p[2] =  0.0; // to avoid warning
-  clitk::FindExtremaPointInAGivenDirection<MaskImageType>(CricoidCartilag, 
-                                                          this->GetBackgroundValue(), 2, true, p);
+  try {
+    MaskImagePointer CricoidCartilag = this->GetAFDB()->template GetImage <MaskImageType>("CricoidCartilag");
+    p[0] = p[1] = p[2] =  0.0; // to avoid warning
+    clitk::FindExtremaPointInAGivenDirection<MaskImageType>(CricoidCartilag, 
+                                                            this->GetBackgroundValue(), 2, true, p);
+  } catch (clitk::ExceptionObject e) {
+    //DD("CricoidCartilag image not found, try CricoidCartilagZ");
+    this->GetAFDB()->GetPoint3D("CricoidCartilagPoint", p);
+  }
   output = clitk::CropImageRemoveGreaterThan<MaskImageType>(output, 2, p[2], true, this->GetBackgroundValue());
   this->template StopCurrentStep<MaskImageType>(output);
+  */
 
   //--------------------------------------------------------------------
   // Step: Get CCL