]> Creatis software - creaImageIO.git/commitdiff
correction of minor bugs: quotes and last slice in first place
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Mon, 18 Apr 2011 14:15:46 +0000 (14:15 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Mon, 18 Apr 2011 14:15:46 +0000 (14:15 +0000)
CMakeLists.txt
appli/CMakeLists.txt
appli/TestWxGimmickReaderDialog/main.cxx
src/CMakeLists.txt
src/creaImageIOSQLiteTreeHandler.cpp
src/creaImageIOSQLiteTreeHandler.h
src/creaImageIOSynchron.cpp
src/creaImageIOSynchron.h
src/creaImageIOWxTreeView.cpp
src/creaImageIOWxViewer.cpp
win64/sqlite/CMakeLists.txt

index 84061b5e0f24d4d4f9e72eececeff0a38ee4d650..b1d6dfcc67011783926a78ab4cf1e69ecd326314 100644 (file)
@@ -45,7 +45,7 @@ add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
 SET(USE_GDCM_VTK ON)
 
 SET(USE_VTK ON)
-SET(USE_ITK OFF)
+
 SET(USE_BOOST ON)
 OPTION(USE_WXWIDGETS "Use WxWidgets GUI" ON)
 OPTION(USE_QT4 "USE QT4GUI"       OFF)
@@ -76,7 +76,9 @@ IF(USE_GDCM2)
        OPTION(USE_GDCM_ANOM "use gdcm2 anonymizer tool" OFF)
        #TO DO TEST IF GDCM_USE_SYSTEM_OPENSSL is valid
 ENDIF(USE_GDCM2)
+OPTION(USE_ITK "use ITK" ON)
 CREA_FIND_AND_USE_LIBRARIES()
+message ("itk libs : ${ITK_LIBRARIES}")
 
 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
index 289e7a2eb4ff829e3e778a0e5eef8dff624e6b1c..5a96249e0e079d284fb1462a115d71803e35dbd9 100644 (file)
@@ -15,7 +15,9 @@ IF(!USE_INSTALL_APP)
   ADD_SUBDIRECTORY(TestQtGimmick)
   ENDIF(USE_QT4)
   
-
+IF(USE_ITK)
+ ADD_SUBDIRECTORY(TestWxItkView)
+ENDIF(USE_ITK)
   #ADD_SUBDIRECTORY(TestWxGimmickReaderDialogJava)
 #LSE (BUILD_V2)
  # ADD_SUBDIRECTORY(TestWxGimmickDialog)
index e2de0d0be1b2eb5ff85eb65b8738eabdf942e311..e79b069872b9cd162f7c6c235139b613705c7b4c 100644 (file)
@@ -7,6 +7,7 @@
 
 
 
+
 //#pragma comment(lib, "creaImageIO.lib")
 //#pragma comment(lib, "DelayImp.lib")
 //
@@ -29,6 +30,8 @@ IMPLEMENT_APP(myApp);
 
 CREA_WXMAIN_WITH_CONSOLE
 
+
+
 bool myApp::OnInit( )
 {
   wxApp::OnInit();
index 064b4efd364d0fc16283986250d983b7f8a38055..bce3f2be3170872481828e3711bff374bb2c243d 100644 (file)
@@ -71,6 +71,13 @@ FILE(GLOB SOURCES_CREAIMAGEIO_IMG_READER
          ${SOURCES_CREAIMAGEIO_IMG_DICOM_READER}
          ${SOURCES_CREAIMAGEIO_MULTI_IMG_READER}
          )
+IF(USE_ITK)
+FILE(GLOB SOURCES_CREAIMAGEIO_ITK_DLG
+       creaImageIOWxIsimpleDlg.h
+       creaImageIOWxIsimpleDlg.txx
+       )
+ENDIF(USE_ITK)
+         
 #--------------------------------------------
 # The wxWidgets-based components
 if (USE_WXWIDGETS)
@@ -160,7 +167,7 @@ SOURCE_GROUP("Source Files\\Readers" FILES ${SOURCES_CREAIMAGEIO_IMG_READER}
                                                                                        ${SOURCES_CREAIMAGEIO_IMG_DICOM_READER})
 SOURCE_GROUP("Source Files\\Tree" FILES ${SOURCES_CREAIMAGEIO_TREE})
 
-
+SOURCE_GROUP("Source Files\\ITK" FILES ${SOURCES_CREAIMAGEIO_ITK_DLG})
 
 
 IF(USE_WXWIDGETS)
@@ -182,6 +189,7 @@ SET( PRIMITIVE_SRCS
  ${SOURCES_CREAIMAGEIO_IMG_DICOM_READER}
  ${GUI_SRCS}
  ${SOURCES_CREAIMAGEIO_TREE}
+ ${SOURCES_CREAIMAGEIO_ITK_DLG}
 )
 
 
@@ -236,6 +244,7 @@ TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
   ${VTK_LIBRARIES}
   ${GDCM_LIBRARIES}
   ${BOOST_LIBRARIES}
+  ${ITK_LIBRARIES}
   sqlite3)
 ELSE(NOT USE_XERCES)
 TARGET_LINK_LIBRARIES(${LIBRARY_NAME} 
index 478a4be902ed9be5212ca07bf54166c49e2dce97..dfcea654c4191bde57da82c29d8222e40b79899f 100644 (file)
@@ -771,7 +771,7 @@ GimmickDebugMessage(1,                                      "query : '"                         <<query                                         <<std::endl);
     sql += " SET ";
     sql += key;
     sql += " = '";
-    sql += value;
+    sql += convert(value);
     sql += "' WHERE ID = '";
     sql += n->GetAttribute("ID");
        sql +="'";
@@ -1105,5 +1105,11 @@ GimmickDebugMessage(1,                                   "query : '"                         <<query                                         <<std::endl);
                out<<"commit transaction;";
         UPDATEDB(out.str());
        }
+  const std::string SQLiteTreeHandler::convert(const std::string &i_word)
+  {
+         std::string temp = i_word;
+         boost::algorithm::replace_all(temp,"'","''");
+         return temp.c_str();
+  }
 
 } // namespace creaImageIO
index e5c001edd0ecd02e2aa760cf42d02a20b6c24362..fc2f9aca794541e22040fd1526b9821b141c5158 100644 (file)
@@ -235,6 +235,7 @@ namespace creaImageIO
     void SetWritable(bool w) { mWritable = w; }
     bool GetWritable() const { return mWritable; }
        bool mIsAdding;
+       const std::string convert(const std::string &i_word);
 
    
   };
index 0955ffaee260161d386f73b4391d220c5e3c314d..4c832dd2a8ba9f20ede5b423a59ad88ed2960bf1 100644 (file)
@@ -213,7 +213,7 @@ namespace creaImageIO
                std::string pat=path.c_str();
                CleanName(pat);
                insert="INSERT INTO ADD_OPS (PATH,RECURSIVE,FILES_ADDED,REFERENCEDDB) VALUES('";
-               insert+=pat+"','";
+               insert+=convert(pat)+"','";
                insert+=recursive+"',";
                insert+=nChildren+",'";
                insert+=refdb+"');";
@@ -239,7 +239,7 @@ namespace creaImageIO
                        std::string insert;
                        insert="INSERT INTO IGNORED_FILES (ADD_KEY,PATH,REMOVE,TIME) VALUES('";
                        insert+=addKey+"','";
-                       insert+=pat+"','";
+                       insert+=convert(pat)+"','";
                        insert+=remove+"',";
                        insert+=time+");";
                        UPDATESYNCDB(insert);
@@ -256,7 +256,7 @@ namespace creaImageIO
                                std::string insert;
                                insert="INSERT INTO IGNORED_FILES (ADD_KEY,PATH,REMOVE,TIME) VALUES('";
                                insert+=addKey+"','";
-                               insert+=pat+"','";
+                               insert+=convert(pat)+"','";
                                insert+=remove+"',";
                                insert+=time+");";
                                UPDATESYNCDB(insert);
@@ -320,7 +320,7 @@ namespace creaImageIO
     {
         std::stringstream query;
        std::string result;
-       std::string sVal=searchValue.c_str();
+       std::string sVal=convert(searchValue.c_str());
        CleanName(sVal);
        query<<"SELECT "<<attribute<<" FROM "<<table<<" WHERE "<<searchParam<<" = '"<<sVal;
        if(table.compare("ADD_OPS")==0)
@@ -358,7 +358,7 @@ namespace creaImageIO
                                const std::string& refdb)
     {
        std::string val=value.c_str();
-       std::string sVal=searchValue.c_str();
+       std::string sVal=convert(searchValue.c_str());
        CleanName(val);
        CleanName(sVal);
        std::string sql = "UPDATE ";
@@ -446,6 +446,13 @@ namespace creaImageIO
                }
                return valid;
        }
+         const std::string Synchronizer::convert(const std::string &i_word)
+         {
+                 std::string temp = i_word;
+                 boost::algorithm::replace_all(temp,"'","''");
+
+         return temp.c_str();
+  }
 }
 
 
index ab101f6902728a3c545abefc648ef7e71a4916c7..e856e7cb0619610a89e540fc4dde58ce53903323 100644 (file)
@@ -128,6 +128,7 @@ namespace creaImageIO
                          void CleanName(std::string& str) const;
                          ///Gets the ignore list
                      std::vector<std::string> GetIgnoreList(const std::string &i_key);
+                         const std::string convert(const std::string &i_word);
 
     };
    //================================================================================================================
index 85cf0003940312a7346e703c0a002c452a75a1fa..34db01a70a63b4aa8041e5b68b2656dc666a6314 100644 (file)
@@ -304,17 +304,19 @@ namespace creaImageIO
                                break;
                        long adr = GetCtrl(l-1)->GetItemData(item);
                        tree::Node* n = ((ItemData*)adr)->node;
-                       if(mLastSelected==item)
+                       /* FCY 18-04-2011: don't understand the real purpose of these lines,
+                        if uncomment add last frame in first place 
+                               if(mLastSelected==item)
                        {
                                std::vector<tree::Node*>::iterator it;
                                it = sel.begin();
                                it = sel.insert ( it , n );
                        }
                        else
-                       {
+                       {*/
                                
                                sel.push_back(n);
-                       }                       
+                       //}                     
                        
                }
                /*int n = GetCtrl(l-1)->GetItemCount();
index 92ec86c6a1de26819b32894642df172a5902a662..603d128bf7c79b98128962eb4a8468dc8f8fbcc6 100644 (file)
@@ -120,6 +120,7 @@ namespace creaImageIO
        imagePointers=pointers;
        
        mslide->SetMax(pointers.size());
+       mslide->SetMin(1);
        // Refresh don't work, TO MODIFY
        mslide->Refresh();
        mslide->ClearTicks();
@@ -306,7 +307,7 @@ std::cout << std::endl;
        
        void WxViewer::OnSlide(wxCommandEvent &Event)
         {
-                mCurrent = mslide->GetValue();
+                mCurrent = mslide->GetValue() -1;
                 StartPlayer();
         }
         //================================================================
index 2aa17fa0d94718fc6f9f16454f2871eff599d783..558a32e094770236979d8f48d7c8978e3f62dd82 100644 (file)
@@ -15,9 +15,17 @@ if ( WIN32 )
   endif ( MSVC )
 endif ( WIN32 )
 
+   FIND_PACKAGE(GDCM REQUIRED)
+   INCLUDE_DIRECTORIES(${GDCM_INCLUDE_DIRS})
+  
+
+#  ${GDCM_DIR}/bin/Debug/gdcmDSED.lib
+ # ${GDCM_DIR}/bin/Debug/gdcmMSFF.lib)
+  
 add_library ( sqlite3 SHARED
   ${SOURCES}
   ${HEADERS}
+  gdcmDSED.lib
 )
 
 INSTALL ( TARGETS sqlite3