]> Creatis software - clitk.git/commitdiff
Ensure compilation with VTK6/Qt5 and newer version of GDCM
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 22 Jul 2016 12:58:01 +0000 (14:58 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 22 Jul 2016 12:58:01 +0000 (14:58 +0200)
1  2 
CMakeLists.txt
common/CMakeLists.txt
vv/CMakeLists.txt
vv/qt_ui/vvMainWindow.ui
vv/qt_ui/vvPacsConnection.ui
vv/vv.cxx
vv/vvIcons.qrc
vv/vvMainWindow.cxx
vv/vvMainWindow.h
vv/vvQPacsConnection.cxx
vv/vvUtils.h

diff --cc CMakeLists.txt
index 20e162ee66cd0965463f8b694e2f26a12ca054ad,f0ed562bcf53352e3006fdac359c121ed98ce537..3bb8fc5b4f63d80204a78078dfe4914b1272f8ce
@@@ -5,28 -5,36 +5,36 @@@ cmake_minimum_required(VERSION 2.8
  cmake_policy(VERSION 2.8)
  if(COMMAND cmake_policy)
      cmake_policy(SET CMP0003 NEW)
+     cmake_policy(SET CMP0007 NEW)
  endif(COMMAND cmake_policy)
- IF(NOT DEFINED CLITK_SOURCE_DIR)
-   SET(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
- ENDIF(NOT DEFINED CLITK_SOURCE_DIR)
+ if(NOT DEFINED CLITK_SOURCE_DIR)
+   set(CLITK_SOURCE_DIR ${PROJECT_SOURCE_DIR})
+ endif(NOT DEFINED CLITK_SOURCE_DIR)
+ # Default build type
+ IF(NOT CMAKE_BUILD_TYPE)
+   SET(CMAKE_BUILD_TYPE Release CACHE STRING
+     "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+     FORCE)
+ ENDIF(NOT CMAKE_BUILD_TYPE)
  #=========================================================
  
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  
IF(MSVC)
-   SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
-   SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" )
ENDIF(MSVC)
if(MSVC)
+   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
+   set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" )
endif(MSVC)
  
  #=========================================================
INCLUDE(${CLITK_SOURCE_DIR}/cmake/common.cmake)
INCLUDE(${CLITK_SOURCE_DIR}/cmake/dependencies.cmake)
INCLUDE(${CLITK_SOURCE_DIR}/cmake/build_opt.cmake)
include(${CLITK_SOURCE_DIR}/cmake/common.cmake)
include(${CLITK_SOURCE_DIR}/cmake/dependencies.cmake)
include(${CLITK_SOURCE_DIR}/cmake/build_opt.cmake)
  #=========================================================
  #=========================================================
 -
 +SET(vvPacsConnection true)
  # Select what is compiled
- ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/common ${PROJECT_BINARY_DIR}/common)
- ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
- ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/segmentation ${PROJECT_BINARY_DIR}/segmentation)
- ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/registration ${PROJECT_BINARY_DIR}/registration)
+ add_subdirectory(${CLITK_SOURCE_DIR}/common ${PROJECT_BINARY_DIR}/common)
+ add_subdirectory(${CLITK_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
+ add_subdirectory(${CLITK_SOURCE_DIR}/segmentation ${PROJECT_BINARY_DIR}/segmentation)
+ add_subdirectory(${CLITK_SOURCE_DIR}/registration ${PROJECT_BINARY_DIR}/registration)
+ add_subdirectory(${CLITK_SOURCE_DIR}/cluster_tools ${PROJECT_BINARY_DIR}/cluster_tools)
index 28199adfa1f10feba7d7ac7cc37fc7fe4895573d,5a700ac45c6fd864a319b36491eaf8948b4dd2c8..e17c4dc3e05363b95faab046f6b7997835b65c0f
@@@ -64,16 -64,16 +64,16 @@@ endif(CLITK_MEMORY_INFO
  
  
  #=========================================================
IF (CLITK_USE_SYSTEM_GDCM)
-   FIND_PACKAGE(GDCM REQUIRED)
if(CLITK_USE_SYSTEM_GDCM)
+   find_package(GDCM REQUIRED)
    include(${GDCM_USE_FILE})
-   TARGET_LINK_LIBRARIES(clitkCommon vtkgdcm gdcmDICT gdcmMSFF gdcmMEXD)
- ENDIF()
 -  target_link_libraries(clitkCommon vtkgdcm gdcmDICT gdcmMSFF)
++  target_link_libraries(clitkCommon vtkgdcm gdcmDICT gdcmMSFF gdcmMEXD)
+ endif()
  #=========================================================
  
TARGET_LINK_LIBRARIES(clitkCommon ${VTK_LIBRARIES} ${ITK_LIBRARIES})
target_link_libraries(clitkCommon ${VTK_LIBRARIES} ${ITK_LIBRARIES})
  
ADD_LIBRARY(clitkDicomRTStruct STATIC
add_library(clitkDicomRTStruct STATIC
    clitkDicomRT_Contour.cxx
    clitkDicomRT_ROI.cxx
    clitkDicomRT_StructureSet.cxx
index 998678949445350b4841c8ab7d0d136f2f76b9d8,a0a227fc848cf71fe9cd9b9c55c3c758f29c7993..f43f41a10f2ea0474e7f3651882d3b647b3b2a27
@@@ -4,12 -4,14 +4,13 @@@ cmake_minimum_required(VERSION 2.4
  # To avoid warning with some version
  if(COMMAND cmake_policy)
    cmake_policy(SET CMP0003 NEW)
+   cmake_policy(SET CMP0007 NEW)
  endif(COMMAND cmake_policy)
  #=========================================================
 -
 -
 +OPTION(CLITK_USE_PACS_CONNECTION "USE PACS CONNECTION"       OFF)
  #=========================================================
  #List of vv tools to compile
SET(vv_TOOLS
set(vv_TOOLS
    vvToolMedianFilter
    vvToolRigidReg
    vvToolCropImage
@@@ -105,93 -110,150 +109,171 @@@ set(vv_SRC
  
  #=========================================================
  # Qt related commands
- FIND_PACKAGE(Qt4 REQUIRED)
 -
+ if(vv_QT_VERSION VERSION_GREATER "4")
+   find_package(Qt5Widgets REQUIRED)
+   find_package(Qt5Network REQUIRED)
+   find_package(Qt5Designer REQUIRED)
+ else()
+   find_package(Qt4 REQUIRED)
+ endif()
  
- QT4_WRAP_CPP(vv_SRCS 
-   vvMainWindowBase.h 
-   QTreePushButton.h 
-   vvDocumentation.h  
-   vvHelpDialog.h  
-   vvQDicomSeriesSelector.h 
-   vvSlicerManager.h
-   vvStructureSetActor.h
-   vvROIActor.h
-   vvToolCreatorBase.h
-   )
+ if(vv_QT_VERSION VERSION_GREATER "4")
+   link_directories(${QT5Widgets_LIBRARIES})
+   link_directories(${QT5Network_LIBRARIES})
+   link_directories(${QT5Designer_LIBRARIES})
+ else()
+   link_directories(${QT_LIBRARY_DIR})
+ endif()
  
- QT4_WRAP_UI(vv_UI_CXX 
-   qt_ui/vvHelpDialog.ui 
-   qt_ui/vvDocumentation.ui 
-   qt_ui/vvDicomSeriesSelector.ui
- qt_ui/vvDummyWindow.ui         #For testing 
- #qt_ui/vvPacsConnection.ui
-  #    qt_ui/vvPacsSettingsDialog.ui
- )
+ if(vv_QT_VERSION VERSION_GREATER "4")
+   qt5_wrap_cpp(vv_SRCS
+     vvMainWindowBase.h
+     QTreePushButton.h
+     vvDocumentation.h
+     vvHelpDialog.h
+     vvQDicomSeriesSelector.h
+     vvSlicerManager.h
+     vvSlicer.h
+     vvStructureSetActor.h
+     vvROIActor.h
+     vvToolCreatorBase.h
+     )
+ else()
+   QT4_WRAP_CPP(vv_SRCS
+     vvMainWindowBase.h
+     QTreePushButton.h
+     vvDocumentation.h
+     vvHelpDialog.h
+     vvQDicomSeriesSelector.h
+     vvSlicerManager.h
+     vvSlicer.h
+     vvStructureSetActor.h
+     vvROIActor.h
+     vvToolCreatorBase.h
+     )
+ endif()
  
- QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
+ if(vv_QT_VERSION VERSION_GREATER "4")
+   qt5_wrap_ui(vv_UI_CXX
+     qt_ui/vvHelpDialog.ui
+     qt_ui/vvDocumentation.ui
+     qt_ui/vvDicomSeriesSelector.ui
+     qt_ui/vvDummyWindow.ui #For testing
+     )
+ else()
+   QT4_WRAP_UI(vv_UI_CXX
+     qt_ui/vvHelpDialog.ui
+     qt_ui/vvDocumentation.ui
+     qt_ui/vvDicomSeriesSelector.ui
+     qt_ui/vvDummyWindow.ui #For testing
+     )
+ endif()
+ if(vv_QT_VERSION VERSION_GREATER "4")
+   QT5_add_resources(vv_SRCS vvIcons.qrc)
+ else()
+   QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
+ endif()
 +
 +# Add DICOM SERVER gui selector if the adequate GDCM is available
- IF(CLITK_USE_PACS_CONNECTION)
++if(CLITK_USE_PACS_CONNECTION)
 +  SET(vv_SRCS ${vv_SRCS}
-       vvQPacsConnection.cxx
-         vvPacsSettingsDialog.cxx
-         vvDicomServerQueryFactory.cxx
-         )
-   QT4_WRAP_CPP(vv_SRCS vvQPacsConnection.h
-      vvPacsSettingsDialog.h)
-   QT4_WRAP_UI(vv_UI_CXX 
-       qt_ui/vvPacsConnection.ui
-      qt_ui/vvPacsSettingsDialog.ui)
- ENDIF(CLITK_USE_PACS_CONNECTION)
- # Add the autotools in the header vvToolsList.h for initialization of the dummy
- # variables in vv.cxx for the tools contained in vvLib
- if(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
-   file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
-   foreach(tool ${vv_TOOLS})
-     FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n")
-     FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n")
-     FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n")
++    vvQPacsConnection.cxx
++      vvPacsSettingsDialog.cxx
++      vvDicomServerQueryFactory.cxx
++      )
++  if(vv_QT_VERSION VERSION_GREATER "4")
++    qt5_wrap_cpp(vv_SRCS vvQPacsConnection.h
++      vvPacsSettingsDialog.h)
++    qt5_wrap_ui(vv_UI_CXX 
++        qt_ui/vvPacsConnection.ui
++      qt_ui/vvPacsSettingsDialog.ui)
++  else()
++    QT4_WRAP_CPP(vv_SRCS vvQPacsConnection.h
++      vvPacsSettingsDialog.h)
++    QT4_WRAP_UI(vv_UI_CXX 
++        qt_ui/vvPacsConnection.ui
++      qt_ui/vvPacsSettingsDialog.ui)
++  endif()
++endif(CLITK_USE_PACS_CONNECTION)
+   
+   # Add the autotools in the header vvToolsList.h for initialization of the dummy
+   # variables in vv.cxx for the tools contained in vvLib
+   if(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
+     file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
+     foreach(tool ${vv_TOOLS})
+       file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n")
+       file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n")
+       file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n")
+     endforeach(tool)
+   endif(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
+   
+   # Add the autotools and the common files ui
+   foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
+       set(vv_SRCS ${vv_SRCS} ${tool}.cxx)
+       if(vv_QT_VERSION VERSION_GREATER "4")
+         QT5_WRAP_CPP(vv_SRCS ${tool}.h)
+         QT5_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
+       else()
+         QT4_WRAP_CPP(vv_SRCS ${tool}.h)
+         QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
+       endif()
    endforeach(tool)
- endif(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
- # Add the autotools and the common files ui
- foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
-   SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
-   QT4_WRAP_CPP(vv_SRCS ${tool}.h)
-   QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
- endforeach(tool)
- # Add the common source files
- foreach(tool ${vv_COMMON})
-   SET(vv_SRCS ${vv_SRCS} ${tool}.cxx)
-   QT4_WRAP_CPP(vv_SRCS ${tool}.h)
- endforeach(tool)
- # if Windows and Qt was built as a static lib then don't set QT_DLL flag
- SET(QT_STATIC 0)
- IF (WIN32)
-   IF(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
-     FILE(READ ${QT_LIBRARY_DIR}/QtCore.prl QT_CORE_PRL)
-     IF(${QT_CORE_PRL} MATCHES "static")
-       SET(QT_STATIC 1)
-     ENDIF(${QT_CORE_PRL} MATCHES "static")
-   ENDIF(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
- ENDIF(WIN32)
- IF(NOT QT_STATIC)
-   ADD_DEFINITIONS(-DQT_DLL)
- ENDIF(NOT QT_STATIC)
- ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
+   
+   # Add the common source files
+   foreach(tool ${vv_COMMON})
+       set(vv_SRCS ${vv_SRCS} ${tool}.cxx)
+       if(vv_QT_VERSION VERSION_GREATER "4")
+         QT5_WRAP_CPP(vv_SRCS ${tool}.h)
+       else()
+         QT4_WRAP_CPP(vv_SRCS ${tool}.h)
+       endif()
+   endforeach(tool)
+   
+   # if Windows and Qt was built as a static lib then don't set QT_DLL flag
+   set(QT_STATIC 0)
+   if(WIN32)
+     if(vv_QT_VERSION VERSION_GREATER "4")
+       if(EXISTS ${Qt5Widgets_LIBRARIES}/QtCore.prl)
+         file(READ ${Qt5Widgets_LIBRARIES}/QtCore.prl QT_CORE_PRL)
+         if(${QT_CORE_PRL} MATCHES "static")
+           set(QT_STATIC 1)
+         endif(${QT_CORE_PRL} MATCHES "static")
+       endif(EXISTS ${Qt5Widgets_LIBRARIES}/QtCore.prl)
+     else()
+       if(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
+         file(READ ${QT_LIBRARY_DIR}/QtCore.prl QT_CORE_PRL)
+         if(${QT_CORE_PRL} MATCHES "static")
+           set(QT_STATIC 1)
+         endif(${QT_CORE_PRL} MATCHES "static")
+       endif(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
+     endif()
+   endif(WIN32)
+   if(NOT QT_STATIC)
+     add_definitions(-DQT_DLL)
+   endif(NOT QT_STATIC)
  
- INCLUDE_DIRECTORIES(
-   ${QT_INCLUDES}
-   ${QT_INCLUDE_DIR}
-   ${QT_QTGUI_INCLUDE_DIR}
-   ${QT_QTCORE_INCLUDE_DIR}
-   ${CMAKE_CURRENT_BINARY_DIR}
-   ${CMAKE_CURRENT_SOURCE_DIR}
- )
+   add_definitions(-DQT_THREAD_SUPPORT)
+   if(vv_QT_VERSION VERSION_GREATER "4")
+     include_directories(
+       ${Qt5Widgets_INCLUDE_DIRS}
+       ${Qt5Gui_INCLUDE_DIRS}
+       ${Qt5Core_INCLUDE_DIRS}
+       ${Qt5Network_INCLUDE_DIRS}
+       ${Qt5Designer_INCLUDE_DIRS}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_CURRENT_SOURCE_DIR}
+     )
+   else()
+     include_directories(
+       ${QT_INCLUDES}
+       ${QT_INCLUDE_DIR}
+       ${QT_QTGUI_INCLUDE_DIR}
+       ${QT_QTCORE_INCLUDE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_CURRENT_SOURCE_DIR}
+     )
+   endif()
  #=========================================================
  
  #=========================================================
Simple merge
index e6c044ab7a20fbcc9bea507ac5837fae7cdc3c40,0000000000000000000000000000000000000000..3347fec2ad23ce2585a67ad8e1e4f50ae3b3c030
mode 100644,000000..100644
--- /dev/null
@@@ -1,862 -1,0 +1,862 @@@
-     <widget class="QWidget" name="layoutWidget">
 +<?xml version="1.0" encoding="UTF-8"?>
 +<ui version="4.0">
 + <class>vvPacsConnection</class>
 + <widget class="QWidget" name="vvPacsConnection">
 +  <property name="geometry">
 +   <rect>
 +    <x>0</x>
 +    <y>0</y>
 +    <width>933</width>
 +    <height>802</height>
 +   </rect>
 +  </property>
 +  <property name="font">
 +   <font>
 +    <family>Calibri</family>
 +    <pointsize>9</pointsize>
 +    <weight>75</weight>
 +    <bold>true</bold>
 +   </font>
 +  </property>
 +  <property name="windowTitle">
 +   <string>Form</string>
 +  </property>
 +  <widget class="QLabel" name="label_ID">
 +   <property name="enabled">
 +    <bool>false</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>110</x>
 +     <y>10</y>
 +     <width>91</width>
 +     <height>16</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>Patient ID</string>
 +   </property>
 +  </widget>
 +  <widget class="QTextEdit" name="patientID">
 +   <property name="geometry">
 +    <rect>
 +     <x>110</x>
 +     <y>30</y>
 +     <width>101</width>
 +     <height>21</height>
 +    </rect>
 +   </property>
 +   <property name="verticalScrollBarPolicy">
 +    <enum>Qt::ScrollBarAlwaysOff</enum>
 +   </property>
 +   <property name="horizontalScrollBarPolicy">
 +    <enum>Qt::ScrollBarAlwaysOff</enum>
 +   </property>
 +   <property name="readOnly">
 +    <bool>false</bool>
 +   </property>
 +  </widget>
 +  <widget class="QPushButton" name="scanButton">
 +   <property name="geometry">
 +    <rect>
 +     <x>10</x>
 +     <y>40</y>
 +     <width>75</width>
 +     <height>23</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>SCAN</string>
 +   </property>
 +  </widget>
 +  <widget class="QPushButton" name="clearButton">
 +   <property name="geometry">
 +    <rect>
 +     <x>10</x>
 +     <y>70</y>
 +     <width>75</width>
 +     <height>23</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>CLEAR</string>
 +   </property>
 +  </widget>
 +  <widget class="QTextEdit" name="patientName">
 +   <property name="geometry">
 +    <rect>
 +     <x>250</x>
 +     <y>30</y>
 +     <width>101</width>
 +     <height>21</height>
 +    </rect>
 +   </property>
 +   <property name="verticalScrollBarPolicy">
 +    <enum>Qt::ScrollBarAlwaysOff</enum>
 +   </property>
 +   <property name="horizontalScrollBarPolicy">
 +    <enum>Qt::ScrollBarAlwaysOff</enum>
 +   </property>
 +   <property name="readOnly">
 +    <bool>false</bool>
 +   </property>
 +  </widget>
 +  <widget class="QLabel" name="label_NAME">
 +   <property name="enabled">
 +    <bool>false</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>250</x>
 +     <y>10</y>
 +     <width>91</width>
 +     <height>16</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>Patient name</string>
 +   </property>
 +  </widget>
 +  <widget class="QToolButton" name="importButton">
 +   <property name="geometry">
 +    <rect>
 +     <x>10</x>
 +     <y>160</y>
 +     <width>51</width>
 +     <height>51</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string notr="true">...</string>
 +   </property>
 +   <property name="icon">
 +    <iconset resource="../vvIcons.qrc">
 +     <normaloff>:/common/icons/basket_download.png</normaloff>:/common/icons/basket_download.png</iconset>
 +   </property>
 +   <property name="iconSize">
 +    <size>
 +     <width>32</width>
 +     <height>32</height>
 +    </size>
 +   </property>
 +  </widget>
 +  <widget class="QGroupBox" name="groupBox">
 +   <property name="geometry">
 +    <rect>
 +     <x>90</x>
 +     <y>140</y>
 +     <width>311</width>
 +     <height>271</height>
 +    </rect>
 +   </property>
 +   <property name="font">
 +    <font>
 +     <pointsize>11</pointsize>
 +    </font>
 +   </property>
 +   <property name="title">
 +    <string>Patients</string>
 +   </property>
 +   <widget class="QTreeView" name="patientTreeView">
 +    <property name="enabled">
 +     <bool>true</bool>
 +    </property>
 +    <property name="geometry">
 +     <rect>
 +      <x>20</x>
 +      <y>20</y>
 +      <width>281</width>
 +      <height>231</height>
 +     </rect>
 +    </property>
 +    <property name="verticalScrollBarPolicy">
 +     <enum>Qt::ScrollBarAlwaysOn</enum>
 +    </property>
 +    <property name="sortingEnabled">
 +     <bool>true</bool>
 +    </property>
 +    <property name="expandsOnDoubleClick">
 +     <bool>false</bool>
 +    </property>
 +   </widget>
 +  </widget>
 +  <widget class="QGroupBox" name="groupBox_2">
 +   <property name="geometry">
 +    <rect>
 +     <x>410</x>
 +     <y>150</y>
 +     <width>451</width>
 +     <height>271</height>
 +    </rect>
 +   </property>
 +   <property name="font">
 +    <font>
 +     <pointsize>11</pointsize>
 +    </font>
 +   </property>
 +   <property name="title">
 +    <string>Studies</string>
 +   </property>
 +   <widget class="QTreeView" name="studyTreeView">
 +    <property name="geometry">
 +     <rect>
 +      <x>40</x>
 +      <y>20</y>
 +      <width>411</width>
 +      <height>231</height>
 +     </rect>
 +    </property>
 +   </widget>
 +  </widget>
 +  <widget class="QTreeView" name="seriesTreeView">
 +   <property name="geometry">
 +    <rect>
 +     <x>110</x>
 +     <y>450</y>
 +     <width>281</width>
 +     <height>311</height>
 +    </rect>
 +   </property>
 +  </widget>
 +  <widget class="QTreeView" name="imagesTreeView">
 +   <property name="geometry">
 +    <rect>
 +     <x>450</x>
 +     <y>450</y>
 +     <width>411</width>
 +     <height>311</height>
 +    </rect>
 +   </property>
 +  </widget>
 +  <widget class="QGroupBox" name="groupBox_3">
 +   <property name="geometry">
 +    <rect>
 +     <x>90</x>
 +     <y>430</y>
 +     <width>321</width>
 +     <height>341</height>
 +    </rect>
 +   </property>
 +   <property name="font">
 +    <font>
 +     <pointsize>11</pointsize>
 +    </font>
 +   </property>
 +   <property name="title">
 +    <string>Series</string>
 +   </property>
 +  </widget>
 +  <widget class="QGroupBox" name="groupBox_4">
 +   <property name="geometry">
 +    <rect>
 +     <x>420</x>
 +     <y>430</y>
 +     <width>451</width>
 +     <height>341</height>
 +    </rect>
 +   </property>
 +   <property name="font">
 +    <font>
 +     <pointsize>11</pointsize>
 +    </font>
 +   </property>
 +   <property name="title">
 +    <string>Images</string>
 +   </property>
 +  </widget>
 +  <widget class="QTextEdit" name="text_PHYS">
 +   <property name="enabled">
 +    <bool>false</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>110</x>
 +     <y>80</y>
 +     <width>101</width>
 +     <height>21</height>
 +    </rect>
 +   </property>
 +   <property name="verticalScrollBarPolicy">
 +    <enum>Qt::ScrollBarAlwaysOff</enum>
 +   </property>
 +   <property name="horizontalScrollBarPolicy">
 +    <enum>Qt::ScrollBarAlwaysOff</enum>
 +   </property>
 +   <property name="readOnly">
 +    <bool>false</bool>
 +   </property>
 +  </widget>
 +  <widget class="QLabel" name="label_PHYS">
 +   <property name="enabled">
 +    <bool>false</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>110</x>
 +     <y>60</y>
 +     <width>91</width>
 +     <height>16</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>Physician Ref.</string>
 +   </property>
 +  </widget>
 +  <widget class="QLabel" name="label_SDESC">
 +   <property name="enabled">
 +    <bool>false</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>250</x>
 +     <y>60</y>
 +     <width>91</width>
 +     <height>16</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>Study Description</string>
 +   </property>
 +  </widget>
 +  <widget class="QTextEdit" name="text_SDESC">
 +   <property name="enabled">
 +    <bool>false</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>250</x>
 +     <y>80</y>
 +     <width>101</width>
 +     <height>21</height>
 +    </rect>
 +   </property>
 +   <property name="verticalScrollBarPolicy">
 +    <enum>Qt::ScrollBarAlwaysOff</enum>
 +   </property>
 +   <property name="horizontalScrollBarPolicy">
 +    <enum>Qt::ScrollBarAlwaysOff</enum>
 +   </property>
 +   <property name="readOnly">
 +    <bool>false</bool>
 +   </property>
 +  </widget>
 +  <widget class="QTabWidget" name="tabFilter">
 +   <property name="enabled">
 +    <bool>true</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>390</x>
 +     <y>0</y>
 +     <width>271</width>
 +     <height>131</height>
 +    </rect>
 +   </property>
 +   <property name="currentIndex">
 +    <number>0</number>
 +   </property>
 +   <widget class="QWidget" name="modalityTab">
 +    <property name="enabled">
 +     <bool>false</bool>
 +    </property>
 +    <attribute name="title">
 +     <string>Modalities</string>
 +    </attribute>
 +    <widget class="QWidget" name="layoutWidget">
 +     <property name="geometry">
 +      <rect>
 +       <x>0</x>
 +       <y>10</y>
 +       <width>264</width>
 +       <height>72</height>
 +      </rect>
 +     </property>
 +     <layout class="QVBoxLayout" name="verticalLayout">
 +      <item>
 +       <layout class="QHBoxLayout" name="horizontalLayout">
 +        <item>
 +         <widget class="QCheckBox" name="check_MR">
 +          <property name="text">
 +           <string>MR</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_CR">
 +          <property name="text">
 +           <string>CR</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_OT">
 +          <property name="text">
 +           <string>OT</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_RF">
 +          <property name="text">
 +           <string>RF</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_SC">
 +          <property name="text">
 +           <string>SC</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_CT">
 +          <property name="text">
 +           <string>CT</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +       </layout>
 +      </item>
 +      <item>
 +       <layout class="QHBoxLayout" name="horizontalLayout_2">
 +        <item>
 +         <widget class="QCheckBox" name="check_US">
 +          <property name="text">
 +           <string>US</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_NM">
 +          <property name="text">
 +           <string>NM</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_DR">
 +          <property name="text">
 +           <string>DR</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_SR">
 +          <property name="text">
 +           <string>SR</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_XA">
 +          <property name="text">
 +           <string>XA</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +        <item>
 +         <widget class="QCheckBox" name="check_MG">
 +          <property name="text">
 +           <string>MG</string>
 +          </property>
 +          <property name="checked">
 +           <bool>true</bool>
 +          </property>
 +         </widget>
 +        </item>
 +       </layout>
 +      </item>
 +      <item>
 +       <widget class="QCheckBox" name="check_ModAll">
 +        <property name="enabled">
 +         <bool>false</bool>
 +        </property>
 +        <property name="text">
 +         <string>All</string>
 +        </property>
 +        <property name="checked">
 +         <bool>true</bool>
 +        </property>
 +       </widget>
 +      </item>
 +     </layout>
 +    </widget>
 +   </widget>
 +   <widget class="QWidget" name="dateTab">
 +    <property name="enabled">
 +     <bool>false</bool>
 +    </property>
 +    <attribute name="title">
 +     <string>Date</string>
 +    </attribute>
 +    <widget class="QComboBox" name="comboDate">
 +     <property name="geometry">
 +      <rect>
 +       <x>20</x>
 +       <y>20</y>
 +       <width>101</width>
 +       <height>22</height>
 +      </rect>
 +     </property>
 +     <item>
 +      <property name="text">
 +       <string>Before</string>
 +      </property>
 +     </item>
 +     <item>
 +      <property name="text">
 +       <string>After</string>
 +      </property>
 +     </item>
 +     <item>
 +      <property name="text">
 +       <string>Between</string>
 +      </property>
 +     </item>
 +    </widget>
 +    <widget class="QDateEdit" name="dateEdit">
 +     <property name="geometry">
 +      <rect>
 +       <x>130</x>
 +       <y>20</y>
 +       <width>110</width>
 +       <height>22</height>
 +      </rect>
 +     </property>
 +    </widget>
 +    <widget class="QDateEdit" name="dateBetweenEdit">
 +     <property name="geometry">
 +      <rect>
 +       <x>130</x>
 +       <y>50</y>
 +       <width>110</width>
 +       <height>22</height>
 +      </rect>
 +     </property>
 +    </widget>
 +   </widget>
 +  </widget>
 +  <widget class="QTabWidget" name="tabNetwork">
 +   <property name="geometry">
 +    <rect>
 +     <x>680</x>
 +     <y>0</y>
 +     <width>251</width>
 +     <height>151</height>
 +    </rect>
 +   </property>
 +   <property name="currentIndex">
 +    <number>0</number>
 +   </property>
 +   <widget class="QWidget" name="networkSelect">
 +    <attribute name="title">
 +     <string>Network</string>
 +    </attribute>
 +    <widget class="QComboBox" name="networkCombo">
 +     <property name="geometry">
 +      <rect>
 +       <x>20</x>
 +       <y>40</y>
 +       <width>191</width>
 +       <height>22</height>
 +      </rect>
 +     </property>
 +    </widget>
 +   </widget>
 +   <widget class="QWidget" name="networkConfig">
 +    <attribute name="title">
 +     <string>Network management</string>
 +    </attribute>
 +    <widget class="QPushButton" name="NetworkButton">
 +     <property name="geometry">
 +      <rect>
 +       <x>180</x>
 +       <y>90</y>
 +       <width>61</width>
 +       <height>23</height>
 +      </rect>
 +     </property>
 +     <property name="text">
 +      <string>Save</string>
 +     </property>
 +    </widget>
++    <widget class="QWidget" name="layoutWidget1">
 +     <property name="geometry">
 +      <rect>
 +       <x>0</x>
 +       <y>0</y>
 +       <width>179</width>
 +       <height>120</height>
 +      </rect>
 +     </property>
 +     <layout class="QGridLayout" name="gridLayout">
 +      <item row="0" column="0">
 +       <widget class="QLabel" name="label_ID_3">
 +        <property name="enabled">
 +         <bool>false</bool>
 +        </property>
 +        <property name="text">
 +         <string>Name</string>
 +        </property>
 +       </widget>
 +      </item>
 +      <item row="0" column="1">
 +       <widget class="QLineEdit" name="NameEdit"/>
 +      </item>
 +      <item row="1" column="1">
 +       <widget class="QLineEdit" name="AETitleEdit"/>
 +      </item>
 +      <item row="2" column="0">
 +       <widget class="QLabel" name="label_ID_4">
 +        <property name="enabled">
 +         <bool>false</bool>
 +        </property>
 +        <property name="text">
 +         <string>Adress</string>
 +        </property>
 +       </widget>
 +      </item>
 +      <item row="2" column="1">
 +       <widget class="QLineEdit" name="AdressEdit"/>
 +      </item>
 +      <item row="3" column="0">
 +       <widget class="QLabel" name="label_ID_5">
 +        <property name="enabled">
 +         <bool>false</bool>
 +        </property>
 +        <property name="text">
 +         <string>Port</string>
 +        </property>
 +       </widget>
 +      </item>
 +      <item row="3" column="1">
 +       <widget class="QLineEdit" name="PortEdit"/>
 +      </item>
 +      <item row="1" column="0">
 +       <widget class="QLabel" name="label_ID_2">
 +        <property name="enabled">
 +         <bool>false</bool>
 +        </property>
 +        <property name="text">
 +         <string>AE Title</string>
 +        </property>
 +       </widget>
 +      </item>
 +     </layout>
 +    </widget>
 +    <widget class="QPushButton" name="removeNetworkButton">
 +     <property name="geometry">
 +      <rect>
 +       <x>180</x>
 +       <y>10</y>
 +       <width>61</width>
 +       <height>23</height>
 +      </rect>
 +     </property>
 +     <property name="text">
 +      <string>Remove</string>
 +     </property>
 +    </widget>
 +   </widget>
 +  </widget>
 +  <widget class="QLabel" name="label_2">
 +   <property name="enabled">
 +    <bool>true</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>10</x>
 +     <y>210</y>
 +     <width>71</width>
 +     <height>16</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>Import Data</string>
 +   </property>
 +  </widget>
 +  <widget class="QLabel" name="label_help">
 +   <property name="enabled">
 +    <bool>true</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>10</x>
 +     <y>530</y>
 +     <width>51</width>
 +     <height>20</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>Help</string>
 +   </property>
 +   <property name="alignment">
 +    <set>Qt::AlignCenter</set>
 +   </property>
 +  </widget>
 +  <widget class="QToolButton" name="helpButton">
 +   <property name="geometry">
 +    <rect>
 +     <x>10</x>
 +     <y>480</y>
 +     <width>51</width>
 +     <height>51</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string notr="true">...</string>
 +   </property>
 +   <property name="icon">
 +    <iconset resource="../vvIcons.qrc">
 +     <normaloff>:/common/icons/bullet_info.png</normaloff>:/common/icons/bullet_info.png</iconset>
 +   </property>
 +   <property name="iconSize">
 +    <size>
 +     <width>32</width>
 +     <height>32</height>
 +    </size>
 +   </property>
 +  </widget>
 +  <widget class="QToolButton" name="optionsButton">
 +   <property name="geometry">
 +    <rect>
 +     <x>10</x>
 +     <y>400</y>
 +     <width>51</width>
 +     <height>51</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string notr="true"/>
 +   </property>
 +   <property name="icon">
 +    <iconset resource="../vvIcons.qrc">
 +     <normaloff>:/common/icons/edit.png</normaloff>:/common/icons/edit.png</iconset>
 +   </property>
 +   <property name="iconSize">
 +    <size>
 +     <width>32</width>
 +     <height>32</height>
 +    </size>
 +   </property>
 +  </widget>
 +  <widget class="QLabel" name="label_email_2">
 +   <property name="enabled">
 +    <bool>true</bool>
 +   </property>
 +   <property name="geometry">
 +    <rect>
 +     <x>20</x>
 +     <y>450</y>
 +     <width>41</width>
 +     <height>21</height>
 +    </rect>
 +   </property>
 +   <property name="text">
 +    <string>Options</string>
 +   </property>
 +  </widget>
 +  <zorder>groupBox_4</zorder>
 +  <zorder>groupBox_3</zorder>
 +  <zorder>label_ID</zorder>
 +  <zorder>patientID</zorder>
 +  <zorder>scanButton</zorder>
 +  <zorder>clearButton</zorder>
 +  <zorder>patientName</zorder>
 +  <zorder>label_NAME</zorder>
 +  <zorder>importButton</zorder>
 +  <zorder>groupBox</zorder>
 +  <zorder>groupBox_2</zorder>
 +  <zorder>seriesTreeView</zorder>
 +  <zorder>imagesTreeView</zorder>
 +  <zorder>text_PHYS</zorder>
 +  <zorder>label_PHYS</zorder>
 +  <zorder>label_SDESC</zorder>
 +  <zorder>text_SDESC</zorder>
 +  <zorder>tabFilter</zorder>
 +  <zorder>tabNetwork</zorder>
 +  <zorder>label_2</zorder>
 +  <zorder>label_help</zorder>
 +  <zorder>helpButton</zorder>
 +  <zorder>optionsButton</zorder>
 +  <zorder>label_email_2</zorder>
 + </widget>
 + <tabstops>
 +  <tabstop>scanButton</tabstop>
 +  <tabstop>patientID</tabstop>
 +  <tabstop>clearButton</tabstop>
 +  <tabstop>patientName</tabstop>
 +  <tabstop>importButton</tabstop>
 +  <tabstop>seriesTreeView</tabstop>
 +  <tabstop>imagesTreeView</tabstop>
 +  <tabstop>text_PHYS</tabstop>
 +  <tabstop>text_SDESC</tabstop>
 +  <tabstop>tabFilter</tabstop>
 +  <tabstop>tabNetwork</tabstop>
 +  <tabstop>helpButton</tabstop>
 +  <tabstop>optionsButton</tabstop>
 +  <tabstop>patientTreeView</tabstop>
 +  <tabstop>studyTreeView</tabstop>
 +  <tabstop>check_MR</tabstop>
 +  <tabstop>check_CR</tabstop>
 +  <tabstop>check_OT</tabstop>
 +  <tabstop>check_RF</tabstop>
 +  <tabstop>check_SC</tabstop>
 +  <tabstop>check_CT</tabstop>
 +  <tabstop>check_US</tabstop>
 +  <tabstop>check_NM</tabstop>
 +  <tabstop>check_DR</tabstop>
 +  <tabstop>check_SR</tabstop>
 +  <tabstop>check_XA</tabstop>
 +  <tabstop>check_MG</tabstop>
 +  <tabstop>check_ModAll</tabstop>
 +  <tabstop>comboDate</tabstop>
 +  <tabstop>dateEdit</tabstop>
 +  <tabstop>dateBetweenEdit</tabstop>
 +  <tabstop>networkCombo</tabstop>
 +  <tabstop>NetworkButton</tabstop>
 +  <tabstop>NameEdit</tabstop>
 +  <tabstop>AETitleEdit</tabstop>
 +  <tabstop>AdressEdit</tabstop>
 +  <tabstop>PortEdit</tabstop>
 +  <tabstop>removeNetworkButton</tabstop>
 + </tabstops>
 + <resources>
 +  <include location="../vvIcons.qrc"/>
 + </resources>
 + <connections/>
 +</ui>
diff --cc vv/vv.cxx
Simple merge
diff --cc vv/vvIcons.qrc
Simple merge
index a566c3aa96bed30fa99bb5e958efdb71937b1f26,1bc0759e8ee14671f60a29dcc493623f2f0293b0..ba3f3136d721d1d5240d498d19fea343d57e13dc
@@@ -47,11 -48,11 +48,14 @@@ It is distributed under dual licenc
  #include "vvMeshReader.h"
  #include "vvSaveState.h"
  #include "vvReadState.h"
 +#ifdef CLITK_USE_PACS_CONNECTION
 +#include "vvQPacsConnection.h"
 +#endif
  #include "clitkConfiguration.h"
  #include "clitkMatrix.h"
+ #ifdef Q_OS_OSX
+ # include "vvOSXHelper.h"
+ #endif
  
  // ITK include
  #include <itkImage.h>
  
  //------------------------------------------------------------------------------
  vvMainWindow::vvMainWindow():vvMainWindowBase()
- {
+ { 
    setupUi(this); // this sets up the GUI
 +  setDicomClient();
++
+   //Qt::WindowFlags flags = windowFlags();
+   //setWindowFlags(flags | Qt::WindowStaysOnTopHint);
    mInputPathName = "";
    mMenuTools = menuTools;
    //  mMenuSegmentation = menuSegmentation;
Simple merge
index 8f40ae6405b839e39cf5ea5d8c26a99cae94e35f,0000000000000000000000000000000000000000..89ac8412bc37a8a160c788473f2e9af3760b38dd
mode 100644,000000..100644
--- /dev/null
@@@ -1,436 -1,0 +1,436 @@@
-       //// Accession n°
 +#include "vvQPacsConnection.h"
 +#include "gdcmCompositeNetworkFunctions.h"
 +#include <QtGui/qlistview.h>
 +#include <qfile.h>
 +#include <QDate>
 +#include <QIcon>
 +#include <QDateTime>
 +#include "vvPacsSettingsDialog.h"
 +#include "vvUtils.h"
 +#include <algorithm>
 +#include <itkGDCMImageIO.h>
 +#include <itkGDCMSeriesFileNames.h>
 +
 +
 +vvQPacsConnection::vvQPacsConnection(QWidget *i_parent)
 +      :QDialog(i_parent)
 +{
 +      ui.setupUi(this);
 +      setWindowTitle(QString::fromUtf8("PACS CONNECTIONHHHH"));
 +      createTreeView();
 +      ui.tabFilter->setTabText(0,QString(tr("Modality")));
 +      ui.tabFilter->setTabText(1,QString(tr("Date")));
 +
 +      ui. tabNetwork->setTabText(0,QString(tr("Network")));
 +      ui. tabNetwork->setTabText(1,QString(tr("Configuration")));
 +      ui.check_ModAll->setEnabled(true);
 +      ui.networkCombo->addItem("");
 +      ui.networkCombo->addItems(getDicomServers());
 +      
 +      // Connection   
 +      connect(ui.networkCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(chooseServer(int)));
 +      connect(ui.removeNetworkButton,SIGNAL(clicked()),this,SLOT(removeServer()));
 +      connect(ui.NetworkButton,SIGNAL(clicked()),this,SLOT(modifyServer()));
 +      
 +      update();
 +}
 +
 +// remote a Dicom Server in VV settings
 +void vvQPacsConnection::removeServer()
 +{
 +      removeDicomServer(m_nickname);
 +      ui.networkCombo->removeItem(ui.networkCombo->findText(QString(m_nickname.c_str())));
 +      m_nickname="";
 +      refreshNetworks();
 +}
 +
 +// modify a Dicom Server in VV settings
 +void vvQPacsConnection::modifyServer()
 +{
 +      AddDicomServer(ui.NameEdit->text().toStdString(),ui.AETitleEdit->text().toStdString(),ui.AdressEdit->text().toStdString(),ui.PortEdit->text().toStdString());
 +      removeServer();
 +}
 +
 +// refresh the list of Dicom Servers available from VV settings
 +void vvQPacsConnection::refreshNetworks()
 +{
 +      ui.networkCombo->clear();
 +      ui.networkCombo->addItem(QString());
 +      ui.networkCombo->addItems(getDicomServers());
 +      ui.NameEdit->setText(QString());
 +      ui.AETitleEdit->setText(QString());
 +      ui.AdressEdit->setText(QString());
 +      ui.PortEdit->setText(QString());
 +      ui.tabNetwork->setCurrentIndex(0);
 +}
 +
 +void vvQPacsConnection::on_clearButton_clicked()
 +{
 +      Patientmodel->removeRows(0, Patientmodel->rowCount(),QModelIndex());
 +      Studymodel->removeRows(0, Studymodel->rowCount(),QModelIndex());
 +      Seriesmodel->removeRows(0, Seriesmodel->rowCount(),QModelIndex());
 +      Imagesmodel->removeRows(0, Imagesmodel->rowCount(),QModelIndex());
 +}
 +
 +void vvQPacsConnection::on_scanButton_clicked()
 +{
 +      cleanTree();
 +      manageStudiesFilter(true);
 +
 +      // test first if echo works
 +      bool didItWork = gdcm::CompositeNetworkFunctions::CEcho(m_adress.c_str(), atoi(m_port.c_str()), getDicomClientAETitle().c_str(), m_nickname.c_str() );
 +      if (didItWork)
 +      {
 +              m_level =gdcm::ePatient;
 +              std::vector<gdcm::DataSet> theDataSet;
 +              f_query = mQFactory.getQueryPatient(ui.patientName->toPlainText().toStdString(),        ui.patientID->toPlainText().toStdString());
 +
 +              bool cfindWork = gdcm::CompositeNetworkFunctions::CFind(m_adress.c_str(), atoi(m_port.c_str()), 
 +                      gdcm::CompositeNetworkFunctions::ConstructQuery(f_query.theRoot, f_query.theLevel ,f_query.keys),
 +                      theDataSet, getDicomClientAETitle().c_str()     , m_nickname.c_str());
 +              if( cfindWork)
 +              {
 +                      convertDataSet(theDataSet,Patientmodel,mQFactory.getPatientKeys("",""));
 +              } // end cfindwork
 +      } // end didItwork
 +}
 +
 +
 +/// show Options DialogBox to set a new Dicom Server
 +void vvQPacsConnection::on_optionsButton_clicked()
 +{
 +      vvPacsSettingsDialog *dg  = new vvPacsSettingsDialog(this);
 +      dg->show();
 +}
 +
 +void vvQPacsConnection::convertDataSet(std::vector<gdcm::DataSet> i_ds, QStandardItemModel *i_model, std::vector< std::pair<gdcm::Tag, std::string> > keys)
 +{
 +
 +      std::vector<gdcm::DataSet>::iterator it_ds = i_ds.begin();
 +      for(; it_ds != i_ds.end(); it_ds++)
 +      {
 +              QList<QStandardItem *> items;
 +              const gdcm::DataSet ds = (*it_ds);
 +              std::vector< std::pair<gdcm::Tag, std::string> >::iterator it_key = keys.begin();
 +              int ind = 0;
 +              for(; it_key != keys.end(); it_key++, ind++)
 +              {
 +                      gdcm::DataElement de = ds.GetDataElement((*it_key).first);
 +                      QStandardItem *item = new QStandardItem;
 +                      const gdcm::ByteValue *bv = (de).GetByteValue();
 +                      if( !de.IsEmpty() )
 +                      {
 +                              std::string buffer = std::string( bv->GetPointer(), bv->GetLength() );
 +                              item->setText(tr(buffer.c_str()));
 +                      }
 +                      else
 +                      {
 +                              item->setText(tr(""));
 +                      }
 +                      if(ind ==0)
 +                      {
 +                              item->setCheckable(true);
 +                      }
 +                      items.push_back(item);
 +              }
 +              i_model->appendRow(items);
 +      }
 +}
 +
 +// TreeViews creation
 +void vvQPacsConnection::createTreeView()
 +{
 +      // Patient Tree View
 +      Patientmodel = new QStandardItemModel(0,2,this); 
 +      QStringList Patientlist;
 +      Patientlist.push_back(tr("PATIENT NAME"));
 +      Patientlist.push_back(tr("PATIENT ID"));
 +      Patientmodel->setHorizontalHeaderLabels(Patientlist);
 +      ui.patientTreeView->setModel(Patientmodel);
 +      ui.patientTreeView->setEnabled(true);
 +      connect(ui.patientTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectStudies(QModelIndex)));
 +
 +      // Study Tree View
 +      Studymodel = new QStandardItemModel(0,3,this); 
 +      QStringList Studylist;
 +      Studylist.push_back(tr("DESCRIPTION"));
 +      Studylist.push_back(tr("DATE"));
 +      Studylist.push_back(tr("HOUR"));
 +      Studylist.push_back(tr("STUDY ID"));
 +      Studymodel->setHorizontalHeaderLabels(Studylist);
 +      ui.studyTreeView->setModel(Studymodel);
 +      connect(ui.studyTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectSeries(QModelIndex)));
 +
 +
 +      // Series Tree View
 +      Seriesmodel = new QStandardItemModel(0,2,this); 
 +      QStringList Serieslist;
 +      Serieslist.push_back(tr("MODALITY"));
 +      Serieslist.push_back(tr("DESCRIPTION"));
 +      Serieslist.push_back(tr("no. accept."));
 +      Seriesmodel->setHorizontalHeaderLabels(Serieslist);
 +      ui.seriesTreeView->setModel(Seriesmodel);
 +      connect(ui.seriesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectImages(QModelIndex)));
 +              connect(ui.imagesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectImage(QModelIndex)));
 +      // Images Tree View
 +      Imagesmodel = new QStandardItemModel(0,1,this); 
 +      QStringList Imageslist;
 +      Imageslist.push_back(tr("instance number"));
 +      Imageslist.push_back(tr("sopuid"));
 +      Imagesmodel->setHorizontalHeaderLabels(Imageslist);
 +      ui.imagesTreeView->setModel(Imagesmodel);
 +}
 +
 +// clean the different model Trees
 +void vvQPacsConnection::cleanTree()
 +{
 +      Patientmodel->removeRows(0,Patientmodel->rowCount());
 +      Studymodel->removeRows(0,Patientmodel->rowCount());
 +      Seriesmodel->removeRows(0,Patientmodel->rowCount());
 +      Imagesmodel->removeRows(0,Patientmodel->rowCount());
 +
 +}
 +
 +void vvQPacsConnection::selectStudies(const QModelIndex &index)
 +{
 +
 +              m_patient= Patientmodel->data(index.sibling(index.row(),1)).toString().toStdString();           
 +      Studymodel->removeRows(0, Studymodel->rowCount(),QModelIndex());
 +      Seriesmodel->removeRows(0, Seriesmodel->rowCount(),QModelIndex());
 +      Imagesmodel->removeRows(0, Imagesmodel->rowCount(),QModelIndex());
 +      manageSeriesFilter(true);
 +      convertDataSet( findQuery( mQFactory.getQueryforStudy(m_patient, false)) , Studymodel, mQFactory.getQueryKeysforStudy("",true));
 +}
 +
 +
 +void vvQPacsConnection::clearMove()
 +{
 +
 +}
 +
 +void vvQPacsConnection::selectSeries(const QModelIndex &index)
 +{
 +      m_study= Studymodel->data(index.sibling(index.row(),3)).toString().toStdString();
 +      Seriesmodel->removeRows(0, Seriesmodel->rowCount());
 +      Imagesmodel->removeRows(0, Imagesmodel->rowCount());
 +    convertDataSet( findQuery( mQFactory.getQueryforSeries(m_patient,m_study, false)), Seriesmodel, mQFactory.getSeriesKeys("","",true));
 +      
 +}
 +
 +void vvQPacsConnection::selectImages(const QModelIndex &index)
 +{
 +      m_series = Seriesmodel->data(index.sibling(index.row(),2)).toString().toStdString();
 +      Imagesmodel->removeRows(0, Imagesmodel->rowCount(),QModelIndex());
 +      convertDataSet( findQuery( mQFactory.getQueryforImages(m_patient,m_study, m_series, false) ),  Imagesmodel, mQFactory.getQueryKeysforImages("","","",true));
 + 
 +}
 +
 +void vvQPacsConnection::selectImage(const QModelIndex &index)
 +{
 +      std::string _image = Imagesmodel->data(index.sibling(index.row(),1)).toString().toStdString();
 +      mQFactory.setQueryforImage(m_patient,m_study, m_series, _image);
 +      
 +}
 +
 +
 +std::vector<gdcm::DataSet> vvQPacsConnection::findQuery(vvQuery i_query)
 +{
 +         std::vector<gdcm::DataSet> theDataSet;
 +         gdcm::CompositeNetworkFunctions::CFind(m_adress.c_str(), atoi(m_port.c_str()), 
 +              gdcm::CompositeNetworkFunctions::ConstructQuery(i_query.theRoot, i_query.theLevel,i_query.keys), theDataSet,  
 +              getDicomClientAETitle().c_str(), m_nickname.c_str());
 +      return theDataSet;
 +}
 +
 +void vvQPacsConnection::manageStudiesFilter(bool i_enable)
 +{
 +      ui.text_PHYS->setEnabled(i_enable);
 +      ui.text_SDESC->setEnabled(i_enable);
 +      ui.dateTab->setEnabled(i_enable);
 +
 +}
 +
 +void vvQPacsConnection::manageSeriesFilter(bool i_enable)
 +{
 +      ui.modalityTab->setEnabled(i_enable);
 +}
 +
 +
 +std::vector< std::pair<gdcm::Tag, std::string> > vvQPacsConnection::getStudyKeys(const std::string i_val)
 +{
 +      std::vector< std::pair<gdcm::Tag, std::string> > keys;
 +      // Study Description
 +      gdcm::Tag tagsdc(0x0008,0x1030);
 +      keys.push_back(std::make_pair(tagsdc, ""));
 +      // Study date
 +      gdcm::Tag tagdb(0x0008,0x0020);
 +      keys.push_back(std::make_pair(tagdb, ""));
 +      // Study Hour
 +      gdcm::Tag tagsdh(0x0008,0x0030);
 +      keys.push_back(std::make_pair(tagsdh, ""));
 +      // Study Instance UID
 +      gdcm::Tag tagsid(0x0020,0x000d);
 +      keys.push_back(std::make_pair(tagsid, i_val));
 +
 +      return keys;
 +}
 +
 +std::vector< std::pair<gdcm::Tag, std::string> > vvQPacsConnection::getKeys()
 +{
 +      std::vector< std::pair<gdcm::Tag, std::string> > keys;
 +      // Patient Name
 +      gdcm::Tag tag(0x0010,0x0010);
 +      keys.push_back(std::make_pair(tag, ""));
 +
 +      //// Patient ID
 +      gdcm::Tag tagpid(0x0010,0x0020);
 +      keys.push_back(std::make_pair(tagpid, ""));
 +
 +      // Modality
 +      gdcm::Tag tagmod(0x0008,0x0061);
 +      keys.push_back(std::make_pair(tagmod, ""));
 +
 +      // date of birth
 +      gdcm::Tag tagdb(0x0010,0x0030);
 +      keys.push_back(std::make_pair(tagdb, ""));
 +
 +      // Study Date
 +      gdcm::Tag tagsd(0x0020,0x000D);
 +      keys.push_back(std::make_pair(tagsd, ""));
 +
 +      //// Study Time
 +      //gdcm::Tag tagst(8,30);
 +      //keys.push_back(std::make_pair(tagst, ""));
 +
 +      //// Study Description
 +      //gdcm::Tag tagsdc(8,1030);
 +      //keys.push_back(std::make_pair(tagsdc, ""));
 +
-                       gdcm::CompositeNetworkFunctions::ConstructQuery(mQFactory.getMoveQuery().theRoot, mQFactory.getMoveQuery().theLevel ,mQFactory.getMoveQuery().keys,true),
++      //// Accession
 +      //gdcm::Tag tagacc(8,50);
 +      //keys.push_back(std::make_pair(tagacc, ""));
 +
 +      return keys;
 +}
 +
 +void vvQPacsConnection::on_check_ModAll_clicked(bool state)
 +{
 +      ui.check_MR->setEnabled(!state);
 +      ui.check_CR->setEnabled(!state);
 +      ui.check_OT->setEnabled(!state);
 +      ui.check_RF->setEnabled(!state);
 +      ui.check_SC->setEnabled(!state);
 +      ui.check_CT->setEnabled(!state);
 +      ui.check_US->setEnabled(!state);
 +      ui.check_NM->setEnabled(!state);
 +      ui.check_DR->setEnabled(!state);
 +      ui.check_US->setEnabled(!state);
 +      ui.check_NM->setEnabled(!state);
 +      ui.check_DR->setEnabled(!state);
 +      ui.check_SR->setEnabled(!state);
 +      ui.check_XA->setEnabled(!state);
 +      ui.check_MG->setEnabled(!state);
 +      if(state)
 +      {
 +              ui.check_MR->setChecked(state);
 +              ui.check_CR->setChecked(state);
 +              ui.check_OT->setChecked(state);
 +              ui.check_RF->setChecked(state);
 +              ui.check_SC->setChecked(state);
 +              ui.check_CT->setChecked(state);
 +              ui.check_US->setChecked(state);
 +              ui.check_NM->setChecked(state);
 +              ui.check_DR->setChecked(state);
 +              ui.check_US->setChecked(state);
 +              ui.check_NM->setChecked(state);
 +              ui.check_DR->setChecked(state);
 +              ui.check_SR->setChecked(state);
 +              ui.check_XA->setChecked(state);
 +              ui.check_MG->setChecked(state);
 +      }
 +
 +}
 +
 +void vvQPacsConnection::chooseServer(int index)
 +{
 +      std::map < std::string, std:: string> values = getDicomServer(ui.networkCombo->currentText());
 +      m_port = values["PORT"];
 +      m_aetitle = values["AETITLE"];
 +      m_adress= values["ADRESS"];
 +      m_nickname = values["nickname"];
 +      ui.AdressEdit->setText(QString(m_adress.c_str()));
 +      ui.AETitleEdit->setText(QString(m_aetitle.c_str()));
 +      ui.NameEdit->setText(QString(m_nickname.c_str()));
 +      ui.PortEdit->setText(QString(m_port.c_str()));
 +}
 +
 +void vvQPacsConnection::on_importButton_clicked()
 +      {
 +              setCursor(QCursor(Qt::WaitCursor));
 +              QString path = QString::fromStdString(getCMoveDirectory());
 +              QDir dirpath (path);
 +              if (dirpath.exists())
 +              {
 +                      QFileInfoList list = dirpath.entryInfoList( QDir::Files);
 +                      QFileInfoList::iterator it_file = dirpath.entryInfoList( QDir::Files).begin();
 +                      for(int i = 0; i < list.length() ; i++)
 +                      {
 +                                      QFile::remove(list.at(i).filePath());
 +                      }
 +              }
 +              else
 +              {
 +                      dirpath.mkdir(path);
 +              }
 +              bool didItWork =  gdcm::CompositeNetworkFunctions::CMove(m_adress.c_str(),atoi(m_port.c_str()),
-      //ds gérer recursive moi-meme pour progress ...
++                      gdcm::CompositeNetworkFunctions::ConstructQuery(mQFactory.getMoveQuery().theRoot, mQFactory.getMoveQuery().theLevel ,mQFactory.getMoveQuery().keys, gdcm::eMove),
 +                      getDicomClientPort(),  getDicomClientAETitle().c_str(), m_aetitle.c_str(), path.toStdString().c_str() );
 +              gdcm::Directory theDir;
 +              theDir.Load(path.toStdString().c_str());
 +     //m_files =      theDir.GetFilenames();
 +
 +     typedef itk::GDCMSeriesFileNames NamesGeneratorType;
 +     NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
 +     nameGenerator->SetUseSeriesDetails(true);
 +
++     //ds gerer recursive moi-meme pour progress ...
 +     nameGenerator->SetInputDirectory(path.toStdString());
 +
 +     // insert in table
 +     typedef std::vector<std::string> SeriesIdContainer;
 +     const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();
 +       std::map<std::string, std::vector<std::string>* > mListOfSeriesFilenames;
 +
 +
 +         m_fileseries.clear();
 +         
 +     for (unsigned int i=0; i<seriesUID.size(); i++) {
 +              m_fileseries.push_back( nameGenerator->GetFileNames(seriesUID[i]));
 +        }
 +         
 +         accept();
 +        setCursor(QCursor(Qt::ArrowCursor));
 +      }
 +
 +
 +
 +std::vector <std::string> vvQPacsConnection::getFileNames(int i_series)
 +{
 +      std::vector <std::string> filenames;
 +      gdcm::Directory::FilenamesType::iterator it = m_fileseries[i_series].begin();
 +      for (;it != m_fileseries[i_series].end(); it++)
 +              filenames.push_back(it->c_str());
 +      return filenames;
 +}
 +std::vector< std::pair<gdcm::Tag, std::string> > vvQPacsConnection::fillMoveKeys()
 +{
 +      std::vector< std::pair<gdcm::Tag, std::string> > keys;
 +      switch(m_level)
 +      {
 +      case gdcm::ePatient:
 +                      //keys.push_back(getPatientKeys("",""));
 +                      break;
 +      }
 +
 +      return keys;
 +}
diff --cc vv/vvUtils.h
index 4a7ffce79713c35e0976970666390c87d4204f94,5854b5b6141c6e6221acf7d4ddf4faf1b4d7a908..9a8046265a7810f506d734b2a12a4c7ce9034544
@@@ -33,26 -33,4 +33,26 @@@ QString getVVSettingsPath()
  ///by default nativeFormat
  QSettings::Format getSettingsOptionFormat();
  
- std::string getCMoveDirectory()
 +/// Add a Dicom Server to settings
 +void AddDicomServer(std::string nickname, std::string aetitle, std::string adress, std::string port);
 +
 +/// Remove a Dicom Server to settings
 +void removeDicomServer(std::string nickname);
 +
 +// get List of Dicom Servers
 +QStringList getDicomServers();
 +
 +// Set parameters for VV (AETITLE, port-scu) to allow c-move.
 +void setDicomClient();
 +
 +// get VV-AETITLE  for c-move parameters.
 +std::string getDicomClientAETitle();
 +
 +// get VV-PORT-SCU  for c-move parameters.
 +int getDicomClientPort();
 +
 +// get the directory where the dicom files will be stored during c-move action.
++std::string getCMoveDirectory();
 +
 +std::map <std::string,std::string > getDicomServer(QString nickname);
  #endif