From: dsarrut Date: Tue, 15 Feb 2011 11:28:40 +0000 (+0000) Subject: add default filename + exception on error X-Git-Tag: v1.2.0~249 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1ee167dfd5c4da1db5dc7ba3506d10498386ae77;p=clitk.git add default filename + exception on error --- diff --git a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx index 343e839..fda1621 100644 --- a/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx +++ b/segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx @@ -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(); + } } //--------------------------------------------------------------------