]> Creatis software - clitk.git/commitdiff
add default filename + exception on error
authordsarrut <dsarrut>
Tue, 15 Feb 2011 11:28:40 +0000 (11:28 +0000)
committerdsarrut <dsarrut>
Tue, 15 Feb 2011 11:28:40 +0000 (11:28 +0000)
segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx

index 343e839a2c049120767db5e03c560a78bdd6246b..fda1621896f9596966d3e680e9390afa7de9e8c9 100644 (file)
@@ -24,7 +24,7 @@ clitk::FilterWithAnatomicalFeatureDatabaseManagement::
 FilterWithAnatomicalFeatureDatabaseManagement() 
 {
   m_AFDB = NULL; 
-  SetAFDBFilename("noname.afdb");
+  SetAFDBFilename("default.afdb");
 }
 //--------------------------------------------------------------------
 
@@ -42,7 +42,12 @@ void clitk::FilterWithAnatomicalFeatureDatabaseManagement::WriteAFDB()
 void clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB() 
 {
   GetAFDB()->SetFilename(GetAFDBFilename());
-  GetAFDB()->Load();
+  try {
+    GetAFDB()->Load();
+  } catch (clitk::ExceptionObject e) {
+    std::cout << "Could not read '" << GetAFDBFilename() << "', create one AFDB." << std::endl;
+    GetAFDB();
+  }
 }
 //--------------------------------------------------------------------