]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOTreeHandlerImageAdder.cpp
*** empty log message ***
[creaImageIO.git] / src2 / creaImageIOTreeHandlerImageAdder.cpp
index e4eeaf4b69d44ed7a83f519d93ef194b687f4e54..9c2d2974702b55b2895a509e36996d8c863e678d 100644 (file)
@@ -4,10 +4,7 @@
 #include <boost/filesystem/operations.hpp>
 #include <boost/utility.hpp>
 
-#include <creaImageIOGimmick.h>
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
+
 namespace fs = boost::filesystem;
 using boost::filesystem::path;
 using boost::next;
@@ -51,7 +48,7 @@ namespace creaImageIO
        
     unsigned int nbf = filenames.size(); 
     std::vector<std::string>::const_iterator i;
-       mSynchronizer->GetList();
+       mSynchronizer->GetList(mCurrentDB);
     for (i=filenames.begin();i!=filenames.end();++i)
       {
        
@@ -87,7 +84,7 @@ namespace creaImageIO
        mSynchronizer->InsertAddOp(directory,rec.str(),"0",mCurrentDB);
        std::string addKey=mSynchronizer->GetAttribute("ADD_KEY","ADD_OPS","PATH",directory,mCurrentDB);
        mTreeHandler->BeginTransaction();
-       mSynchronizer->GetList();
+       mSynchronizer->GetList(mCurrentDB);
        AddDirectoryRecursor( directory, recurse, addKey );
        
        int nFiles=GetProgress().GetNumberAddedFiles();
@@ -104,7 +101,22 @@ namespace creaImageIO
     std::map< std::string, std::string>  attr;
     mTreeHandler->GetTree().GetDescriptor().BuildAttributeMap(attr);
 
+       
     mReader.ReadAttributes(filename,attr);
+       //// TO DO Create a function to test if the SOP Instance ID (0008,0018) is not already on DB
+       //// test befor if this attr is present on DB if not don't perform the test!!!
+       //bool bSOPIID = false;
+       //std::map<std::string, std::string>::iterator it_att = attr.begin();
+       //for(; it_att != attr.end(); it_att++)
+       //{
+       //      if (it_att->first == "D0008_0018")
+       //      {
+       //              bSOPIID = mTreeHandler->TestSOPIID(it_attr->second);
+       //              break;
+       //      }
+       //}
+       //if(bSOPIID)
+       //      return;
 
     int lev = mTreeHandler->AddBranch(attr);