]> Creatis software - clitk.git/blobdiff - segmentation/clitkExtractMediastinumGenericFilter.txx
add Anatomical DB to library
[clitk.git] / segmentation / clitkExtractMediastinumGenericFilter.txx
index 5a2cead88c52d7d32527c9e7e3f66bdd3fec7f45..b5cfaba3194fc995d97f6fa738e91e277aa31b47 100644 (file)
@@ -56,6 +56,7 @@ void clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::SetArgsInfo(const Arg
   if (mArgsInfo.patient_given) AddInputFilename(mArgsInfo.patient_arg);
   if (mArgsInfo.lung_given) AddInputFilename(mArgsInfo.lung_arg);
   if (mArgsInfo.bones_given) AddInputFilename(mArgsInfo.bones_arg);
+  if (mArgsInfo.trachea_given) AddInputFilename(mArgsInfo.trachea_arg);
   if (mArgsInfo.output_given)  AddOutputFilename(mArgsInfo.output_arg);
 }
 //--------------------------------------------------------------------
@@ -70,8 +71,9 @@ void clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::UpdateWithInputImageT
 { 
   // Reading input
   typename ImageType::Pointer patient = this->template GetInput<ImageType>(0);
-  typename ImageType::Pointer lung = this->template GetInput<ImageType>(1);
-  typename ImageType::Pointer bones = this->template GetInput<ImageType>(2);
+  typename ImageType::Pointer lung    = this->template GetInput<ImageType>(1);
+  typename ImageType::Pointer bones   = this->template GetInput<ImageType>(2);
+  typename ImageType::Pointer trachea = this->template GetInput<ImageType>(3);
 
   // Create filter
   typedef clitk::ExtractMediastinumFilter<ImageType> FilterType;
@@ -81,17 +83,11 @@ void clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::UpdateWithInputImageT
   filter->SetInputPatientLabelImage(patient, mArgsInfo.patientBG_arg);
   filter->SetInputLungLabelImage(lung, mArgsInfo.lungBG_arg, mArgsInfo.lungRight_arg, mArgsInfo.lungLeft_arg);
   filter->SetInputBonesLabelImage(bones, mArgsInfo.bonesBG_arg);
+  filter->SetInputTracheaLabelImage(trachea, mArgsInfo.tracheaBG_arg);
   filter->SetArgsInfo(mArgsInfo);
 
   // Go !
   filter->Update();
-  
-  // Check if error
-  if (filter->HasError()) {
-    SetLastError(filter->GetLastError());
-    // No output
-    return;
-  }
 
   // Write/Save results
   typename ImageType::Pointer output = filter->GetOutput();