]> Creatis software - clitk.git/commitdiff
Add afdb_path option
authorDavid Sarrut <david.sarrut@gmail.com>
Thu, 27 Oct 2011 13:56:40 +0000 (15:56 +0200)
committerDavid Sarrut <david.sarrut@gmail.com>
Thu, 27 Oct 2011 13:56:40 +0000 (15:56 +0200)
segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx
segmentation/clitkFilterWithAnatomicalFeatureDatabaseManagement.h

index bec6b9e59a8a24d380b2b4f45c086e2765ae64b5..6db7c4b934dee61ba449fc65164c4838159a09c8 100644 (file)
@@ -25,6 +25,7 @@ FilterWithAnatomicalFeatureDatabaseManagement()
 {
   m_AFDB = NULL; 
   SetAFDBFilename("default.afdb");
+  SetAFDBPath("./");
 }
 //--------------------------------------------------------------------
 
@@ -42,6 +43,7 @@ void clitk::FilterWithAnatomicalFeatureDatabaseManagement::WriteAFDB()
 void clitk::FilterWithAnatomicalFeatureDatabaseManagement::LoadAFDB() 
 {
   GetAFDB()->SetFilename(GetAFDBFilename());
+  GetAFDB()->SetPath(GetAFDBPath());
   try {
     GetAFDB()->Load();
   } catch (clitk::ExceptionObject e) {
@@ -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;
 }
index ca8fd9800c3895fa8de0253cbeaed551fc36d011..a1f9f29f54d35e023c3c5d988e0193d6524894a4 100644 (file)
@@ -42,19 +42,28 @@ namespace clitk {
     itkTypeMacro(FilterWithAnatomicalFeatureDatabaseManagement, Object);
 
     // Set/Get filename 
-    itkBooleanMacro(AFDBFilenameGivenFlag);
-    itkSetMacro(AFDBFilenameGivenFlag, bool);
-    itkGetConstMacro(AFDBFilenameGivenFlag, bool);
-    GGO_DefineOption_Flag(afdb, SetAFDBFilenameGivenFlag);
+    // itkBooleanMacro(AFDBFilenameGivenFlag);
+    // itkSetMacro(AFDBFilenameGivenFlag, bool);
+    // itkGetConstMacro(AFDBFilenameGivenFlag, bool);
+    // GGO_DefineOption_Flag(afdb, SetAFDBFilenameGivenFlag);
+
+    // itkBooleanMacro(AFDBPathGivenFlag);
+    // itkSetMacro(AFDBPathGivenFlag, bool);
+    // itkGetConstMacro(AFDBPathGivenFlag, bool);
+    // GGO_DefineOption_Flag(afdb_path, SetAFDBPathGivenFlag);
 
     itkSetMacro(AFDBFilename, std::string);
     itkGetConstMacro(AFDBFilename, std::string);
-    GGO_DefineOption_WithTest(afdb, SetAFDBFilename, std::string, AFDBFilenameGivenFlag);
+    // GGO_DefineOption_WithTest(afdb, SetAFDBFilename, std::string, AFDBFilenameGivenFlag);
+
+    itkSetMacro(AFDBPath, std::string);
+    itkGetConstMacro(AFDBPath, std::string);
+    // GGO_DefineOption_WithTest(afdb_path, SetAFDBPath, std::string, AFDBPathGivenFlag);
 
     void WriteAFDB();
     void LoadAFDB();
 
-    AnatomicalFeatureDatabase * GetAFDB();
+    AnatomicalFeatureDatabase::Pointer GetAFDB();
     void SetAFDB(AnatomicalFeatureDatabase * a) { m_AFDB = a; }
 
   protected:
@@ -62,8 +71,10 @@ namespace clitk {
     virtual ~FilterWithAnatomicalFeatureDatabaseManagement() {}    
     
     std::string m_AFDBFilename;
-    bool m_AFDBFilenameGivenFlag;
-    clitk::AnatomicalFeatureDatabase * m_AFDB;
+    // bool m_AFDBFilenameGivenFlag;
+    std::string m_AFDBPath;
+    // bool m_AFDBPathGivenFlag;
+    clitk::AnatomicalFeatureDatabase::Pointer m_AFDB;
 
   private:
     FilterWithAnatomicalFeatureDatabaseManagement(const Self&); //purposely not implemented