# 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
vvToolConvert ## with dummy vvToolConvert.ui
vvToolROIManager
vvToolSegmentation
+ vvToolProfile
## these ones are for tests (not working)
+ # vvToolTest
# vvToolFoo
# vvToolFooWithWidgetBase
# vvToolPlastimatch
- # vvToolConnectedComponentLabeling
+ # vvToolConnectedComponentLabeling
## these ones are old ones
# vvToolExtractPatient
# vvToolExtractLung
# dependencies of the tools
# Future issues : when tool depend on other tools ... how to manage that ?
# >> add the relevant $_LIBS variable to the tool that has dependencies?
- SET(vvToolBinarize_LIBS clitkBinarizeImageLib)
- SET(vvToolResample_LIBS clitkResampleImageLib)
- SET(vvToolConvert_LIBS clitkImageConvertLib)
- SET(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
- SET(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
- SET(vvToolCropImage_LIBS clitkCropImageLib)
- SET(vvToolMIP_LIBS clitkMIPLib)
- SET(vvToolMedianFilter_LIBS clitkMedianImageFilterLib)
- SET(vvToolImageArithm_LIBS clitkImageArithmImageLib)
- SET(vvToolROIManager_LIBS clitkDicomRTStruct)
+ set(vvToolBinarize_LIBS clitkBinarizeImageLib)
+ set(vvToolProfile_LIBS clitkProfileImageLib)
+ set(vvToolResample_LIBS clitkResampleImageLib)
+ set(vvToolConvert_LIBS clitkImageConvertLib)
+ set(vvToolExtractPatient_LIBS clitkSegmentationGgoLib)
+ set(vvToolExtractLung_LIBS clitkSegmentationGgoLib)
+ set(vvToolCropImage_LIBS clitkCropImageLib)
+ set(vvToolMIP_LIBS clitkMIPLib)
+ set(vvToolMedianFilter_LIBS clitkMedianImageFilterLib)
+ set(vvToolImageArithm_LIBS clitkImageArithmImageLib)
+ set(vvToolROIManager_LIBS clitkDicomRTStruct)
#=========================================================
# List of vv source files
# in COMMON_WITH_UI -> must have .h and .cxx and .ui
- SET(vv_COMMON_WITH_UI
+ set(vv_COMMON_WITH_UI
vvInfoPanel
- vvMainWindow
- vvLinkPanel
- vvOverlayPanel
- vvLandmarksPanel
- vvProgressDialog
+ vvMainWindow
+ vvLinkPanel
+ vvOverlayPanel
+ vvLandmarksPanel
+ vvProgressDialog
vvSegmentationDialog
vvSurfaceViewerDialog
vvDeformationDialog
vvStructSelector
vvIntensityValueSlider
vvLabelImageLoaderWidget
- vvToolWidgetBase
+ vvToolWidgetBase
vvToolSimpleInputSelectorWidget
vvToolInputSelectorWidget
vvRegisterForm
)
# All others sources
- SET(vv_SRCS
+ set(vv_SRCS
vvQProgressDialogITKCommand.cxx
vvQDicomSeriesSelector.cxx
QTreePushButton.cxx
vvSlicerManager.cxx
vvSlicerManagerCommand.cxx
vvUtils.cxx
-# vvMaximumIntensityProjection.cxx
- vvMesh.cxx
+# vvMaximumIntensityProjection.cxx
+ vvMesh.cxx
vvMeshActor.cxx
vvMeshReader.cxx
vvMidPosition.cxx
#=========================================================
# 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()
#=========================================================
#=========================================================
#support for parallel deformable registration with OpenMP
- IF(NOT APPLE)
- IF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
- ENDIF(CMAKE_COMPILER_IS_GNUCC)
- ENDIF(NOT APPLE)
+ if(NOT APPLE)
+ if(CMAKE_COMPILER_IS_GNUCC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
+ endif(CMAKE_COMPILER_IS_GNUCC)
+ endif(NOT APPLE)
#=========================================================
#=========================================================
- INCLUDE_DIRECTORIES(
+ include_directories(
../common
../tools
../segmentation
)
- LINK_DIRECTORIES(${QT_LIBRARY_DIR})
-
#=========================================================
#Add each tool's dependencies
foreach(tool ${vv_TOOLS})
- SET(toolLibs ${toolLibs} ${${tool}_LIBS})
+ set(toolLibs ${toolLibs} ${${tool}_LIBS})
endforeach(tool)
#=========================================================
#Add Foundation Libraries (this should be after our libraries, since we depend
#on them)
- SET(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
+ if(VTK_VERSION VERSION_GREATER "6.2.0")
+ set(foundationLibraries clitkCommon ${ITK_LIBRARIES} ${VTK_LIBRARIES})
+ else()
+ set(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
+ endif()
#=========================================================
# Use CxImage to create animated gifs
- IF(CLITK_EXPERIMENTAL)
- SET(vvCxImage clitkCxImage)
- SET(vv_SRCS ${vv_SRCS} vvAnimatedGIFWriter.cxx)
- INCLUDE_DIRECTORIES(${CLITK_SOURCE_DIR}/utilities/CxImage)
- ADD_SUBDIRECTORY(${CLITK_SOURCE_DIR}/utilities/CxImage ${PROJECT_BINARY_DIR}/utilities/CxImage)
- ENDIF(CLITK_EXPERIMENTAL)
+ if(CLITK_EXPERIMENTAL)
+ set(vvCxImage clitkCxImage)
+ set(vv_SRCS ${vv_SRCS} vvAnimatedGIFWriter.cxx)
+ include_directories(${CLITK_SOURCE_DIR}/utilities/CxImage)
+ add_subdirectory(${CLITK_SOURCE_DIR}/utilities/CxImage ${PROJECT_BINARY_DIR}/utilities/CxImage)
+ endif(CLITK_EXPERIMENTAL)
#=========================================================
+ #-----------------------------------------------------------------------------
+ # Avoid linker bug in Mac OS 10.5
+ # See http://wiki.finkproject.org/index.php/Fink:Packaging:Preparing_for_10.5#OpenGL_Bug
+ #
+ if(APPLE)
+ find_library(CoreFoundation_LIBRARY CoreFoundation REQUIRED)
+ find_library(ApplicationServices_LIBRARY ApplicationServices REQUIRED)
+ find_library(SystemConfiguration_LIBRARY SystemConfiguration REQUIRED)
+ find_library(Security_LIBRARY Security REQUIRED)
+ set(APPLE_FRAMEWORKS ${CoreFoundation_LIBRARY}
+ ${ApplicationServices_LIBRARY}
+ ${SystemConfiguration_LIBRARY}
+ ${Security_LIBRARY}
+ )
+ message(STATUS "===== ${APPLE_FRAMEWORKS}")
+ endif()
#=========================================================
#Create binary and libs for tests
- SET(vvExternalLibs ${QT_QTNETWORK_LIBRARY} clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage})
- # QtNetwork is required by vvRegisterForm
+ if(vv_QT_VERSION VERSION_GREATER "4")
+ set(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} Qt5::Widgets Qt5::Network Qt5::Designer ${APPLE_FRAMEWORKS})
+ else()
+ set(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} ${QT_LIBRARIES} ${APPLE_FRAMEWORKS})
+ endif()
+ # QtNetwork is required by vvRegisterForm ${QT_QTNETWORK_LIBRARY}
+
+ #-----------------------------------------------------------------------------
+ # For retina displays, see
+ # http://public.kitware.com/pipermail/vtkusers/2015-February/090117.html
+ if(APPLE)
+ set(vv_SRCS ${vv_SRCS} vvOSXHelper.mm)
+ endif()
- ADD_LIBRARY(vvLib ${vv_SRCS} ${vv_UI_CXX})
- TARGET_LINK_LIBRARIES(vvLib ${vvExternalLibs})
+ add_library(vvLib ${vv_SRCS} ${vv_UI_CXX})
+ target_link_libraries(vvLib ${vvExternalLibs})
- IF(WIN32)
- ADD_EXECUTABLE(vv WIN32 vv.cxx vvIcon.rc)
- ELSE(WIN32)
- ADD_EXECUTABLE(vv vv.cxx)
- ENDIF(WIN32)
+ if(WIN32)
+ add_executable(vv WIN32 vv.cxx vvIcon.rc)
+ else(WIN32)
+ add_executable(vv vv.cxx)
+ endif(WIN32)
- TARGET_LINK_LIBRARIES(vv vvLib)
+ target_link_libraries(vv vvLib)
#=========================================================
# Install options (also used by CPack)
- INSTALL (TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+ install(TARGETS vv DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
#=========================================================
#=========================================================
# CPack options
- SET(CPACK_PACKAGE_NAME "vv")
- SET(CPACK_SOURCE_PACKAGE_FILE_NAME "vv-src")
- SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !")
- SET(CPACK_PACKAGE_VENDOR "Creatis-CLB")
- SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
- SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
- SET(CPACK_PACKAGE_VERSION_MAJOR "1")
- SET(CPACK_PACKAGE_VERSION_MINOR "3")
- SET(CPACK_PACKAGE_VERSION_PATCH "0")
- IF(NIGHTLY)
- SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv-nightly")
- ELSE(NIGHTLY)
- SET(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
- ENDIF(NIGHTLY)
- SET(CPACK_STRIP_FILES TRUE)
+ set(CPACK_PACKAGE_NAME "vv")
+ set(CPACK_SOURCE_PACKAGE_FILE_NAME "vv-src")
+ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vv, the 4D slicer : let's jump into a new dimension !")
+ set(CPACK_PACKAGE_VENDOR "Creatis-CLB")
+ set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+ set(CPACK_PACKAGE_VERSION_MAJOR "1")
+ set(CPACK_PACKAGE_VERSION_MINOR "3")
+ set(CPACK_PACKAGE_VERSION_PATCH "0")
+ if(NIGHTLY)
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "vv-nightly")
+ else(NIGHTLY)
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "vv")
+ endif(NIGHTLY)
+ set(CPACK_STRIP_FILES TRUE)
- IF(WIN32)
+ if(WIN32)
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
- SET(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\icons\\\\ducky.ico")
- SET(CPACK_NSIS_INSTALLED_ICON_NAME "vv.exe")
- IF(NIGHTLY)
- SET(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer (nightly)")
- ELSE(NIGHTLY)
- SET(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer")
- ENDIF(NIGHTLY)
- SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio/vv")
- SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio")
- SET(CPACK_NSIS_CONTACT "vv@creatis.insa-lyon.fr")
- SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\vv.lnk\\\" \\\"$INSTDIR\\\\bin\\\\vv.exe\\\" ")
- SET(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\vv.lnk\\\" ")
- #SET(CPACK_NSIS_MODIFY_PATH ON) SR: buggy, wait for cmake updates for a fix
- #SET(CPACK_BINARY_ZIP ON)
- ELSE(WIN32)
- SET(CPACK_GENERATOR "STGZ")
- SET(CPACK_SOURCE_GENERATOR "TGZ")
- ENDIF(WIN32)
- INCLUDE(CPack)
+ set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\icons\\\\ducky.ico")
+ set(CPACK_NSIS_INSTALLED_ICON_NAME "vv.exe")
+ if(NIGHTLY)
+ set(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer (nightly)")
+ else(NIGHTLY)
+ set(CPACK_NSIS_DISPLAY_NAME "vv - The 4D slicer")
+ endif(NIGHTLY)
+ set(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/rio/vv")
+ set(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/rio")
+ set(CPACK_NSIS_CONTACT "vv@creatis.insa-lyon.fr")
+ set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\vv.lnk\\\" \\\"$INSTDIR\\\\bin\\\\vv.exe\\\" ")
+ set(CPACK_NSIS_DELETE_ICONS_EXTRA "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\vv.lnk\\\" ")
+ #set(CPACK_NSIS_MODIFY_PATH ON) SR: buggy, wait for cmake updates for a fix
+ #set(CPACK_BINARY_ZIP ON)
+ else(WIN32)
+ set(CPACK_GENERATOR "STGZ")
+ set(CPACK_SOURCE_GENERATOR "TGZ")
+ endif(WIN32)
+ include(CPack)
#=========================================================
#=========================================================
configure_file(vvConfiguration.h.in vvConfiguration.h)
--- /dev/null
- <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>
#include "QTreePushButton.h"
#include <QUrl>
#include <QSettings>
+ #include <QShortcut>
// VV include
#include "vvMainWindow.h"
#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>
#include <itkNumericSeriesFileNames.h>
// VTK include
+ #include <vtkImageMapper3D.h>
+ #include <vtkInformation.h>
+ #include <vtkVersion.h>
#include <vtkImageData.h>
#include <vtkImageActor.h>
#include <vtkCornerAnnotation.h>
#define COLUMN_IMAGE_NAME 7
#ifdef CLITK_PRIVATE_FEATURES
- #define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz *.usf *.svl)"
+ #define EXTENSIONS "Images ( *.bmp *.dcm *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz *.usf *.svl)"
#else
- #define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz)"
+ #define EXTENSIONS "Images ( *.bmp *.dcm *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz)"
#endif
//------------------------------------------------------------------------------
vvMainWindow::vvMainWindow():vvMainWindowBase()
- {
+ {
setupUi(this); // this sets up the GUI
+
+ setDicomClient();
++
+ //Qt::WindowFlags flags = windowFlags();
+ //setWindowFlags(flags | Qt::WindowStaysOnTopHint);
+
mInputPathName = "";
mMenuTools = menuTools;
// mMenuSegmentation = menuSegmentation;
contextActions.resize(0);
QAction* actionOpen_new_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/fileopen.png")),
tr("O&pen new Image"));
- actionOpen_new_image->setShortcut(QKeySequence(tr("Ctrl+O")));
connect(actionOpen_new_image,SIGNAL(triggered()),this,SLOT(OpenImages()));
contextActions.push_back(actionOpen_new_image);
contextMenu.addSeparator();
tr("Reset transformation to identity"));
connect(actionResetMatrix, SIGNAL(triggered()), this,SLOT(ResetTransformationToIdentity()));
- // TRIAL DS
- /*
- QMenu * m = new QMenu(menubar);
- m->setTitle("TOTO");
- // m->setObjectName(QString::fromUtf8("TOTOTO"));
- contextMenu.addMenu(m);
- QAction * a = m->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")),
- tr("BIDON"));
- QAction * b = m->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")),
- tr("BIDON2"));
- m->addAction(a);
- m->addAction(b);
- connect(a,SIGNAL(triggered()),this,SLOT(AddFusionImage()));
- */
-
//init the DataTree
mSlicerManagers.resize(0);
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()));
connect(actionAdd_overlay_image_to_current_image,SIGNAL(triggered()), this,SLOT(SelectOverlayImage()));
connect(actionAdd_USSequence_toCT,SIGNAL(triggered()), this,SLOT(SelectFusionSequence()));
connect(actionNavigation_Help,SIGNAL(triggered()),this,SLOT(ShowHelpDialog()));
+
+ QShortcut *shortcutHelp = new QShortcut(QKeySequence(QKeySequence::HelpContents),this);
+ shortcutHelp->setContext(Qt::ApplicationShortcut);
+ QObject::connect(shortcutHelp, SIGNAL(activated()), this, SLOT(ShowHelpDialog()));
+
connect(actionDocumentation,SIGNAL(triggered()),this,SLOT(ShowDocumentation()));
connect(actionRegister_vv,SIGNAL(triggered()),this,SLOT(PopupRegisterForm()));
SOViewWidget->hide();
SEViewWidget->hide();
+ #ifdef Q_OS_OSX
+ disableGLHiDPI(NOViewWidget->winId());
+ disableGLHiDPI(NEViewWidget->winId());
+ disableGLHiDPI(SOViewWidget->winId());
+ disableGLHiDPI(SEViewWidget->winId());
+ #endif
+
//Recently opened files
std::list<std::string> recent_files = GetRecentlyOpenedImages();
recentlyOpenedFilesMenu=NULL;
vvToolManager::GetInstance()->InsertToolsInMenu(this);
vvToolManager::GetInstance()->EnableToolsInMenu(this, false);
+ //#ifndef CLITK_EXPERIMENTAL
+ //#define CLITK_EXPERIMENTAL 0
+ //#endif
+ #ifdef CLITK_EXPERIMENTAL
if (!CLITK_EXPERIMENTAL)
menuExperimental->menuAction()->setVisible(false);
-
+ #endif
QTimer * timerMemory = new QTimer(this);
//timerMemory->setInterval(5);
connect(timerMemory, SIGNAL(timeout()), this, SLOT(UpdateMemoryUsage()));
timerMemory->start(2000);
-
}
+
//------------------------------------------------------------------------------
void vvMainWindow::show()
- {
+ {
vvMainWindowBase::show();
PopupRegisterForm(true);
}
//------------------------------------------------------------------------------
void vvMainWindow::UpdateMemoryUsage()
- {
+ {
// clitk::PrintMemory(true);
if (clitk::GetMemoryUsageInMb() == 0) infoPanel->setMemoryInMb("NA");
else infoPanel->setMemoryInMb(QString::number(clitk::GetMemoryUsageInMb())+" MiB");
//------------------------------------------------------------------------------
void vvMainWindow::createRecentlyOpenedFilesMenu()
- {
+ {
recentlyOpenedFilesMenu = new QMenu("Recently opened files...");
recentlyOpenedFilesMenu->setIcon(QIcon(QString::fromUtf8(":/common/icons/open.png")));
menuFile->insertMenu(actionOpen_Image_With_Time,recentlyOpenedFilesMenu);
//------------------------------------------------------------------------------
void vvMainWindow::updateRecentlyOpenedFilesMenu(const std::list<std::string> &recent_files)
- {
+ {
if(recentlyOpenedFilesMenu==NULL) {
createRecentlyOpenedFilesMenu();
} else {
//------------------------------------------------------------------------------
void vvMainWindow::ComputeMidPosition()
- {
+ {
bool ok;
int index=GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
- int ref = QInputDialog::getInteger(this,"Chose reference phase","Reference phase",0,0,\
- mSlicerManagers[index]->GetImage()->GetVTKImages().size()-1,1,&ok);
+ int ref = QInputDialog::getInt(this,"Chose reference phase","Reference phase",0,0,\
+ mSlicerManagers[index]->GetImage()->GetVTKImages().size()-1,1,&ok);
if (ok) {
vvMidPosition midp;
midp.slicer_manager = mSlicerManagers[index];
//------------------------------------------------------------------------------
void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool propagation)
- {
+ {
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setData(0,Qt::UserRole,"filename.vtk");
item->setData(1,Qt::UserRole,tr("contour"));
brush.setColor(QColor(contour->r*255,contour->g*255,contour->b*255));
brush.setStyle(Qt::SolidPattern);
item->setData(COLUMN_IMAGE_NAME,Qt::BackgroundRole,brush);
- // item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,contour->structure_name.c_str());
+ item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,contour->structure_name.c_str());
for (int j = 1; j <= 4; j++)
item->setData(j,Qt::CheckStateRole,DataTree->topLevelItem(image_index)->data(j,Qt::CheckStateRole));
//------------------------------------------------------------------------------
void vvMainWindow::OpenVTKContour()
- {
+ {
if (mSlicerManagers.size() > 0) {
QString Extensions = "Images ( *.vtk *.obj)";
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvMainWindow::AddDCStructContour(int index, QString file)
- {
+ {
vvMeshReader reader;
reader.SetFilename(file.toStdString());
vvStructSelector selector;
//------------------------------------------------------------------------------
void vvMainWindow::OpenDCStructContour()
- {
+ {
if (mSlicerManagers.size() > 0) {
QString Extensions = "Dicom Files ( *.dcm RS*)";
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvMainWindow::ComputeDeformableRegistration()
- {
+ {
if (mSlicerManagers.size() > 0) {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
vvDeformationDialog dialog(index,mSlicerManagers);
//------------------------------------------------------------------------------
void vvMainWindow::WarpImage()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (!mSlicerManagers[index]->GetVF().IsNull()) {
bool ok;
- int ref = QInputDialog::getInteger(this,"Chose reference phase","Reference phase",0,0,\
+ int ref = QInputDialog::getInt(this,"Chose reference phase","Reference phase",0,0,\
mSlicerManagers[index]->GetImage()->GetVTKImages().size()-1,1,&ok);
if (ok) {
WarpImage(mSlicerManagers[index],ref);
//------------------------------------------------------------------------------
void vvMainWindow::WarpImage(vvSlicerManager* selected_slicer,int reference_phase)
- {
+ {
if (!selected_slicer->GetVF().IsNull()) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
QFileInfo info(selected_slicer->GetFileName().c_str());
//------------------------------------------------------------------------------
vvMainWindow::~vvMainWindow()
- {
+ {
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i] != NULL)
delete mSlicerManagers[i];
}
+ delete documentation;
+ delete help_dialog;
+ delete dicomSeriesSelector;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
QTabWidget * vvMainWindow::GetTab()
- {
+ {
return tabWidget;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::MergeImages()
- {
+ {
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
QStringList files = QFileDialog::getOpenFileNames(this,tr("Merge Images"),mInputPathName,Extensions);
//------------------------------------------------------------------------------
void vvMainWindow::SliceImages()
- {
+ {
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvMainWindow::MergeImagesWithTime()
- {
+ {
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
QStringList files = QFileDialog::getOpenFileNames(this,tr("Merge Images With Time"),mInputPathName,Extensions);
//------------------------------------------------------------------------------
void vvMainWindow::OpenDicom()
- {
+ {
std::vector<std::string> files;
//std::cout << "dicomSeriesSelector " << std::endl;
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) {
+ for (int i = 0; i < PacsConnection->getSeriesCount(); i++)
+ {
+ files = PacsConnection->getFileNames(i);
+ LoadImages(files, vvImageReader::DICOM);
+ }
+ PacsConnection->clearMove();
+ }
+ }
+
+#endif
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::OpenImages()
- {
+ {
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
}
//------------------------------------------------------------------------------
void vvMainWindow::OpenRecentImage()
- {
+ {
QAction * caller = qobject_cast<QAction*>(sender());
std::vector<std::string> images;
images.push_back(caller->text().toStdString());
//------------------------------------------------------------------------------
void vvMainWindow::OpenImageWithTime()
- {
+ {
QString Extensions = EXTENSIONS;
Extensions += ";;All Files (*)";
//------------------------------------------------------------------------------
void vvMainWindow::LoadImages(std::vector<std::string> files, vvImageReader::LoadedImageType filetype)
- {
+ {
//Separate the way to open images and dicoms
int fileSize;
if (filetype == vvImageReader::IMAGE || filetype == vvImageReader::IMAGEWITHTIME)
// Change filename if an image with the same already exist
int number = GetImageDuplicateFilenameNumber(files[i] + std::string("_slice"));
- if (filetype == vvImageReader::IMAGE || filetype == vvImageReader::IMAGEWITHTIME || filetype == vvImageReader::SLICED)
+ if (filetype == vvImageReader::IMAGE || filetype == vvImageReader::IMAGEWITHTIME || filetype == vvImageReader::SLICED) {
SetImageSucceed = imageManager->SetImage(files[i],filetype, number, j);
- else {
+ } else {
SetImageSucceed = imageManager->SetImages(files,filetype, number);
}
-
if (!SetImageSucceed) {
QApplication::restoreOverrideCursor();
QString error = "Cannot open file \n";
QMessageBox::information(this,tr("Reading problem"),error);
delete imageManager;
} else {
+
mSlicerManagers.push_back(imageManager);
//create an item in the tree with good settings
connect(mSlicerManagers.back(), SIGNAL(ChangeImageWithIndexOffset(vvSlicerManager*,int,int)),
this,SLOT(ChangeImageWithIndexOffset(vvSlicerManager*,int,int)));
connect(mSlicerManagers.back(),SIGNAL(LandmarkAdded()),landmarksPanel,SLOT(AddPoint()));
-
InitSlicers();
numberofsuccesulreads++;
}
}
}
+
if (numberofsuccesulreads) {
NOViewWidget->show();
NEViewWidget->show();
//------------------------------------------------------------------------------
void vvMainWindow::UpdateTree()
- {
+ {
DataTree->resizeColumnToContents(COLUMN_TREE);
DataTree->resizeColumnToContents(COLUMN_UL_VIEW);
DataTree->resizeColumnToContents(COLUMN_UR_VIEW);
//------------------------------------------------------------------------------
void vvMainWindow::CurrentImageChanged(std::string id)
- {
+ {
if (id == mCurrentSelectedImageId) return; // Do nothing
int selected = 0;
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
mSlicerManagers[selected]->GetTSlice());
landmarksPanel->SetCurrentPath(mInputPathName.toStdString());
landmarksPanel->SetCurrentImage(mSlicerManagers[selected]->GetFileName().c_str());
-
+
emit SelectedImageHasChanged(mSlicerManagers[selected]);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::CurrentPickedImageChanged(std::string id)
- {
+ {
if (id == mCurrentPickedImageId) return; // Do nothing
int selected = 0;
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
//------------------------------------------------------------------------------
void vvMainWindow::ImageInfoChanged()
- {
+ {
contextActions[6]->setEnabled(1);
contextActions[5]->setEnabled(1);
actionSave_As->setEnabled(1);
// infoPanel->setOrigin(GetVectorDoubleAsString(origin));
// infoPanel->setSpacing(GetVectorDoubleAsString(inputSpacing));
// infoPanel->setNPixel(QString::number(NPixel)+" ("+inputSizeInBytes+")");
- //
+ //
// landmarksPanel->SetCurrentLandmarks(mSlicerManagers[index]->GetLandmarks(),
// mSlicerManagers[index]->GetTSlice());
// landmarksPanel->SetCurrentPath(mInputPathName.toStdString());
// landmarksPanel->SetCurrentImage(mSlicerManagers[index]->GetFileName().c_str());
- //
+ //
// overlayPanel->getCurrentImageName(mSlicerManagers[index]->GetFileName().c_str());
// for (int i = 0; i < 4; i++) {
// if (DataTree->selectedItems()[0]->data(i+1,Qt::CheckStateRole).toInt() > 0 || i == 3) {
//------------------------------------------------------------------------------
void vvMainWindow::ShowDocumentation()
- {
+ {
documentation->show();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::PopupRegisterForm(bool checkCanPush)
- {
+ {
vvRegisterForm* registerForm = new vvRegisterForm(QUrl("http://www.creatis.insa-lyon.fr/~dsarrut/vvregister/write.php"), getVVSettingsPath(), getSettingsOptionFormat());
if(!checkCanPush) {
registerForm->show();
//------------------------------------------------------------------------------
void vvMainWindow::ShowHelpDialog()
- {
+ {
help_dialog->show();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::ChangeViewMode()
- {
+ {
typedef struct _SIZE{
QSplitter* splitter;
QList<int> size1, size2;
//------------------------------------------------------------------------------
QString vvMainWindow::GetSizeInBytes(unsigned long size)
- {
+ {
QString result = "";// QString::number(size);
//result += " bytes (";
if (size > 1000000000) {
//------------------------------------------------------------------------------
QString vvMainWindow::GetVectorDoubleAsString(std::vector<double> vectorDouble)
- {
+ {
QString result;
for (unsigned int i= 0; i < vectorDouble.size(); i++) {
if (i != 0)
//------------------------------------------------------------------------------
QString vvMainWindow::GetVectorIntAsString(std::vector<int> vectorInt)
- {
+ {
QString result;
for (unsigned int i= 0; i < vectorInt.size(); i++) {
if (i != 0)
//------------------------------------------------------------------------------
//this actually returns the SlicerManager index!
int vvMainWindow::GetSlicerIndexFromItem(QTreeWidgetItem* item)
- {
+ {
QString id = item->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString();
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id)
//------------------------------------------------------------------------------
QTreeWidgetItem* vvMainWindow::GetItemFromSlicerManager(vvSlicerManager* sm)
- {
+ {
QString id = sm->GetId().c_str();
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id)
//------------------------------------------------------------------------------
void vvMainWindow::DisplayChanged(QTreeWidgetItem *clickedItem, int column)
- {
+ {
if ( column >= COLUMN_CLOSE_IMAGE || column <= 0)
return;
clickedParentItem->setData(column, Qt::CheckStateRole, vis?2:0);
// Children
- std::map<std::string, int> actorTypeCounts;
+ std::map<std::string, int> actorTypeCounts;
for (int iChild = 0; iChild < clickedParentItem->childCount(); iChild++) {
QTreeWidgetItem* currentChildItem = clickedParentItem->child(iChild);
std::string actorType = currentChildItem->data(1,Qt::UserRole).toString().toStdString();
//------------------------------------------------------------------------------
void vvMainWindow::InitSlicers()
- {
+ {
if (mSlicerManagers.size()) {
mSlicerManagers.back()->GenerateDefaultLookupTable();
-
mSlicerManagers.back()->SetSlicerWindow(0,NOViewWidget->GetRenderWindow());
mSlicerManagers.back()->SetSlicerWindow(1,NEViewWidget->GetRenderWindow());
mSlicerManagers.back()->SetSlicerWindow(2,SOViewWidget->GetRenderWindow());
mSlicerManagers.back()->SetSlicerWindow(3,SEViewWidget->GetRenderWindow());
+ #if VTK_MAJOR_VERSION <= 5
+ mSlicerManagers.back()->Render(); // SR: displayed #slice is wrong without this / TB: With VTK6 and multiple images, all slicers are updated, not only the first
+ #endif
}
}
//------------------------------------------------------------------------------
void vvMainWindow::InitDisplay()
- {
+ {
if (mSlicerManagers.size()) {
//BE CAREFUL : this is absolutely necessary to set the interactor style
//in order to have the same style instanciation for all SlicerManagers in
bool AlreadySelected = false;
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
mSlicerManagers[i]->SetInteractorStyleNavigator(j,style);
-
//select the image only if previous are not selected
if (DataTree->topLevelItem(i)->data(j+1,Qt::CheckStateRole).toInt() > 1) {
mSlicerManagers[i]->UpdateSlicer(j,1);
AlreadySelected = true;
} else if (i == DataTree->topLevelItemCount()-1 && !AlreadySelected) {
- if (DataTree->selectedItems().size() == 0)
+ if (DataTree->selectedItems().size() == 0) {
DataTree->topLevelItem(i)->setSelected(1);
+ }
DataTree->topLevelItem(i)->setData(j+1,Qt::CheckStateRole,2);
mSlicerManagers[i]->UpdateSlicer(j,1);
DisplaySliders(i,j);
//------------------------------------------------------------------------------
void vvMainWindow::DisplaySliders(int slicer, int window)
- {
+ {
if(!mSlicerManagers[slicer]->GetSlicer(window)->GetRenderer()->GetDraw())
return;
//------------------------------------------------------------------------------
void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column)
- {
+ {
int index = GetSlicerIndexFromItem(item);
if (DataTree->topLevelItem(index) != item) {
if (DataTree->topLevelItem(index)->child(child) == item) break;
}
if (overlay_type=="fusionSequence") {
- //removing the overlay sequence in a fusion sequence visualization mode
+ //removing the overlay sequence in a fusion sequence visualization mode
//reset the transforms
overlayPanel->getFusionSequenceProperty(-1, false, 0, false);
//------------------------------------------------------------------------------
void vvMainWindow::ReloadImage(QTreeWidgetItem* item, int column)
- {
+ {
// int index = GetSlicerIndexFromItem(item);
// QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
// if (item->data(1,Qt::UserRole).toString() == "vector")
else if (role == "fusionSequence") {
//both versions of the secondary sequence must be updated.
mSlicerManagers[index]->ReloadFusionSequence();
- mSlicerManagers[mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager()]->Reload();
+ mSlicerManagers[mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager()]->Reload();
}
else {
mSlicerManagers[index]->Reload();
//if we update the secondary sequence, then the overlay of the main sequence should also be updated
- if (mSlicerManagers[index]->IsSecondarySequenceOfFusionSequence()) mSlicerManagers[mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager()]->ReloadFusionSequence();
+ if (mSlicerManagers[index]->IsSecondarySequenceOfFusionSequence()) mSlicerManagers[mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager()]->ReloadFusionSequence();
}
// Update view and info
ImageInfoChanged();
//------------------------------------------------------------------------------
void vvMainWindow::MousePositionChanged(int visibility,double x, double y, double z, double X, double Y, double Z , double value)
- {
+ {
infoPanel->setCurrentInfo(visibility,x,y,z,X,Y,Z,value);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::VectorChanged(int visibility,double x, double y, double z, double value)
- {
+ {
overlayPanel->getCurrentVectorInfo(visibility,x,y,z,value);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::OverlayChanged(int visibility, double valueOver, double valueRef)
- {
+ {
overlayPanel->getCurrentOverlayInfo(visibility,valueOver, valueRef);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::FusionChanged(int visibility, double value)
- {
+ {
overlayPanel->getCurrentFusionInfo(visibility,value);
}
//------------------------------------------------------------------------------
//or when UpdateWindowLevel() is called ; when slicerManager emits WindowLevelChanged
//when ImageInfoChanged() is called
void vvMainWindow::WindowLevelChanged()
- {
+ {
// Base image
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if(index==-1) return;
mSlicerManagers[index]->GetFusionLevel());
if (mSlicerManagers[index]->IsMainSequenceOfFusionSequence()) {
overlayPanel->getFusionSequenceProperty(mSlicerManagers[index]->GetFusionSequenceFrameIndex(),
- mSlicerManagers[index]->GetFusionSequenceSpatialSyncFlag(),
+ mSlicerManagers[index]->GetFusionSequenceSpatialSyncFlag(),
mSlicerManagers[index]->GetFusionSequenceNbFrames(),
mSlicerManagers[index]->GetFusionSequenceTemporalSyncFlag());
}
mSlicerManagers[ind]->GetFusionWindow(),
mSlicerManagers[ind]->GetFusionLevel());
overlayPanel->getFusionSequenceProperty(mSlicerManagers[ind]->GetFusionSequenceFrameIndex(),
- mSlicerManagers[ind]->GetFusionSequenceSpatialSyncFlag(),
+ mSlicerManagers[ind]->GetFusionSequenceSpatialSyncFlag(),
mSlicerManagers[ind]->GetFusionSequenceNbFrames(),
mSlicerManagers[ind]->GetFusionSequenceTemporalSyncFlag());
}
//------------------------------------------------------------------------------
void vvMainWindow::WindowLevelEdited()
- {
+ {
presetComboBox->setCurrentIndex(WL_USER);
UpdateWindowLevel();
}
//------------------------------------------------------------------------------
void vvMainWindow::SetWindowLevel(double w, double l)
- {
+ {
windowSpinBox->setValue(w);
levelSpinBox->setValue(l);
presetComboBox->setCurrentIndex(WL_USER);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateWindowLevel()
- {
+ {
if (DataTree->selectedItems().size()) {
if (presetComboBox->currentIndex() == WL_VENTILATION) //For ventilation
colorMapComboBox->setCurrentIndex(5);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateSlicingPreset()
- {
+ {
if (DataTree->selectedItems().size()) {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
mSlicerManagers[index]->SetSlicingPreset(vvSlicerManager::SlicingPresetType(slicingPresetComboBox->currentIndex()));
//------------------------------------------------------------------------------
void vvMainWindow::UpdateColorMap()
- {
+ {
if (DataTree->selectedItems().size()) {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
mSlicerManagers[index]->SetColorMap(colorMapComboBox->currentIndex());
}
//------------------------------------------------------------------------------
void vvMainWindow::SwitchWindowLevel()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
int window = mSlicerManagers[index]->GetColorWindow();
presetComboBox->setCurrentIndex(WL_USER);
//------------------------------------------------------------------------------
void vvMainWindow::ApplyWindowLevelToAllImages()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if(index==-1) return;
double window = mSlicerManagers[index]->GetColorWindow();
double level = mSlicerManagers[index]->GetColorLevel();
+ double fusWindow = mSlicerManagers[index]->GetFusionWindow();
+ double fusLevel = mSlicerManagers[index]->GetFusionLevel();
+
+ double overWindow = mSlicerManagers[index]->GetOverlayColorWindow();
+ double overLevel = mSlicerManagers[index]->GetOverlayColorLevel();
+
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i] == NULL)
continue;
mSlicerManagers[i]->SetColorWindow(window);
mSlicerManagers[i]->SetColorLevel(level);
mSlicerManagers[i]->SetPreset(WL_USER);
+ mSlicerManagers[i]->SetFusionWindow(fusWindow);
+ mSlicerManagers[i]->SetFusionLevel(fusLevel);
+ mSlicerManagers[i]->SetOverlayColorWindow(overWindow);
+ mSlicerManagers[i]->SetOverlayColorLevel(overLevel);
mSlicerManagers[i]->Render();
}
}
//------------------------------------------------------------------------------
void vvMainWindow::ApplyWindowToSetOfImages(double window, unsigned int indexMin, unsigned int indexMax)
- {
+ {
for (unsigned int i = indexMin; i <= indexMax && i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i] == NULL)
continue;
+ SetWindowLevel(window, mSlicerManagers[i]->GetColorLevel());
mSlicerManagers[i]->SetColorWindow(window);
mSlicerManagers[i]->SetPreset(WL_USER);
mSlicerManagers[i]->Render();
//------------------------------------------------------------------------------
void vvMainWindow::ApplyLevelToSetOfImages(double level, unsigned int indexMin, unsigned int indexMax)
- {
+ {
for (unsigned int i = indexMin; i <= indexMax && i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i] == NULL)
continue;
+ SetWindowLevel(mSlicerManagers[i]->GetColorWindow(), level);
mSlicerManagers[i]->SetColorLevel(level);
mSlicerManagers[i]->SetPreset(WL_USER);
mSlicerManagers[i]->Render();
//------------------------------------------------------------------------------
void vvMainWindow::UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps)
- {
+ {
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i]->GetId() == id) {
mSlicerManagers[i]->GetSlicer(slicer)->SetCurrentPosition(x,y,z,temps);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateLinkedNavigation(std::string id, vvSlicerManager * sm, vvSlicer* refSlicer)
- {
+ {
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (id == mSlicerManagers[i]->GetId()) {
mSlicerManagers[i]->UpdateLinkedNavigation(refSlicer);
//------------------------------------------------------------------------------
void vvMainWindow::ShowContextMenu(QPoint point)
- {
+ {
if (!DataTree->selectedItems().size()) {
contextActions[1]->setEnabled(0);
contextActions[2]->setEnabled(0);
//------------------------------------------------------------------------------
void vvMainWindow::CloseImage()
- {
+ {
CloseImage(DataTree->selectedItems()[0],0);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::ReloadImage()
- {
+ {
ReloadImage(DataTree->selectedItems()[0],0);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SelectOverlayImage()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+ if (!(CheckAddedImage(index, "overlay")))
+ return;
+
+ QString Extensions = EXTENSIONS;
+ Extensions += ";;All Files (*)";
+ QStringList files = QFileDialog::getOpenFileNames(this,tr("Load Overlay image"),mInputPathName,Extensions);
+ if (files.isEmpty())
+ return;
+
+ std::vector<std::string> vecFileNames;
+ for (int i = 0; i < files.size(); i++) {
+ vecFileNames.push_back(files[i].toStdString());
+ }
+
+ AddOverlayImage(index,vecFileNames,vvImageReader::IMAGE);
+ }
+ //------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------
+ bool vvMainWindow::CheckAddedImage(int index, QString imageType)
+ {
//check if one overlay image is added
for (int child = 0; child < DataTree->topLevelItem(index)->childCount(); child++)
- if (DataTree->topLevelItem(index)->child(child)->data(1,Qt::UserRole).toString() == "overlay") {
+ if (DataTree->topLevelItem(index)->child(child)->data(1,Qt::UserRole).toString().compare(imageType) == 0) {
QString error = "Cannot add more than one compared image\n";
error += "Please remove first ";
error += DataTree->topLevelItem(index)->child(child)->data(COLUMN_IMAGE_NAME,Qt::DisplayRole).toString();
QMessageBox::information(this,tr("Problem adding compared image !"),error);
- return;
- }
-
- QString Extensions = EXTENSIONS;
- Extensions += ";;All Files (*)";
- QStringList files = QFileDialog::getOpenFileNames(this,tr("Load Overlay image"),mInputPathName,Extensions);
- if (files.isEmpty())
- return;
-
- std::vector<std::string> vecFileNames;
- for (int i = 0; i < files.size(); i++) {
- vecFileNames.push_back(files[i].toStdString());
+ return false;
}
- AddOverlayImage(index,vecFileNames,vvImageReader::IMAGE);
+ return true;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::AddOverlayImage(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
- {
+ {
QString file(fileNames[0].c_str());
if (QFile::exists(file))
{
item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("overlay").c_str());
qApp->processEvents();
+ #if VTK_MAJOR_VERSION > 5
+ for ( unsigned int i = 0; i < mSlicerManagers[index]->GetNumberOfSlicers(); i++)
+ mSlicerManagers[index]->GetSlicer(i)->ForceUpdateDisplayExtent();
+ #endif
for (int j = 1; j <= 4; j++) {
item->setData(j,Qt::CheckStateRole,DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole));
//------------------------------------------------------------------------------
void vvMainWindow::AddROI(int index, QString file)
- {
+ {
/*
// Get slice manager
//------------------------------------------------------------------------------
void vvMainWindow::SelectFusionImage()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
- //check if one fusion image is added
- for (int child = 0; child < DataTree->topLevelItem(index)->childCount(); child++)
- if ( (DataTree->topLevelItem(index)->child(child)->data(1,Qt::UserRole).toString() == "fusion") ||
- (DataTree->topLevelItem(index)->child(child)->data(1,Qt::UserRole).toString() == "fusionSequence") ) {
- QString error = "Cannot add more than one fusion image\n";
- error += "Please remove first ";
- error += DataTree->topLevelItem(index)->child(child)->data(COLUMN_IMAGE_NAME,Qt::DisplayRole).toString();
- QMessageBox::information(this,tr("Problem adding fusion image !"),error);
- return;
- }
+ if (!(CheckAddedImage(index, "fusion")) || !(CheckAddedImage(index, "fusionSequence")))
+ return;
- QString Extensions = EXTENSIONS;
- Extensions += ";;All Files (*)";
- QStringList files = QFileDialog::getOpenFileNames(this,tr("Load Fusion image"),mInputPathName,Extensions);
- if (files.isEmpty())
- return;
+ QString Extensions = EXTENSIONS;
+ Extensions += ";;All Files (*)";
+ QStringList files = QFileDialog::getOpenFileNames(this,tr("Load Fusion image"),mInputPathName,Extensions);
+ if (files.isEmpty())
+ return;
- std::vector<std::string> vecFileNames;
- for (int i = 0; i < files.size(); i++) {
- vecFileNames.push_back(files[i].toStdString());
- }
- AddFusionImage(index,vecFileNames,vvImageReader::IMAGE);
+ std::vector<std::string> vecFileNames;
+ for (int i = 0; i < files.size(); i++) {
+ vecFileNames.push_back(files[i].toStdString());
+ }
+ AddFusionImage(index,vecFileNames,vvImageReader::IMAGE);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::ResetTransformationToIdentity()
- {
+ {
std::string actorType = DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString().toStdString();
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
mSlicerManagers[index]->ResetTransformationToIdentity(actorType);
//------------------------------------------------------------------------------
void vvMainWindow::AddFusionImage(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
- {
+ {
QString file(fileNames[0].c_str());
if (QFile::exists(file))
{
item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("fusion").c_str());
qApp->processEvents();
-
+ #if VTK_MAJOR_VERSION > 5
+ for ( unsigned int i = 0; i < mSlicerManagers[index]->GetNumberOfSlicers(); i++)
+ mSlicerManagers[index]->GetSlicer(i)->ForceUpdateDisplayExtent();
+ #endif
for (int j = 1; j <= 4; j++) {
item->setData(j,Qt::CheckStateRole,DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole));
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::AddLandmarks(int index, std::vector<std::string> files)
- {
+ {
if (!landmarksPanel->LoadFromFile(files))
QMessageBox::information(this,tr("Problem reading Landmarks !"),"File doesn't exist!");
-
+
landmarksPanel->SetCurrentPath(mInputPathName.toStdString());
landmarksPanel->SetCurrentImage(mSlicerManagers[index]->GetFileName().c_str());
}
//------------------------------------------------------------------------------
void vvMainWindow::OpenField()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
- //check if a vector field has already been added
- for (int child = 0; child < DataTree->topLevelItem(index)->childCount(); child++)
- if (DataTree->topLevelItem(index)->child(child)->data(1,Qt::UserRole).toString() == "vector") {
- QString error = "Cannot add more than one vector field\n";
- error += "Please remove first ";
- error += DataTree->topLevelItem(index)->child(child)->data(COLUMN_IMAGE_NAME,Qt::DisplayRole).toString();
- QMessageBox::information(this,tr("Problem adding vector field!"),error);
- return;
- }
+
+ if (!(CheckAddedImage(index, "vector")))
+ return;
- QString Extensions = "Images ( *.mhd)";
- Extensions += ";;Images ( *.mha)";
- Extensions += ";;VF Images ( *.vf)";
- Extensions += ";;nii Images ( *.nii)";
- Extensions += ";;nrrd Images ( *.nrrd)";
- Extensions += ";;nhdr Images ( *.nhdr)";
- Extensions += ";;All Files (*)";
- QString file = QFileDialog::getOpenFileName(this,tr("Load deformation field"),mInputPathName,Extensions);
- if (!file.isEmpty())
- AddField(file,index);
+ QString Extensions = "Images ( *.mhd *.mha *.vf *.nii *.nrrd *.nhdr)";
+ // Extensions += ";;Images ( *.mha)";
+ // Extensions += ";;VF Images ( *.vf)";
+ // Extensions += ";;nii Images ( *.nii)";
+ // Extensions += ";;nrrd Images ( *.nrrd)";
+ // Extensions += ";;nhdr Images ( *.nhdr)";
+ Extensions += ";;All Files (*)";
+ QString file = QFileDialog::getOpenFileName(this,tr("Load deformation field"),mInputPathName,Extensions);
+ if (!file.isEmpty())
+ AddField(file,index);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
- {
+ {
//create an item in the tree with good settings
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setData(0,Qt::UserRole,filename.toStdString().c_str());
//------------------------------------------------------------------------------
void vvMainWindow::AddField(vvImage::Pointer vf,QString file,int index)
- {
+ {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
vvSlicerManager* imageManager = mSlicerManagers[index];
if (imageManager->SetVF(vf,file.toStdString())) {
AddFieldEntry(file,index,false);
+ #if VTK_MAJOR_VERSION > 5
+ for ( unsigned int i = 0; i < mSlicerManagers[index]->GetNumberOfSlicers(); i++)
+ mSlicerManagers[index]->GetSlicer(i)->ForceUpdateDisplayExtent();
+ #endif
} else {
QString error = "Cannot import the vector field for this image.\n";
error += imageManager->GetLastError().c_str();
//------------------------------------------------------------------------------
void vvMainWindow::AddField(QString file,int index)
- {
+ {
if (QFile::exists(file)) {
mInputPathName = itksys::SystemTools::GetFilenamePath(file.toStdString()).c_str();
//------------------------------------------------------------------------------
void vvMainWindow::SetVFProperty(int subsampling, int scale, int log, int width, double r, double g, double b)
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (mSlicerManagers[index]->GetSlicer(0)->GetVF()) {
for (int i = 0; i < 4; i++) {
//------------------------------------------------------------------------------
void vvMainWindow::SetOverlayProperty(int color, int linked, double window, double level)
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (mSlicerManagers[index]->GetSlicer(0)->GetOverlay()) {
mSlicerManagers[index]->SetOverlayColor(color);
//------------------------------------------------------------------------------
void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap,double window, double level, bool showLegend)
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
mSlicerManagers[index]->SetFusionColorMap(colormap);
//------------------------------------------------------------------------------
void vvMainWindow::SelectFusionSequence()
- {
+ {
//get the index of the slicer manager of the main sequence (CT)
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
- //check if one overlay image is already associated
- for (int child = 0; child < DataTree->topLevelItem(index)->childCount(); child++)
- if ( (DataTree->topLevelItem(index)->child(child)->data(1,Qt::UserRole).toString() == "fusion") ||
- (DataTree->topLevelItem(index)->child(child)->data(1,Qt::UserRole).toString() == "fusionSequence") ) {
- QString error = "Cannot add more than one compared image\n";
- error += "Please remove first ";
- error += DataTree->topLevelItem(index)->child(child)->data(COLUMN_IMAGE_NAME,Qt::DisplayRole).toString();
- QMessageBox::information(this,tr("Problem adding compared image !"),error);
- return;
- }
- QString Extensions = EXTENSIONS;
- Extensions += ";;All Files (*)";
- QStringList files = QFileDialog::getOpenFileNames(this,tr("Load Overlay image sequence"),mInputPathName,Extensions);
- if (files.isEmpty())
- return;
+ if (!(CheckAddedImage(index, "fusion")) || !(CheckAddedImage(index, "fusionSequence")))
+ return;
- std::vector<std::string> vecFileNames;
- for (int i = 0; i < files.size(); i++) {
- vecFileNames.push_back(files[i].toStdString());
- }
+ QString Extensions = EXTENSIONS;
+ Extensions += ";;All Files (*)";
+ QStringList files = QFileDialog::getOpenFileNames(this,tr("Load Overlay image sequence"),mInputPathName,Extensions);
+ if (files.isEmpty())
+ return;
- //associate the secondary sequence (US) to the main one
- AddFusionSequence(index,vecFileNames,vvImageReader::MERGEDWITHTIME);
+ std::vector<std::string> vecFileNames;
+ for (int i = 0; i < files.size(); i++) {
+ vecFileNames.push_back(files[i].toStdString());
+ }
+
+ //associate the secondary sequence (US) to the main one
+ AddFusionSequence(index,vecFileNames,vvImageReader::MERGEDWITHTIME);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
- void vvMainWindow::SelectFusionSequenceCorrespondances() {
-
+ void vvMainWindow::SelectFusionSequenceCorrespondances()
+ {
//make sure the index is right?
//in the end, I should attach the temporal data to the right sequence!
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
bool signalOK = true;
unsigned nbFrameMain = mSlicerManagers[index]->GetImage()->GetTransform().size();
unsigned nbFrameSecondary = mSlicerManagers[index]->GetFusionSequenceNbFrames();
- std::cout<<"nbFrameMain = "<<nbFrameMain<<", nbFrameSecondary= "<<nbFrameSecondary<<", signal size: "<<tmpVect.size()<<std::endl;
+ std::cout<<"nbFrameMain = "<<nbFrameMain<<", nbFrameSecondary= "<<nbFrameSecondary<<", signal size: "<<tmpVect.size()<<std::endl;
std::vector<unsigned> temporalCorrespondances;
if ( tmpVect.size() == nbFrameMain + nbFrameSecondary ) {
for (unsigned i=0 ; i<tmpVect.size() ; i++) {
}
else { //first part of the file -> index in secondary seq.
if ( tmpVect(i)<nbFrameMain ) temporalCorrespondances.push_back(tmpVect(i));
- else { signalOK=false; break; } //pointing outside the secondary sequence...
- }
+ else { signalOK=false; break; } //pointing outside the secondary sequence...
+ }
}
}
else {signalOK=false;}
//when this function is called index is the slicer manager index corresponding to the main sequence (CT)
//the files behind fileNames points to the data for the secondary sequence
void vvMainWindow::AddFusionSequence(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
- {
+ {
QString file(fileNames[0].c_str());
if (QFile::exists(file))
{
item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
item->setToolTip(COLUMN_IMAGE_NAME, mSlicerManagers[index]->GetListOfAbsoluteFilePathInOneString("fusionSequence").c_str());
qApp->processEvents();
+ #if VTK_MAJOR_VERSION > 5
+ for ( unsigned int i = 0; i < mSlicerManagers[index]->GetNumberOfSlicers(); i++)
+ mSlicerManagers[index]->GetSlicer(i)->ForceUpdateDisplayExtent();
+ #endif
for (int j = 1; j <= 4; j++) {
item->setData(j,Qt::CheckStateRole,DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole));
}
//------------------------------------------------------------------------------
//fusionSequenceFrameIndex and fusionSequenceNbFrames are relative to the secondary sequence (US)
void vvMainWindow::SetFusionSequenceProperty(int fusionSequenceFrameIndex, bool spatialSyncFlag, unsigned int fusionSequenceNbFrames, bool temporalSyncFlag)
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
- if (!mSlicerManagers[index]->IsInvolvedInFusionSequence()) return;
+ if (!mSlicerManagers[index]->IsInvolvedInFusionSequence()) return;
//check if the focus moved to the linked sequence, and in this case, select the master sequence instead
if (!mSlicerManagers[index]->IsMainSequenceOfFusionSequence()) {
}
int secondaryIndex = mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager();
if (secondaryIndex==-1) return; //this should never happen
- if ( (!mSlicerManagers[index]->IsMainSequenceOfFusionSequence()) ||
- (!mSlicerManagers[secondaryIndex]->IsSecondarySequenceOfFusionSequence()) )
+ if ( (!mSlicerManagers[index]->IsMainSequenceOfFusionSequence()) ||
+ (!mSlicerManagers[secondaryIndex]->IsSecondarySequenceOfFusionSequence()) )
{return;} //this should never happen, raise an exception?
if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
mainSequenceFrameIndex = mSlicerManagers[index]->GetFusionSequenceCorrespondances()[ nbFramesMain + fusionSequenceFrameIndex];
//and set it!
mSlicerManagers[index]->SetTSlice(mainSequenceFrameIndex, false);
- //warning, there is a loopback, and modification of the TSlice in main sequence forces an update of the TSlice in secondary, etc...
+ //warning, there is a loopback, and modification of the TSlice in main sequence forces an update of the TSlice in secondary, etc...
}
//------------------------------------------------------------------------------
void vvMainWindow::SaveAs()
- {
+ {
if (DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString() == "vector") {
QMessageBox::warning(this,tr("Unsupported type"),tr("Sorry, saving a vector field is unsupported for the moment"));
return;
//------------------------------------------------------------------------------
void vvMainWindow::SaveCurrentState()
- {
+ {
QString Extensions = "XML Files(*.xml)";
QString fileName = QFileDialog::getSaveFileName(this,
tr("Save Current Window State"),
//------------------------------------------------------------------------------
void vvMainWindow::SaveCurrentStateAs(const std::string& stateFile)
- {
+ {
vvSaveState save_state;
save_state.Run(this, stateFile);
}
//------------------------------------------------------------------------------
void vvMainWindow::ReadSavedState()
- {
+ {
QString Extensions = "XML Files(*.xml)";
QString fileName = QFileDialog::getOpenFileName(this,
tr("Load Window State"),
//------------------------------------------------------------------------------
void vvMainWindow::ReadSavedStateFile(const std::string& stateFile)
- {
+ {
vvReadState read_state;
read_state.Run(this, stateFile);
}
//------------------------------------------------------------------------------
void vvMainWindow::LinkAllImages()
- {
+ {
linkPanel->linkAll();
}
//------------------------------------------------------------------------------
void vvMainWindow::AddLink(QString image1,QString image2,bool fromPanel)
- {
+ {
if (!fromPanel) {
// delegate to linkPanel if call came from elsewhere...
linkPanel->addLinkFromIds(image1, image2);
//------------------------------------------------------------------------------
void vvMainWindow::RemoveLink(QString image1,QString image2)
- {
+ {
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (image1.toStdString() == mSlicerManagers[i]->GetId()) {
mSlicerManagers[i]->RemoveLink(image2.toStdString());
//------------------------------------------------------------------------------
void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, int offset)
- {
+ {
if(mSlicerManagers.size()==1)
return;
}
//------------------------------------------------------------------------------
void vvMainWindow::HorizontalSliderMoved(int value,int column, int slicer_index)
- {
+ {
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (DataTree->topLevelItem(i)->data(column,Qt::CheckStateRole).toInt() > 1) {
//i is the SlicerManager that is in charge of this slicer.
if (mSlicerManagers[i]->IsInvolvedInFusionSequence()) {
//if the slicerManager is involved in a fusionSequence as the secondary sequence, then update the slider position in the overlay panel and everything accordingly
- if (mSlicerManagers[i]->IsSecondarySequenceOfFusionSequence()) {
- overlayPanel->updateFusionSequenceSliderValueFromWindow(value, true);
+ if (mSlicerManagers[i]->IsSecondarySequenceOfFusionSequence()) {
+ overlayPanel->updateFusionSequenceSliderValueFromWindow(value, true);
}
else { //if this is the primary sequence that has been modified
- if (mSlicerManagers[i]->GetFusionSequenceTemporalSyncFlag()) {
+ if (mSlicerManagers[i]->GetFusionSequenceTemporalSyncFlag()) {
//WARNING: for some obscure reason, there are problems when accessing mSlicerManagers[mSlicerManagers[i]->GetFusionSequenceIndexOfLinkedManager()]->GetFusionSequenceFrameIndex();
int estimatedValue=0;
//estimate a corresponding time index for the secondary (US) sequence, and update it accordingly.
- estimatedValue = mSlicerManagers[i]->GetFusionSequenceCorrespondances()[ value ];
+ estimatedValue = mSlicerManagers[i]->GetFusionSequenceCorrespondances()[ value ];
//TODO: at the moment, there is a loop in TSlice modifications
//modifying sequence 1 causes seq 2 to update, which in turns update seq1...
//I disable control on seq1 at the moment.
//------------------------------------------------------------------------------
void vvMainWindow::NOHorizontalSliderMoved()
- {
+ {
// if (mCurrentTime == NOHorizontalSlider->value()) return;
HorizontalSliderMoved(NOHorizontalSlider->value(),COLUMN_UL_VIEW,0);
// mCurrentTime = NOHorizontalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::NEHorizontalSliderMoved()
- {
+ {
// if (mCurrentTime == NEHorizontalSlider->value()) return;
HorizontalSliderMoved(NEHorizontalSlider->value(),COLUMN_UR_VIEW,1);
// mCurrentTime = NEHorizontalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::SOHorizontalSliderMoved()
- {
+ {
// if (mCurrentTime == SOHorizontalSlider->value()) return;
HorizontalSliderMoved(SOHorizontalSlider->value(),COLUMN_DL_VIEW,2);
// mCurrentTime = SOHorizontalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::SEHorizontalSliderMoved()
- {
+ {
// if (mCurrentTime == SEHorizontalSlider->value()) return;
HorizontalSliderMoved(SEHorizontalSlider->value(),COLUMN_DR_VIEW,3);
// mCurrentTime = SEHorizontalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::NOVerticalSliderChanged()
- {
+ {
static int value=-1;
if (value == NOVerticalSlider->value()) return;
else value = NOVerticalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::NEVerticalSliderChanged()
- {
+ {
static int value=-1;
if (value == NEVerticalSlider->value()) return;
else value = NEVerticalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::SOVerticalSliderChanged()
- {
+ {
static int value=-1;
if (value == SOVerticalSlider->value()) return;
else value = SOVerticalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::SEVerticalSliderChanged()
- {
+ {
static int value=-1;
if (value == SEVerticalSlider->value()) return;
else value = SEVerticalSlider->value();
//------------------------------------------------------------------------------
void vvMainWindow::UpdateSlice(int slicer, int slice)
- {
+ {
// DD("vvMainWindow::UpdateSlice");
// DD(slicer);
// DD(slice);
//------------------------------------------------------------------------------
void vvMainWindow::UpdateTSlice(int slicer, int slice, int code)
- {
+ {
//FusionSequence: the slider value should be updated for slicers which show the same sequence as requested
bool doUpdate=false;
if (code==-1) doUpdate=true;
//------------------------------------------------------------------------------
void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax)
- {
+ {
//int position = int((min+max)/2);
int position = mSlicerManagers[mCurrentPickedImageIndex]->GetSlicer(slicer)->GetSlice();
if (slicer == 0) {
//------------------------------------------------------------------------------
void vvMainWindow::SaveNOScreenshot()
- {
+ {
SaveScreenshot(NOViewWidget);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveNEScreenshot()
- {
+ {
SaveScreenshot(NEViewWidget);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveSOScreenshot()
- {
+ {
SaveScreenshot(SOViewWidget);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveSEScreenshot()
- {
+ {
SaveScreenshot(SEViewWidget);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveScreenshotAllSlices()
- {
+ {
QVTKWidget *widget = NOViewWidget;
int index = 0;// GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
// Change the slice
slicer->SetSlice(i); // -> change the slice of the current slicer
SM->UpdateSlice(0); // --> this one emit UpdateSlice
- QCoreApplication::flush(); // -> needed to force display of contours
+ QCoreApplication::flush(); // -> needed to force display of contours
- // Screenshot
+ // Screenshot
vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter = vtkSmartPointer<vtkWindowToImageFilter>::New();
windowToImageFilter->SetInput(renderWindow);
windowToImageFilter->SetMagnification(1);
if (i<100) num = "0"+num;
if (i<1000) num = "0"+num;
- fn = itksys::SystemTools::GetFilenamePath(filename.toStdString()) + "/"+ fn
+ fn = itksys::SystemTools::GetFilenamePath(filename.toStdString()) + "/"+ fn
+ "_" + num + itksys::SystemTools::GetFilenameLastExtension(filename.toStdString());
writer->SetFileName(fn.c_str());
+ #if VTK_MAJOR_VERSION <= 5
writer->SetInput(windowToImageFilter->GetOutput());
+ #else
+ writer->SetInputConnection(windowToImageFilter->GetOutputPort());
+ #endif
writer->Write();
}
}
//------------------------------------------------------------------------------
void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
- {
+ {
QString Extensions = "Images( *.png);;";
Extensions += "Images( *.jpg);;";
Extensions += "Images( *.bmp);;";
// Snapshot image if not null
if(imgwriter!=NULL) {
+ #if VTK_MAJOR_VERSION <= 5
imgwriter->SetInput(image);
+ #else
+ imgwriter->SetInputConnection(w2i->GetOutputPort());
+ #endif
imgwriter->SetFileName(fileName.toStdString().c_str());
imgwriter->Write();
return;
// FPS
bool ok;
- int fps = QInputDialog::getInteger(this, tr("Number of frames per second"),
+ int fps = QInputDialog::getInt(this, tr("Number of frames per second"),
tr("FPS:"), 5, 0, 1000, 1, &ok);
if(ok)
gif->SetRate(fps);
// Loops
- int loops = QInputDialog::getInteger(this, tr("Loops"),
+ int loops = QInputDialog::getInt(this, tr("Loops"),
tr("Number of loops (0 means infinite):"), 0, 0, 1000000000, 1, &ok);
if(ok)
gif->SetLoops(loops);
vidwriter = mpg;
mpg->SetQuality(2);
bool ok;
- int fps = QInputDialog::getInteger(this, tr("Number of frames per second"),
+ int fps = QInputDialog::getInt(this, tr("Number of frames per second"),
tr("FPS:"), 5, 0, 1024, 1, &ok);
if(!ok)
fps = 5;
vidwriter = mpg;
mpg->SetQuality(2);
bool ok;
- int fps = QInputDialog::getInteger(this, tr("Number of frames per second"),
+ int fps = QInputDialog::getInt(this, tr("Number of frames per second"),
tr("FPS:"), 5, 0, 1024, 1, &ok);
if(!ok)
fps = 5;
// Take video if not null
if(vidwriter!=NULL){
+ #if VTK_MAJOR_VERSION <= 5
vidwriter->SetInput(image);
+ #else
+ vidwriter->SetInputConnection(w2i->GetOutputPort());
+ #endif
vidwriter->SetFileName(fileName.toStdString().c_str());
vidwriter->Start();
int nSlice = mSlicerManagers[smIndex]->GetSlicer(0)->GetTMax();
vtkSmartPointer<vtkWindowToImageFilter> w2i = vtkSmartPointer<vtkWindowToImageFilter>::New();
w2i->SetInput(widget->GetRenderWindow());
w2i->Update();
+ #if VTK_MAJOR_VERSION <= 5
vidwriter->SetInput(w2i->GetOutput());
+ #else
+ vidwriter->SetInputConnection(w2i->GetOutputPort());
+ #endif
vidwriter->Write();
}
vidwriter->End();
//------------------------------------------------------------------------------
void vvMainWindow::GoToCursor()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
for (int column = 1; column < 5; column++) {
if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) {
//------------------------------------------------------------------------------
void vvMainWindow::GoToLandmark()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
for (int column = 1; column < 5; column++) {
if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) {
//------------------------------------------------------------------------------
void vvMainWindow::PlayPause()
- {
+ {
if (playMode) {
playMode = 0;
playButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/player_play.png")));
//------------------------------------------------------------------------------
void vvMainWindow::PlayNext()
- {
+ {
if (playMode && !this->isHidden()) {
int image_number=DataTree->topLevelItemCount();
///Only play one slicer per SM, and only if the SM is being displayed
//------------------------------------------------------------------------------
void vvMainWindow::ShowLastImage()
- {
+ {
if (mSlicerManagers.size() > 1) {
QTreeWidgetItem * item=DataTree->topLevelItem(DataTree->topLevelItemCount()-1);
CurrentImageChanged(mSlicerManagers.back()->GetId()); //select new image
item->setData(1,Qt::CheckStateRole,2); //show the new image in the first panel
+ //mSlicerManagers[GetSlicerIndexFromItem(item)]->GetSlicer(0)->SetActorVisibility("image", 0, 1); //Set the Last Image visibles
DisplayChanged(item,1);
}
}
//------------------------------------------------------------------------------
void vvMainWindow::UpdateRenderWindows()
- {
+ {
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
- mSlicerManagers[i]->GetSlicer(0)->UpdateLandmarks();
- mSlicerManagers[i]->GetSlicer(1)->UpdateLandmarks();
- mSlicerManagers[i]->GetSlicer(2)->UpdateLandmarks();
- mSlicerManagers[i]->GetSlicer(3)->UpdateLandmarks();
+ for (unsigned int j = 0; j < 4; ++j) {
+ mSlicerManagers[i]->GetSlicer(j)->RemoveLandmarks();
+ mSlicerManagers[i]->GetSlicer(j)->DisplayLandmarks();
+ }
}
if (NOViewWidget->GetRenderWindow()) NOViewWidget->GetRenderWindow()->Render();
if (NEViewWidget->GetRenderWindow()) NEViewWidget->GetRenderWindow()->Render();
//------------------------------------------------------------------------------
void vvMainWindow::SegmentationOnCurrentImage()
- {
+ {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
vvSegmentationDialog segmentation;
//------------------------------------------------------------------------------
void vvMainWindow::SurfaceViewerLaunch()
- {
+ {
vvSurfaceViewerDialog surfaceViewer;
surfaceViewer.exec();
}
//------------------------------------------------------------------------------
int vvMainWindow::GetImageDuplicateFilenameNumber(std::string filename)
- {
+ {
int number=0;
for(unsigned int l=0; l<mSlicerManagers.size(); l++) {
vvSlicerManager * v = mSlicerManagers[l];
//------------------------------------------------------------------------------
vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filename)
- {
+ {
// Change filename if another image exist with the same name
int number = GetImageDuplicateFilenameNumber(filename);
connect(mSlicerManagers.back(), SIGNAL(LandmarkAdded()),landmarksPanel,SLOT(AddPoint()));
+
+ InitSlicers();
UpdateTree();
qApp->processEvents();
- InitSlicers();
- ShowLastImage();
InitDisplay();
+ ShowLastImage();
qApp->processEvents();
-
// End
ImageInfoChanged();
return slicer_manager;
//------------------------------------------------------------------------------
void vvMainWindow::UpdateCurrentSlicer()
- {
+ {
int index = -1;
if (DataTree->selectedItems().size() > 0) {
index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
mSlicerManagerCurrentIndex = index;
}
//------------------------------------------------------------------------------
-
--- /dev/null
- //// 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;
+}