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)
IF (CLITK_USE_SYSTEM_GDCM)
FIND_PACKAGE(GDCM REQUIRED)
include(${GDCM_USE_FILE})
- TARGET_LINK_LIBRARIES(clitkCommon vtkgdcm gdcmDICT gdcmMSFF)
+ TARGET_LINK_LIBRARIES(clitkCommon vtkgdcm gdcmDICT gdcmMSFF gdcmMEXD)
ENDIF()
#=========================================================
#cmakedefine01 CLITK_MEMORY_INFO
#cmakedefine01 CLITK_PRIVATE_FEATURES
#cmakedefine01 CLITK_USE_SYSTEM_GDCM
+#cmakedefine01 CLITK_USE_PACS_CONNECTION
// Global environment variables
#define OS_NAME "@CMAKE_SYSTEM@"
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
#=========================================================
-
+OPTION(CLITK_USE_PACS_CONNECTION "USE PACS CONNECTION" OFF)
#=========================================================
#List of vv tools to compile
SET(vv_TOOLS
vvSlicerManager.cxx
vvSlicerManagerCommand.cxx
vvUtils.cxx
-# vvMaximumIntensityProjection.cxx
- vvMesh.cxx
+# vvMaximumIntensityProjection.cxx
+ vvMesh.cxx
vvMeshActor.cxx
vvMeshReader.cxx
vvMidPosition.cxx
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/vvDicomSeriesSelector.ui
+qt_ui/vvDummyWindow.ui #For testing
+#qt_ui/vvPacsConnection.ui
+ # qt_ui/vvPacsSettingsDialog.ui
+)
QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
+# Add DICOM SERVER gui selector if the adequate GDCM is available
+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)
# 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)
+ 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)
+ 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
<x>0</x>
<y>0</y>
<width>1008</width>
- <height>20</height>
+ <height>21</height>
</rect>
</property>
<property name="defaultUp">
<addaction name="separator"/>
<addaction name="actionOpen_Dicom"/>
<addaction name="actionOpen_VTK_contour"/>
+ <addaction name="actionConnect_Pacs"/>
<addaction name="separator"/>
<addaction name="actionSave_As"/>
<addaction name="separator"/>
<bool>true</bool>
</property>
</action>
+ <action name="actionConnect_Pacs">
+ <property name="text">
+ <string>Connect Pacs</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>
--- /dev/null
+<?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="layoutWidget">
+ <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>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>vvPacsSettingsDialog</class>
+ <widget class="QDialog" name="vvPacsSettingsDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>201</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>PACS settings</string>
+ </property>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="geometry">
+ <rect>
+ <x>40</x>
+ <y>160</y>
+ <width>341</width>
+ <height>32</height>
+ </rect>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ <widget class="QWidget" name="layoutWidget">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>361</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>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>vvPacsSettingsDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>vvPacsSettingsDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
+#pragma comment(lib, "ws2_32.lib")
typedef enum {O_BASE,O_OVERLAY,O_FUSION,O_VF,O_CONTOUR,O_LANDMARKS} OpenModeType;
typedef enum {P_NORMAL,P_SEQUENCE,P_WINDOW,P_LEVEL} ParseModeType;
--- /dev/null
+#include "vvDicomServerQueryFactory.h"
+
+
+gdcm::SmartPointer<gdcm::BaseRootQuery> vvDicomServerQueryFactory::composeQuerySeries( std::vector< std::pair<gdcm::Tag, std::string> > keys )
+{
+ gdcm::EQueryLevel theLevel = gdcm::eSeries;
+ gdcm::ERootType theRoot = gdcm::ePatientRootType;//ePatientRootType;
+ return gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
+}
+
+
+vvQuery vvDicomServerQueryFactory::getQueryforStudy(const std::string patient_id, bool bdisplay)
+{
+ vvQuery query;
+ query.keys = getQueryKeysforStudy( patient_id, bdisplay);
+ query.theRoot = gdcm::ePatientRootType;
+ query.theLevel = gdcm::eStudy;
+ m_query = getQueryPatient("",patient_id);
+ return query;
+}
+
+std::vector< std::pair<gdcm::Tag, std::string> > vvDicomServerQueryFactory::getQueryKeysforStudy(const std::string patient_id, bool bdisplay)
+{
+ 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 UID
+ gdcm::Tag tagsid(0x020,0x000d);
+ keys.push_back(std::make_pair(tagsid, ""));
+
+ if (!bdisplay)
+ {
+ // Patient ID
+ gdcm::Tag tagsd(0x0010,0x0020);
+ keys.push_back(std::make_pair(tagsd, patient_id));
+ }
+
+ return keys;
+}
+
+vvQuery vvDicomServerQueryFactory::getQueryforImages(const std::string patient_id, const std::string study_id, const std::string series_id,bool bdisplay)
+{
+ vvQuery query;
+ query.keys = getQueryKeysforImages( patient_id, study_id, series_id, bdisplay);
+ query.theRoot = gdcm::ePatientRootType;
+ query.theLevel = gdcm::eImage;
+ m_query = query;
+ return query;
+}
+
+std::vector< std::pair<gdcm::Tag, std::string> > vvDicomServerQueryFactory::getQueryKeysforImages(const std::string patient_id, const std::string study_id, const std::string series_id,bool bdisplay)
+{
+
+ std::vector< std::pair<gdcm::Tag, std::string> > keys;
+
+ if (!bdisplay)
+ {
+ //Patient UID
+ keys.push_back(std::make_pair(gdcm::Tag (0x0010,0x0020), patient_id));
+
+ //Study UID
+ // keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000d), study_id));
+
+ //Series UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000e), series_id));
+ }
+ // Image Description
+
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x0013), ""));
+ //SOP Instance UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0018), ""));
+ return keys;
+}
+
+
+
+vvQuery vvDicomServerQueryFactory::getQueryPatient(const std::string i_patname, const std::string i_patid)
+{
+ vvQuery query;
+ query.theRoot = gdcm::ePatientRootType;
+ query.theLevel = gdcm::ePatient;
+ query.keys = getPatientKeys(i_patname, i_patid);
+ m_query = query;
+ return query;
+
+}
+
+std::vector< std::pair<gdcm::Tag, std::string> > vvDicomServerQueryFactory::getPatientKeys(const std::string i_patname, const std::string i_patid)
+{
+ std::vector< std::pair<gdcm::Tag, std::string> > keys;
+ // Patient Name
+ gdcm::Tag tag(0x0010,0x0010);
+ keys.push_back(std::make_pair(tag, i_patname));
+
+ //// Patient ID
+ gdcm::Tag tagpid(0x0010,0x0020);
+ keys.push_back(std::make_pair(tagpid, i_patid));
+ return keys;
+}
+
+
+vvQuery vvDicomServerQueryFactory::getQueryforSeries(const std::string patient_id, const std::string series_id, bool bdisplay)
+{
+ vvQuery query;
+ query.theRoot = gdcm::ePatientRootType;
+ query.theLevel = gdcm::eSeries;
+ query.keys = getSeriesKeys(patient_id, series_id, bdisplay);
+ m_query = query;
+ return query;
+}
+std::vector< std::pair<gdcm::Tag, std::string> > vvDicomServerQueryFactory::getSeriesKeys(const std::string patient_id, const std::string study_id, bool bdisplay)
+{
+ std::vector< std::pair<gdcm::Tag, std::string> > keys;
+ // Modality
+ keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0060), ""));
+ // Study date
+
+ keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x103e),""));
+// Series Instance UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000e), ""));
+
+
+
+ if(!bdisplay)
+ {
+ //Patient UID
+ keys.push_back(std::make_pair(gdcm::Tag (0x0010,0x0020), patient_id));
+
+ //Study UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000d), study_id));
+ // Study Instance UID
+ gdcm::Tag tagsid(0x0020,0x1209);
+ // keys.push_back(std::make_pair(tagsid, study_id));
+ }
+
+ return keys;
+}
+
+void vvDicomServerQueryFactory::setQueryforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id)
+{
+ vvQuery query;
+ query.theRoot = gdcm::ePatientRootType;
+ query.theLevel = gdcm::eImage;
+ query.keys = getQueryKeysforImage(patient_id, study_id, series_id, image_id);
+ m_query = query;
+}
+
+std::vector< std::pair<gdcm::Tag, std::string> > vvDicomServerQueryFactory::getQueryKeysforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id)
+{
+
+ std::vector< std::pair<gdcm::Tag, std::string> > keys;
+
+ //Patient UID
+ keys.push_back(std::make_pair(gdcm::Tag (0x0010,0x0020), patient_id));
+
+ //Study UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000d), study_id));
+
+ //Series UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000e), series_id));
+
+ //SOP Instance UID
+ keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0018), image_id));
+ return keys;
+}
\ No newline at end of file
--- /dev/null
+#ifndef __vvDicomServerQueryFactory_h_INCLUDED__
+#define __vvDicomServerQueryFactory_h_INCLUDED__
+
+#include "gdcmCompositeNetworkFunctions.h"
+
+
+struct vvQuery{
+ gdcm::ERootType theRoot;
+ gdcm::EQueryLevel theLevel;
+ std::vector< std::pair<gdcm::Tag, std::string> > keys;
+};
+
+class vvDicomServerQueryFactory {
+
+public:
+
+ vvDicomServerQueryFactory(){}
+ ~vvDicomServerQueryFactory(){}
+
+ gdcm::SmartPointer<gdcm::BaseRootQuery> composeQuerySeries( std::vector< std::pair<gdcm::Tag, std::string> > keys);
+ gdcm::SmartPointer<gdcm::BaseRootQuery> composeQueryStudy( std::string m_patient);
+
+ vvQuery getQueryforImages(const std::string patient_id, const std::string study_id, const std::string series_id,bool bdisplay);
+ vvQuery getQueryforSeries(const std::string patient_id, const std::string study_id, bool bdisplay);
+ vvQuery getQueryforStudy(const std::string patient_id, bool bdisplay);
+ vvQuery getQueryPatient(const std::string i_patname, const std::string i_patid);
+ void setQueryforImage(const std::string patient_id, const std::string study_id,const std::string series_id,const std::string image_id);
+
+
+ std::vector< std::pair<gdcm::Tag, std::string> > getQueryKeysforStudy(const std::string patient_id, bool bdisplay);
+ std::vector< std::pair<gdcm::Tag, std::string> > getPatientKeys(const std::string , const std::string );
+ std::vector< std::pair<gdcm::Tag, std::string> > getSeriesKeys(const std::string patient_id, const std::string study_id, bool bdisplay);
+ std::vector< std::pair<gdcm::Tag, std::string> > getQueryKeysforImages(const std::string patient_id, const std::string study_id, const std::string series_id,bool bdisplay);
+ std::vector< std::pair<gdcm::Tag, std::string> > getQueryKeysforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id);
+
+
+ vvQuery getMoveQuery() { return m_query;}
+
+private:
+
+ vvQuery m_query;
+
+
+};
+#endif // __vvDicomServerQueryFactory_h_INCLUDED__
<file>icons/standardbutton-apply-16.png</file>
<file>icons/standardbutton-cancel-16.png</file>
<file>icons/identity.png</file>
+ <file>icons/basket_download.png</file>
+ <file>icons/edit.png</file>
+ <file>icons/bullet_info.png</file>
</qresource>
</RCC>
#include "vvMeshReader.h"
#include "vvSaveState.h"
#include "vvReadState.h"
+#ifdef CLITK_USE_PACS_CONNECTION
+#include "vvQPacsConnection.h"
+#endif
#include "clitkConfiguration.h"
// ITK include
vvMainWindow::vvMainWindow():vvMainWindowBase()
{
setupUi(this); // this sets up the GUI
-
+ setDicomClient();
mInputPathName = "";
mMenuTools = menuTools;
// mMenuSegmentation = menuSegmentation;
documentation = new vvDocumentation();
help_dialog = new vvHelpDialog();
dicomSeriesSelector = new vvDicomSeriesSelector();
+#ifdef CLITK_USE_PACS_CONNECTION
+ PacsConnection = new vvQPacsConnection();
+#endif
inverseButton->setEnabled(0);
actionAdd_overlay_image_to_current_image->setEnabled(0);
connect(actionWarp_image_with_vector_field,SIGNAL(triggered()),this,SLOT(WarpImage()));
connect(actionLoad_images,SIGNAL(triggered()),this,SLOT(OpenImages()));
connect(actionOpen_Dicom,SIGNAL(triggered()),this,SLOT(OpenDicom()));
+ #ifdef CLITK_USE_PACS_CONNECTION
+connect(actionConnect_Pacs,SIGNAL(triggered()),this,SLOT(ConnectPacs()));
+#endif
// connect(actionOpen_Dicom_Struct,SIGNAL(triggered()),this,SLOT(OpenDCStructContour()));
connect(actionOpen_VTK_contour,SIGNAL(triggered()),this,SLOT(OpenVTKContour()));
connect(actionOpen_Multiple_Images_As_One,SIGNAL(triggered()),this,SLOT(MergeImages()));
files = *(dicomSeriesSelector->GetFilenames());
LoadImages(files, vvImageReader::DICOM);
}
-}
+}
+#ifdef CLITK_USE_PACS_CONNECTION
+void vvMainWindow::ConnectPacs()
+{
+ std::vector<std::string> files;
+
+ //std::cout << "dicomSeriesSelector " << std::endl;
+if (PacsConnection->exec() == QDialog::Accepted) {
+ files = PacsConnection->getFileNames();
+ LoadImages(files, vvImageReader::DICOM);
+ PacsConnection->clearMove();
+ }
+ }
+
+#endif
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Authors belong to:
+ Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
class vtkRenderer;
class vtkMatrix4x4;
class vvDicomSeriesSelector;
+#ifdef CLITK_USE_PACS_CONNECTION
+class vvQPacsConnection;
+#endif
class vvSlicer;
class QTreeWidget;
void SliceImages();
void MergeImagesWithTime();
void OpenDicom();
+#ifdef CLITK_USE_PACS_CONNECTION
+ void ConnectPacs();
+#endif
///Open a vtkPolyData surface mesh and display it over the current image
void OpenVTKContour();
void SaveAs();
vvDocumentation *documentation;
vvDicomSeriesSelector *dicomSeriesSelector;
+#ifdef CLITK_USE_PACS_CONNECTION
+ vvQPacsConnection *PacsConnection;
+#endif
+
bool viewMode;
bool playMode;
--- /dev/null
+#include "vvPacsSettingsDialog.h"
+#include "vvQPacsConnection.h"
+#include "vvUtils.h"
+
+vvPacsSettingsDialog::vvPacsSettingsDialog(QWidget *i_parent)
+ : QDialog(i_parent)
+ {
+ mparent = i_parent;
+ ui.setupUi(this);
+ update();
+ }
+
+void vvPacsSettingsDialog::accept()
+{
+
+ AddDicomServer(ui.NameEdit->text().toStdString(),ui.AETitleEdit->text().toStdString(),ui.AdressEdit->text().toStdString(), ui.PortEdit->text().toStdString());
+((vvQPacsConnection*)this->parent())->refreshNetworks();
+ close();
+}
\ No newline at end of file
--- /dev/null
+#ifndef __vvPacsSettingsDialog_H
+#define __vvPacsSettingsDialog_H
+#include "ui_vvPacsSettingsDialog.h"
+#include <QFileDialog>
+#include <QWidget>
+
+ class vvPacsSettingsDialog : public QDialog
+ {
+ Q_OBJECT
+ public:
+
+ vvPacsSettingsDialog(QWidget *parent=0);
+
+ ~vvPacsSettingsDialog(){}
+ private:
+ QWidget *mparent;
+ Ui::vvPacsSettingsDialog ui;
+private slots:
+ void accept();
+
+ };
+#endif //__vvPacsSettingsDialog_H
--- /dev/null
+#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"
+
+
+
+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, ""));
+
+ //// Accession n°
+ //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 = QDir::homePath() +QString::fromStdString("/.move");
+ 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()),
+ gdcm::CompositeNetworkFunctions::ConstructQuery(mQFactory.getMoveQuery().theRoot, mQFactory.getMoveQuery().theLevel ,mQFactory.getMoveQuery().keys,true),
+ 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();
+
+ accept();
+ setCursor(QCursor(Qt::ArrowCursor));
+ }
+
+
+
+std::vector <std::string> vvQPacsConnection::getFileNames()
+{
+ std::vector <std::string> filenames;
+ gdcm::Directory::FilenamesType::iterator it = m_files.begin();
+ for (;it != m_files.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;
+}
--- /dev/null
+#ifndef __vvQPacsConnection_h_INCLUDED__
+#define __vvQPacsConnection_h_INCLUDED__
+
+#include <QWidget>
+#include "ui_vvPacsConnection.h"
+#include "gdcmCompositeNetworkFunctions.h"
+#include <QStandardItemModel>
+#include <QStringListModel>
+#include <QFileDialog>
+#include "vvDicomServerQueryFactory.h"
+
+ /**
+ * \ingroup GUI
+ */
+ //=====================================================================
+ //======================================================================
+
+
+
+class vvQPacsConnection : public QDialog
+{
+ Q_OBJECT
+public:
+ //vvQPacsConnection(){}
+ vvQPacsConnection(QWidget *parent=0);
+
+ ~vvQPacsConnection(){}
+ void refreshNetworks();
+ std::vector <std::string> getFileNames();
+ void clearMove();
+
+public slots:
+ void selectStudies(const QModelIndex &index);
+ void selectSeries(const QModelIndex &index);
+ void selectImages(const QModelIndex &index);
+ void selectImage(const QModelIndex &index);
+ private slots:
+ void on_scanButton_clicked();
+ void on_clearButton_clicked();
+ void on_optionsButton_clicked();
+ void on_check_ModAll_clicked(bool state);
+ void on_importButton_clicked();
+ void chooseServer(int index);
+ void removeServer();
+ void modifyServer();
+
+ private :
+
+
+ Ui::vvPacsConnection ui;
+ std::vector< std::pair<gdcm::Tag, std::string> > getKeys();
+ std::vector< std::pair<gdcm::Tag, std::string> > getStudyKeys(const std::string);
+ std::vector<gdcm::DataSet> findQuery(vvQuery i_query);
+
+ void manageStudiesFilter(bool i_enable);
+ void createTreeView();
+ void cleanTree();
+ void setNewPacs();
+ QStandardItemModel *Patientmodel;
+ QStandardItemModel *Studymodel;
+ QStandardItemModel *Seriesmodel;
+ QStandardItemModel *Imagesmodel;
+ void convertDataSet(std::vector<gdcm::DataSet> i_ds, QStandardItemModel *i_model, std::vector< std::pair<gdcm::Tag, std::string> > keys);
+ void manageSeriesFilter(bool i_enable);
+ std::vector< std::pair<gdcm::Tag, std::string> > fillMoveKeys();
+ std::string m_patient;
+ std::string m_study;
+ std::string m_series;
+ gdcm::EQueryLevel m_level;
+ std::string m_port;
+ std::string m_aetitle;
+ std::string m_adress;
+ std::string m_nickname;
+ vvDicomServerQueryFactory mQFactory;
+ vvQuery m_query;
+ vvQuery f_query;
+ gdcm::Directory::FilenamesType m_files;
+
+
+
+ }; // class vvQPacsConnection
+ //=====================================================================
+
+
+
+#endif // __vvQPacsConnection_h_INCLUDED__
+
+
return result;
}
+// Set parameters for VV (AETITLE, port-scu) to allow c-move.
+void setDicomClient()
+{
+ QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
+ settings.beginGroup(QString::fromStdString("DICOMCLIENT"));
+ settings.setValue("AETITLE",QString::fromStdString("VVDICOMSCU"));
+ settings.setValue("port",QString::number(1234));
+ settings.endGroup();
+}
+
+// get VV-AETITLE for c-move. parameters
+std::string getDicomClientAETitle()
+{
+ std::string result ="";
+ QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
+ settings.beginGroup(QString::fromStdString("DICOMCLIENT"));
+ result = settings.value("AETITLE").toString().toStdString();
+ settings.endGroup();
+ return result;
+}
+
+
+// get VV-PORT-SCU for c-move. parameters
+int getDicomClientPort()
+{
+ int result;
+ QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
+ settings.beginGroup(QString::fromStdString("DICOMCLIENT"));
+ result = settings.value("port").toString().toInt();
+ settings.endGroup();
+ return result;
+}
+
+/// Add a new Dicom Server
+void AddDicomServer(std::string nickname, std::string aetitle, std::string adress, std::string port)
+{
+ QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
+ settings.beginGroup(QString::fromStdString("DICOMSERVER"));
+ settings.beginWriteArray(QString::fromStdString(nickname));
+ settings.setValue("nickname",QString::fromStdString(nickname));
+ settings.setValue("AETITLE",QString::fromStdString(aetitle));
+ settings.setValue("ADRESS",QString::fromStdString(adress));
+ settings.setValue("PORT",QString::fromStdString(port));
+ settings.endGroup();
+}
+
+/// Remove a Dicom Server
+void removeDicomServer(std::string nickname)
+{
+ QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
+ settings.beginGroup(QString::fromStdString("DICOMSERVER"));
+ std::string temp = nickname + "//";
+ settings.remove(QString::fromStdString(temp + "nickname"));
+ settings.remove(QString::fromStdString(temp + "AETITLE"));
+ settings.remove(QString::fromStdString(temp + "ADRESS"));
+ settings.remove(QString::fromStdString(temp + "PORT"));
+ settings.endGroup();
+}
+
+
+
+
+/// get the list of a Dicom Server
+QStringList getDicomServers()
+{
+
+ QStringList list;
+ QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
+ settings.beginGroup(QString::fromStdString("DICOMSERVER"));
+ QStringList keys = settings.allKeys();
+ for(int i =0; i < keys.size(); i++)
+ {
+ QString val = keys.at(i);
+ if (val.contains("nickname"))
+ list.push_back(settings.value(val).toString());
+ }
+ return list;
+}
+
+/// get needed Infos for a Dicom Server
+std::map <std::string,std::string > getDicomServer(QString nickname)
+{
+ std::map< std::string, std::string >results;
+ QSettings settings(getVVSettingsPath(), getSettingsOptionFormat());
+ settings.beginGroup(QString::fromStdString("DICOMSERVER"));
+ settings.beginReadArray(nickname);
+ QStringList keys = settings.childKeys();
+ for (int i = 0; i <keys.size(); i++)
+ results[keys.at(i).toStdString()] = settings.value(keys.at(i)).toString().toStdString();
+ return results;
+
+}
+
///Adds an image to the list of recently opened images
void AddToRecentlyOpenedImages(std::string filename)
{
///by default nativeFormat
QSettings::Format getSettingsOptionFormat();
+/// 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();
+
+std::map <std::string,std::string > getDicomServer(QString nickname);
#endif