From 1ee167dfd5c4da1db5dc7ba3506d10498386ae77 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Tue, 15 Feb 2011 11:28:40 +0000 Subject: [PATCH] add default filename + exception on error --- ...litkFilterWithAnatomicalFeatureDatabaseManagement.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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(); + } } //-------------------------------------------------------------------- -- 2.47.1