]> Creatis software - clitk.git/blobdiff - segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx
Merge branch 'master' of /home/dsarrut/clitk3.server
[clitk.git] / segmentation / clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx
index fda1621896f9596966d3e680e9390afa7de9e8c9..6db7c4b934dee61ba449fc65164c4838159a09c8 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to: 
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ======================================================================-====*/
+  ===========================================================================**/
 
 // clitk
 #include "clitkFilterWithAnatomicalFeatureDatabaseManagement.h"
@@ -25,6 +25,7 @@ FilterWithAnatomicalFeatureDatabaseManagement()
 {
   m_AFDB = NULL; 
   SetAFDBFilename("default.afdb");
+  SetAFDBPath("./");
 }
 //--------------------------------------------------------------------
 
@@ -42,10 +43,11 @@ void clitk::FilterWithAnatomicalFeatureDatabaseManagement::WriteAFDB()
 void clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB() 
 {
   GetAFDB()->SetFilename(GetAFDBFilename());
+  GetAFDB()->SetPath(GetAFDBPath());
   try {
     GetAFDB()->Load();
   } catch (clitk::ExceptionObject e) {
-    std::cout << "Could not read '" << GetAFDBFilename() << "', create one AFDB." << std::endl;
+    std::cout << "******* Could not read '" << GetAFDBFilename() << "', create one AFDB. ********" << std::endl;
     GetAFDB();
   }
 }
@@ -53,10 +55,10 @@ void clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB()
 
 
 //--------------------------------------------------------------------
-clitk::AnatomicalFeatureDatabase * clitk::FilterWithAnatomicalFeatureDatabaseManagement::GetAFDB() 
+clitk::AnatomicalFeatureDatabase::Pointer clitk::FilterWithAnatomicalFeatureDatabaseManagement::GetAFDB() 
 {
-  if (m_AFDB == NULL) {
-    m_AFDB = new clitk::AnatomicalFeatureDatabase;
+  if (!m_AFDB) {
+    m_AFDB = clitk::AnatomicalFeatureDatabase::New();
   }
   return m_AFDB;
 }