]> Creatis software - clitk.git/blobdiff - segmentation/clitkExtractLung.cxx
correct options scheme
[clitk.git] / segmentation / clitkExtractLung.cxx
index 01ed6a830611a44490ce42137d85ee7d01578942..b39f621ca80c41b5d8e7b675e5e6b52fc26e0185 100644 (file)
@@ -23,7 +23,6 @@
 //--------------------------------------------------------------------
 int main(int argc, char * argv[])
 {
-
   // Init command line
   GGO(clitkExtractLung, args_info);
   CLITK_INIT;
@@ -33,10 +32,11 @@ int main(int argc, char * argv[])
   FilterType::Pointer filter = FilterType::New();
 
   filter->SetArgsInfo(args_info);
-  filter->Update();
-
-  if (filter->HasError()) {
-    std::cout << filter->GetLastError() << std::endl;
+  
+  try {
+    filter->Update();
+  } catch(std::runtime_error e) {
+    std::cerr << e.what() << std::endl;
   }
 
   return EXIT_SUCCESS;