]> Creatis software - creaImageIO.git/commitdiff
correction of bugs
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Wed, 1 Sep 2010 16:19:58 +0000 (16:19 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Wed, 1 Sep 2010 16:19:58 +0000 (16:19 +0000)
CMakeLists.txt
src/creaImageIOGimmick.cpp
src/creaImageIOTreeHandlerImageAdder.cpp
src/creaImageIOTreeHandlerImageAdder.h

index 6d6e6d2b9742b369f4db62ebe058eb5becd6e3ed..1fbdf84324bbea20a70280b1f48f9ce1620ec57c 100644 (file)
@@ -45,8 +45,8 @@ IF(USE_QT4)
 ENDIF(USE_QT4)
                 
                 
-OPTION(USE_GDCM ON)
-OPTION(USE_GDCM2 OFF)
+OPTION(USE_GDCM "Use gdcm 1.3" ON)
+OPTION(USE_GDCM2 "Use gdcm 2.0.14 at least" OFF)
  MESSAGE(STATUS "GDCM LIB ....= ${GDCM_LIBRARIES}")
 IF(USE_GDCM2)
        OPTION(USE_GDCM_ANOM "use gdcm2 anonymizer tool" OFF)
index 311deba6982023ec0829f845965d3c59c0d5c58a..3ee74200b5422fecc40150d582903add50253e21 100644 (file)
@@ -9,7 +9,7 @@
 #  define PATH_MAX 2048
 #endif
 #include <creaImageIOGimmick.h>
-#include <boost/algorithm/string.hpp>
+
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #endif
index 34be57a7478f08136c872d8654400f682e29bbe4..3e2ff04943f05a3f840164b9e12a8741ffc128e0 100644 (file)
@@ -138,19 +138,8 @@ namespace creaImageIO
                }
                else
                {
-                 std::string path=node->GetAttribute("FullFileName");
-                 //Gets the add key
-                 std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","IGNORED_FILES","PATH",path,mCurrentDB);
-                 //Gets the number of files added
-                 int files=atoi((mSynchronizer->GetAttribute("FILES_ADDED","ADD_OPS","ADD_KEY",addKey,mCurrentDB)).c_str());
-                 files=files-1;
-                 std::stringstream out;
-                 out<<files;
-                 //Sets the new number of files
-                 mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",addKey,mCurrentDB);
-                 //Sets the file as removed
-                 mSynchronizer->SetAttribute("REMOVE","IGNORED_FILES","1","PATH = '"+path+"' AND ADD_KEY",addKey,mCurrentDB);
-               }
+               remove(node);
+        }
   }
 
   //=====================================================================
@@ -167,7 +156,16 @@ namespace creaImageIO
                }
                else
                {
-                  std::string path=(*it)->GetAttribute("FullFileName");
+               remove(*it);
+               }
+       
+         }
+  }
+
+
+  void  TreeHandlerImageAdder::remove( tree::Node* i_node)
+  {
+         std::string path=i_node->GetAttribute("FullFileName");
                  //Gets the add key
                  std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","IGNORED_FILES","PATH",path,mCurrentDB);
                  //Gets the number of files added
@@ -179,11 +177,7 @@ namespace creaImageIO
                  mSynchronizer->SetAttribute("FILES_ADDED","ADD_OPS",out.str(),"ADD_KEY",addKey,mCurrentDB);
                  //Sets the file as removed
                  mSynchronizer->SetAttribute("REMOVE","IGNORED_FILES","1","PATH = '"+path+"' AND ADD_KEY",addKey,mCurrentDB);
-               }
-       
-         }
   }
-
  
   
   //=======================================================================
index 479742252c7dca46cfdad882a06b6bafe2c368f2..9800a7a01bcca2475aa61da92f915cfa50fa7af1 100644 (file)
@@ -119,6 +119,9 @@ namespace creaImageIO
        void RemoveFile(tree::Node* node);
        /// Removes files from the databases
        void RemoveFiles(const std::vector<tree::Node*>& nodes);
+
+    void remove( tree::Node* i_node);
+
        /// Synchronizes the DB and disk by repeating the operations the user has done and returns a report
        std::string Synchronize(bool repair, bool checkAttributes);
        ///Recursively checks if the directory is synchronized and optionally the state of the attributes