commit b2842e622ca13a9763188a04e46f99fcce6c59fb
Author: xueyan hu <576627988@qq.com>
Date: Mon Jan 24 10:10:45 2022 +0800
first commit
diff --git a/src/Combinear.qss b/src/Combinear.qss
new file mode 100644
index 0000000..6b592e2
--- /dev/null
+++ b/src/Combinear.qss
@@ -0,0 +1,157 @@
+/*-----QWidget-----*/
+*{
+ font:12px;
+}
+QToolBar
+{
+ background-color: #323232;
+ border-bottom:1px solid #cdcdcd;
+}
+
+QWidget#statusBar
+{
+ background-color: #323232;
+ border:1px solid #5a5a5a;
+ color:white;
+}
+
+/*-----QToolButton-----*/
+QToolButton
+{
+ border-radius: 5px; margin:0px 0px 0px 0px; padding:3px;
+}
+
+QToolButton::menu-button
+{
+ background-color: transparent;
+}
+
+QToolButton::menu-arrow {
+ image: url(:/InfiniteViewer/Icon/triangle-down-white.png);
+ width:6px;
+}
+
+QToolButton:hover
+{
+ background-color: #8a8a8a;
+}
+QToolButton:checked
+{
+ background-color: #646464;
+}
+QToolButton:pressed
+{
+ background-color: #646464;
+}
+
+/*-----QMenu-----*/
+QMenu {
+ background-color: #f0f0f0;
+}
+
+
+QMenu::item {
+ background-color: transparent;
+}
+
+QMenu::item:selected { /* when user selects item using mouse or keyboard */
+ background-color: #8a8a8a;
+}
+
+/*-----DicomImageView-----*/
+DicomImageView#dicomview
+{
+ border: 1px solid #646464;
+}
+QFrame#wrapper
+{
+ border-top: 1px solid #646464;
+ border-bottom: 0px;
+ border-left: 0px;
+ border-right: 0px;
+}
+
+
+
+/*-----QScrollBar-----*/
+QScrollBar:vertical {
+ border: 0px solid grey;
+ background: #2d2d2d;
+ width: 15px;
+ margin: 0px 0 0px 0;
+ }
+
+ QScrollBar::handle:vertical {
+ background: #5a5a5a;
+ min-height: 25px;
+ }
+
+ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
+ background: #2d2d2d;
+ }
+
+ /*-----QSlider-----*/
+QSlider::groove:horizontal
+{
+ background-color: transparent;
+ height: 3px;
+
+}
+
+
+QSlider::sub-page:horizontal
+{
+ background-color: #131313;
+
+}
+
+
+QSlider::add-page:horizontal
+{
+ background-color: #131313;
+
+}
+
+
+QSlider::handle:horizontal
+{
+ background-color: #dd8c98;
+ width: 14px;
+ margin-top: -6px;
+ margin-bottom: -6px;
+ border-radius: 6px;
+
+}
+
+
+QSlider::handle:horizontal:hover
+{
+ background-color: #d89e25;
+ border-radius: 6px;
+
+}
+
+
+QSlider::sub-page:horizontal:disabled
+{
+ background-color: #bbb;
+ border-color: #999;
+
+}
+
+
+QSlider::add-page:horizontal:disabled
+{
+ background-color: #eee;
+ border-color: #999;
+
+}
+
+
+QSlider::handle:horizontal:disabled
+{
+ background-color: #eee;
+ border: 1px solid #aaa;
+ border-radius: 3px;
+
+}
\ No newline at end of file
diff --git a/src/Icon/angle.png b/src/Icon/angle.png
new file mode 100644
index 0000000..2935f4c
Binary files /dev/null and b/src/Icon/angle.png differ
diff --git a/src/Icon/anno.png b/src/Icon/anno.png
new file mode 100644
index 0000000..90edd64
Binary files /dev/null and b/src/Icon/anno.png differ
diff --git a/src/Icon/arrow.png b/src/Icon/arrow.png
new file mode 100644
index 0000000..d5819b6
Binary files /dev/null and b/src/Icon/arrow.png differ
diff --git a/src/Icon/cine.png b/src/Icon/cine.png
new file mode 100644
index 0000000..82c6755
Binary files /dev/null and b/src/Icon/cine.png differ
diff --git a/src/Icon/close.png b/src/Icon/close.png
new file mode 100644
index 0000000..cc3dbba
Binary files /dev/null and b/src/Icon/close.png differ
diff --git a/src/Icon/cursor.png b/src/Icon/cursor.png
new file mode 100644
index 0000000..6e71ae6
Binary files /dev/null and b/src/Icon/cursor.png differ
diff --git a/src/Icon/distance.png b/src/Icon/distance.png
new file mode 100644
index 0000000..5014b70
Binary files /dev/null and b/src/Icon/distance.png differ
diff --git a/src/Icon/ellipse.png b/src/Icon/ellipse.png
new file mode 100644
index 0000000..f43bfc4
Binary files /dev/null and b/src/Icon/ellipse.png differ
diff --git a/src/Icon/flip.png b/src/Icon/flip.png
new file mode 100644
index 0000000..75e34d0
Binary files /dev/null and b/src/Icon/flip.png differ
diff --git a/src/Icon/full_screen.png b/src/Icon/full_screen.png
new file mode 100644
index 0000000..c5a7295
Binary files /dev/null and b/src/Icon/full_screen.png differ
diff --git a/src/Icon/fusion.png b/src/Icon/fusion.png
new file mode 100644
index 0000000..6c74cfc
Binary files /dev/null and b/src/Icon/fusion.png differ
diff --git a/src/Icon/grid.png b/src/Icon/grid.png
new file mode 100644
index 0000000..170f4d3
Binary files /dev/null and b/src/Icon/grid.png differ
diff --git a/src/Icon/hidden.png b/src/Icon/hidden.png
new file mode 100644
index 0000000..a98732c
Binary files /dev/null and b/src/Icon/hidden.png differ
diff --git a/src/Icon/image.png b/src/Icon/image.png
new file mode 100644
index 0000000..b586edb
Binary files /dev/null and b/src/Icon/image.png differ
diff --git a/src/Icon/import.png b/src/Icon/import.png
new file mode 100644
index 0000000..7b10606
Binary files /dev/null and b/src/Icon/import.png differ
diff --git a/src/Icon/import2.png b/src/Icon/import2.png
new file mode 100644
index 0000000..4400c51
Binary files /dev/null and b/src/Icon/import2.png differ
diff --git a/src/Icon/line.png b/src/Icon/line.png
new file mode 100644
index 0000000..126dffe
Binary files /dev/null and b/src/Icon/line.png differ
diff --git a/src/Icon/logo.png b/src/Icon/logo.png
new file mode 100644
index 0000000..72e06ec
Binary files /dev/null and b/src/Icon/logo.png differ
diff --git a/src/Icon/max.png b/src/Icon/max.png
new file mode 100644
index 0000000..ae9ace8
Binary files /dev/null and b/src/Icon/max.png differ
diff --git a/src/Icon/maximize-restore.png b/src/Icon/maximize-restore.png
new file mode 100644
index 0000000..7862a3e
Binary files /dev/null and b/src/Icon/maximize-restore.png differ
diff --git a/src/Icon/minimize.png b/src/Icon/minimize.png
new file mode 100644
index 0000000..cceb202
Binary files /dev/null and b/src/Icon/minimize.png differ
diff --git a/src/Icon/openfile.png b/src/Icon/openfile.png
new file mode 100644
index 0000000..7f35fc4
Binary files /dev/null and b/src/Icon/openfile.png differ
diff --git a/src/Icon/pan.png b/src/Icon/pan.png
new file mode 100644
index 0000000..e12fd97
Binary files /dev/null and b/src/Icon/pan.png differ
diff --git a/src/Icon/polygon.png b/src/Icon/polygon.png
new file mode 100644
index 0000000..43c8d74
Binary files /dev/null and b/src/Icon/polygon.png differ
diff --git a/src/Icon/polyline.png b/src/Icon/polyline.png
new file mode 100644
index 0000000..e22d2fc
Binary files /dev/null and b/src/Icon/polyline.png differ
diff --git a/src/Icon/pq/pqApply.png b/src/Icon/pq/pqApply.png
new file mode 100644
index 0000000..26fe501
Binary files /dev/null and b/src/Icon/pq/pqApply.png differ
diff --git a/src/Icon/pq/pqBold24.png b/src/Icon/pq/pqBold24.png
new file mode 100644
index 0000000..4d2fa07
Binary files /dev/null and b/src/Icon/pq/pqBold24.png differ
diff --git a/src/Icon/pq/pqCancel.png b/src/Icon/pq/pqCancel.png
new file mode 100644
index 0000000..ce7e425
Binary files /dev/null and b/src/Icon/pq/pqCancel.png differ
diff --git a/src/Icon/pq/pqDelete.png b/src/Icon/pq/pqDelete.png
new file mode 100644
index 0000000..550d57d
Binary files /dev/null and b/src/Icon/pq/pqDelete.png differ
diff --git a/src/Icon/pq/pqItalics24.png b/src/Icon/pq/pqItalics24.png
new file mode 100644
index 0000000..173d79e
Binary files /dev/null and b/src/Icon/pq/pqItalics24.png differ
diff --git a/src/Icon/pq/pqShadow24.png b/src/Icon/pq/pqShadow24.png
new file mode 100644
index 0000000..dc9259c
Binary files /dev/null and b/src/Icon/pq/pqShadow24.png differ
diff --git a/src/Icon/pq/pqVcrBack.png b/src/Icon/pq/pqVcrBack.png
new file mode 100644
index 0000000..46c0e3a
Binary files /dev/null and b/src/Icon/pq/pqVcrBack.png differ
diff --git a/src/Icon/pq/pqVcrFirst.png b/src/Icon/pq/pqVcrFirst.png
new file mode 100644
index 0000000..1a5e0de
Binary files /dev/null and b/src/Icon/pq/pqVcrFirst.png differ
diff --git a/src/Icon/pq/pqVcrForward.png b/src/Icon/pq/pqVcrForward.png
new file mode 100644
index 0000000..513adc0
Binary files /dev/null and b/src/Icon/pq/pqVcrForward.png differ
diff --git a/src/Icon/pq/pqVcrFpsDown.png b/src/Icon/pq/pqVcrFpsDown.png
new file mode 100644
index 0000000..21586dd
Binary files /dev/null and b/src/Icon/pq/pqVcrFpsDown.png differ
diff --git a/src/Icon/pq/pqVcrFpsUp.png b/src/Icon/pq/pqVcrFpsUp.png
new file mode 100644
index 0000000..61a4030
Binary files /dev/null and b/src/Icon/pq/pqVcrFpsUp.png differ
diff --git a/src/Icon/pq/pqVcrLast.png b/src/Icon/pq/pqVcrLast.png
new file mode 100644
index 0000000..4d49b13
Binary files /dev/null and b/src/Icon/pq/pqVcrLast.png differ
diff --git a/src/Icon/pq/pqVcrPause.png b/src/Icon/pq/pqVcrPause.png
new file mode 100644
index 0000000..94e3066
Binary files /dev/null and b/src/Icon/pq/pqVcrPause.png differ
diff --git a/src/Icon/pq/pqVcrPlay.png b/src/Icon/pq/pqVcrPlay.png
new file mode 100644
index 0000000..4dc9808
Binary files /dev/null and b/src/Icon/pq/pqVcrPlay.png differ
diff --git a/src/Icon/save.png b/src/Icon/save.png
new file mode 100644
index 0000000..9982e5b
Binary files /dev/null and b/src/Icon/save.png differ
diff --git a/src/Icon/slice.png b/src/Icon/slice.png
new file mode 100644
index 0000000..8990034
Binary files /dev/null and b/src/Icon/slice.png differ
diff --git a/src/Icon/sync/sync_auto.png b/src/Icon/sync/sync_auto.png
new file mode 100644
index 0000000..c0ebc17
Binary files /dev/null and b/src/Icon/sync/sync_auto.png differ
diff --git a/src/Icon/sync/sync_dis.png b/src/Icon/sync/sync_dis.png
new file mode 100644
index 0000000..0565765
Binary files /dev/null and b/src/Icon/sync/sync_dis.png differ
diff --git a/src/Icon/sync/sync_manual.png b/src/Icon/sync/sync_manual.png
new file mode 100644
index 0000000..c579a6b
Binary files /dev/null and b/src/Icon/sync/sync_manual.png differ
diff --git a/src/Icon/text.png b/src/Icon/text.png
new file mode 100644
index 0000000..c6aa7d6
Binary files /dev/null and b/src/Icon/text.png differ
diff --git a/src/Icon/textProp.png b/src/Icon/textProp.png
new file mode 100644
index 0000000..04ccacf
Binary files /dev/null and b/src/Icon/textProp.png differ
diff --git a/src/Icon/trashbin.png b/src/Icon/trashbin.png
new file mode 100644
index 0000000..e2b3735
Binary files /dev/null and b/src/Icon/trashbin.png differ
diff --git a/src/Icon/triangle-down-black.png b/src/Icon/triangle-down-black.png
new file mode 100644
index 0000000..5a63866
Binary files /dev/null and b/src/Icon/triangle-down-black.png differ
diff --git a/src/Icon/triangle-down-white.png b/src/Icon/triangle-down-white.png
new file mode 100644
index 0000000..0cd426e
Binary files /dev/null and b/src/Icon/triangle-down-white.png differ
diff --git a/src/Icon/triangle.png b/src/Icon/triangle.png
new file mode 100644
index 0000000..4cacee9
Binary files /dev/null and b/src/Icon/triangle.png differ
diff --git a/src/Icon/windowlevel.png b/src/Icon/windowlevel.png
new file mode 100644
index 0000000..79d6082
Binary files /dev/null and b/src/Icon/windowlevel.png differ
diff --git a/src/Icon/zoom.png b/src/Icon/zoom.png
new file mode 100644
index 0000000..9285704
Binary files /dev/null and b/src/Icon/zoom.png differ
diff --git a/src/QDicomViewer.qrc b/src/QDicomViewer.qrc
new file mode 100644
index 0000000..cbe3513
--- /dev/null
+++ b/src/QDicomViewer.qrc
@@ -0,0 +1,67 @@
+
+
+ Resources/import/add.png
+ Resources/import/arrow.png
+ Resources/import/close.png
+ Resources/import/icon.png
+ Resources/import/max.png
+ Resources/import/max_ba.png
+ Resources/import/min.png
+ Resources/import/remove.png
+ Resources/import/setting.png
+
+
+ Combinear.qss
+
+
+ Icon/angle.png
+ Icon/distance.png
+ Icon/grid.png
+ Icon/hidden.png
+ Icon/openfile.png
+ Icon/pan.png
+ Icon/windowlevel.png
+ Icon/zoom.png
+ Icon/sync/sync_auto.png
+ Icon/sync/sync_dis.png
+ Icon/sync/sync_manual.png
+ Icon/save.png
+ Icon/anno.png
+ Icon/flip.png
+ Icon/cine.png
+ Icon/fusion.png
+ Icon/trashbin.png
+ Icon/slice.png
+ Icon/import.png
+ Icon/logo.png
+ Icon/close.png
+ Icon/max.png
+ Icon/triangle-down-black.png
+ Icon/triangle-down-white.png
+ Icon/text.png
+ Icon/ellipse.png
+ Icon/textProp.png
+ Icon/arrow.png
+ Icon/polygon.png
+ Icon/polyline.png
+ Icon/full_screen.png
+ Icon/maximize-restore.png
+ Icon/minimize.png
+
+
+ Icon/pq/pqBold24.png
+ Icon/pq/pqItalics24.png
+ Icon/pq/pqShadow24.png
+ Icon/pq/pqApply.png
+ Icon/pq/pqCancel.png
+ Icon/pq/pqDelete.png
+ Icon/pq/pqVcrBack.png
+ Icon/pq/pqVcrFirst.png
+ Icon/pq/pqVcrForward.png
+ Icon/pq/pqVcrFpsDown.png
+ Icon/pq/pqVcrFpsUp.png
+ Icon/pq/pqVcrLast.png
+ Icon/pq/pqVcrPause.png
+ Icon/pq/pqVcrPlay.png
+
+
diff --git a/src/Resources/import/add.png b/src/Resources/import/add.png
new file mode 100644
index 0000000..fdaa55d
Binary files /dev/null and b/src/Resources/import/add.png differ
diff --git a/src/Resources/import/arrow.png b/src/Resources/import/arrow.png
new file mode 100644
index 0000000..f787a36
Binary files /dev/null and b/src/Resources/import/arrow.png differ
diff --git a/src/Resources/import/close.png b/src/Resources/import/close.png
new file mode 100644
index 0000000..9d56fb3
Binary files /dev/null and b/src/Resources/import/close.png differ
diff --git a/src/Resources/import/icon.png b/src/Resources/import/icon.png
new file mode 100644
index 0000000..9f5c1fa
Binary files /dev/null and b/src/Resources/import/icon.png differ
diff --git a/src/Resources/import/max.png b/src/Resources/import/max.png
new file mode 100644
index 0000000..8bd4a0c
Binary files /dev/null and b/src/Resources/import/max.png differ
diff --git a/src/Resources/import/max_ba.png b/src/Resources/import/max_ba.png
new file mode 100644
index 0000000..cc66395
Binary files /dev/null and b/src/Resources/import/max_ba.png differ
diff --git a/src/Resources/import/min.png b/src/Resources/import/min.png
new file mode 100644
index 0000000..165d575
Binary files /dev/null and b/src/Resources/import/min.png differ
diff --git a/src/Resources/import/radius_back.png b/src/Resources/import/radius_back.png
new file mode 100644
index 0000000..fdd532b
Binary files /dev/null and b/src/Resources/import/radius_back.png differ
diff --git a/src/Resources/import/radius_front.png b/src/Resources/import/radius_front.png
new file mode 100644
index 0000000..a7e8ecc
Binary files /dev/null and b/src/Resources/import/radius_front.png differ
diff --git a/src/Resources/import/remove.png b/src/Resources/import/remove.png
new file mode 100644
index 0000000..801a58d
Binary files /dev/null and b/src/Resources/import/remove.png differ
diff --git a/src/Resources/import/setting.png b/src/Resources/import/setting.png
new file mode 100644
index 0000000..45ac571
Binary files /dev/null and b/src/Resources/import/setting.png differ
diff --git a/src/form/QDicomViewer.ui b/src/form/QDicomViewer.ui
new file mode 100644
index 0000000..4246582
--- /dev/null
+++ b/src/form/QDicomViewer.ui
@@ -0,0 +1,166 @@
+
+
+ QDicomViewerClass
+
+
+
+ 0
+ 0
+ 1099
+ 761
+
+
+
+ QDicomViewer
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 150
+ 0
+
+
+
+
+ 150
+ 16777215
+
+
+
+
+ Britannic Bold
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 20
+
+
+
+
+ 16777215
+ 20
+
+
+
+ true
+
+
+
+
+ toolBar
+
+
+ false
+
+
+ false
+
+
+ TopToolBarArea
+
+
+ false
+
+
+
+
+
+
+ ViewContainerWidget
+ QWidget
+ view/viewcontainerwidget.h
+ 1
+
+
+ ThumbnailBarWidget
+ QWidget
+ view/thumbnailbarwidget.h
+ 1
+
+
+
+
+
+
+
+
diff --git a/src/form/calibrationWidget.ui b/src/form/calibrationWidget.ui
new file mode 100644
index 0000000..3dc0e9a
--- /dev/null
+++ b/src/form/calibrationWidget.ui
@@ -0,0 +1,143 @@
+
+
+ calibrationWidget
+
+
+
+ 0
+ 0
+ 321
+ 96
+
+
+
+
+ Arial
+
+
+
+ Length Calibration
+
+
+ -
+
+
+
-
+
+
+
+ Arial
+
+
+
+ Enter new distance
+
+
+
+ -
+
+
+ -
+
+
+ mm
+
+
+
+
+
+
+ -
+
+
+ 6
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 131
+ 31
+
+
+
+
+ -
+
+
+
+ Arial
+
+
+
+ OK
+
+
+
+ -
+
+
+
+ Arial
+
+
+
+ Cancel
+
+
+
+
+
+
+
+
+
+
+ okButton
+ clicked()
+ calibrationWidget
+ accept()
+
+
+ 278
+ 253
+
+
+ 96
+ 254
+
+
+
+
+ cancelButton
+ clicked()
+ calibrationWidget
+ reject()
+
+
+ 369
+ 253
+
+
+ 179
+ 282
+
+
+
+
+
diff --git a/src/form/customwindow.ui b/src/form/customwindow.ui
new file mode 100644
index 0000000..591a0f5
--- /dev/null
+++ b/src/form/customwindow.ui
@@ -0,0 +1,154 @@
+
+
+ Customwindow
+
+
+ Qt::WindowModal
+
+
+
+ 0
+ 0
+ 345
+ 185
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 345
+ 185
+
+
+
+ Customwindow
+
+
+ -
+
+
+
-
+
+
+
-
+
+
+ Window level
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+
+ 71
+ 20
+
+
+
+
+ -
+
+
+
+ 70
+ 25
+
+
+
+
+
+
+
+ -
+
+
+
-
+
+
+ Window width
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+
+ 71
+ 20
+
+
+
+
+ -
+
+
+
+ 70
+ 25
+
+
+
+
+
+
+
+ -
+
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 126
+ 20
+
+
+
+
+ -
+
+
+ OK
+
+
+
+ -
+
+
+ Cancel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/form/exportdialog.ui b/src/form/exportdialog.ui
new file mode 100644
index 0000000..35897e8
--- /dev/null
+++ b/src/form/exportdialog.ui
@@ -0,0 +1,294 @@
+
+
+ ExportDialog
+
+
+
+ 0
+ 0
+ 544
+ 384
+
+
+
+
+ 544
+ 384
+
+
+
+ Dialog
+
+
+ -
+
+
+ Export Type
+
+
+
-
+
+
+ Export File
+
+
+
+ -
+
+
+ Current Image
+
+
+ true
+
+
+ buttonGroup
+
+
+
+ -
+
+
+ Current Series
+
+
+ buttonGroup
+
+
+
+ -
+
+
+ All Opened Series
+
+
+ buttonGroup
+
+
+
+ -
+
+
+ File Format
+
+
+
+ -
+
+
+ JPEG
+
+
+ true
+
+
+ buttonGroup_2
+
+
+
+ -
+
+
+ BMP
+
+
+ buttonGroup_2
+
+
+
+ -
+
+
+ PNG
+
+
+ buttonGroup_2
+
+
+
+ -
+
+
+ TIFF
+
+
+ buttonGroup_2
+
+
+
+ -
+
+
+ DICOM
+
+
+ buttonGroup_2
+
+
+
+
+
+
+ -
+
+
+ Export Location
+
+
+
-
+
+
+ Export Folder
+
+
+
+ -
+
+
+ -
+
+
+ Qt::NoFocus
+
+
+ Choose Folder...
+
+
+
+ -
+
+
+ FileName Prefix
+
+
+
+ -
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 199
+ 20
+
+
+
+
+
+
+
+ -
+
+
+ File Settings
+
+
+
-
+
+
+ Annotations
+
+
+
+ -
+
+
+ Full
+
+
+ true
+
+
+ buttonGroup_3
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Basic(anonymous)
+
+
+ buttonGroup_3
+
+
+
+ -
+
+
+ Disabled
+
+
+ buttonGroup_3
+
+
+
+
+
+
+ -
+
+
+ 0
+
+
+ true
+
+
+ QProgressBar::TopToBottom
+
+
+
+ -
+
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 343
+ 20
+
+
+
+
+ -
+
+
+ Export
+
+
+
+ -
+
+
+ Close
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/form/gridpopwidget.ui b/src/form/gridpopwidget.ui
new file mode 100644
index 0000000..bf80f78
--- /dev/null
+++ b/src/form/gridpopwidget.ui
@@ -0,0 +1,2366 @@
+
+
+ GridPopWidget
+
+
+
+ 0
+ 0
+ 278
+ 224
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 64
+ 64
+ 64
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 64
+ 64
+ 64
+
+
+
+
+
+
+
+
+ 64
+ 64
+ 64
+
+
+
+
+
+
+ 64
+ 64
+ 64
+
+
+
+
+
+
+
+ Form
+
+
+
+ 6
+
+
+ 6
+
+
+ 6
+
+
+ 6
+
+
+ 4
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+ -
+
+
+
+ 50
+ 50
+
+
+
+
+ 50
+ 50
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+ 147
+ 147
+ 147
+
+
+
+
+
+
+
+ true
+
+
+ background-color: rgb(147, 147, 147);
+
+
+
+
+
+
+
+
diff --git a/src/form/pqFontPropertyWidget.ui b/src/form/pqFontPropertyWidget.ui
new file mode 100644
index 0000000..f914f9f
--- /dev/null
+++ b/src/form/pqFontPropertyWidget.ui
@@ -0,0 +1,206 @@
+
+
+ FontPropertyWidget
+
+
+
+ 0
+ 0
+ 500
+ 136
+
+
+
+
+ 500
+ 0
+
+
+
+ Text Property
+
+
+ -
+
+
+
+ 1
+ 0
+
+
+
+ Specify the path to a TTF file here.
+
+
+
+ -
+
+
+ 2
+
+
-
+
+
+ Apply
+
+
+
+ :/pqWidgets/Icon/pq/pqApply.png:/pqWidgets/Icon/pq/pqApply.png
+
+
+ true
+
+
+
+ -
+
+
+ Resets any changed properties to their values from the last time 'Apply' was clicked.
+
+
+ Reset
+
+
+
+ :/pqWidgets/Icon/pq/pqCancel.png:/pqWidgets/Icon/pq/pqCancel.png
+
+
+
+ -
+
+
+ Delete
+
+
+
+ :/pqWidgets/Icon/pq/pqDelete.png:/pqWidgets/Icon/pq/pqDelete.png
+
+
+
+
+
+ -
+
+
+
-
+
+
+ Select font
+
+
+ QComboBox::AdjustToContents
+
+
+ 2
+
+
+
+ -
+
+
+ Set font size
+
+
+ 1
+
+
+
+ -
+
+
+ true
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ Set font opacity
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+
+ -
+
+
+ Bold
+
+
+ ...
+
+
+
+ :/pqWidgets/Icon/pq/pqBold24.png:/pqWidgets/Icon/pq/pqBold24.png
+
+
+ true
+
+
+
+ -
+
+
+ Italics
+
+
+ ...
+
+
+
+ :/pqWidgets/Icon/pq/pqItalics24.png:/pqWidgets/Icon/pq/pqItalics24.png
+
+
+ true
+
+
+
+ -
+
+
+ Shadow
+
+
+ ...
+
+
+
+ :/pqWidgets/Icon/pq/pqShadow24.png:/pqWidgets/Icon/pq/pqShadow24.png
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/form/pqVCRToolbar.ui b/src/form/pqVCRToolbar.ui
new file mode 100644
index 0000000..7b41945
--- /dev/null
+++ b/src/form/pqVCRToolbar.ui
@@ -0,0 +1,101 @@
+
+
+ VCRToolbar
+
+
+
+ 0
+ 0
+ 250
+ 40
+
+
+
+
+ 250
+ 40
+
+
+
+ VCR Controls
+
+
+ Qt::Horizontal
+
+
+ true
+
+
+
+ false
+
+
+
+ :/pqWidgets/Icon/pq/pqVcrPlay.png:/pqWidgets/Icon/pq/pqVcrPlay.png
+
+
+ &Play
+
+
+
+
+ false
+
+
+
+ :/pqWidgets/Icon/pq/pqVcrBack.png:/pqWidgets/Icon/pq/pqVcrBack.png
+
+
+ Pre&vious Frame
+
+
+ true
+
+
+
+
+ false
+
+
+
+ :/pqWidgets/Icon/pq/pqVcrFirst.png:/pqWidgets/Icon/pq/pqVcrFirst.png
+
+
+ &First Frame
+
+
+
+
+ false
+
+
+
+ :/pqWidgets/Icon/pq/pqVcrForward.png:/pqWidgets/Icon/pq/pqVcrForward.png
+
+
+ &Next Frame
+
+
+
+
+ false
+
+
+
+ :/pqWidgets/Icon/pq/pqVcrLast.png:/pqWidgets/Icon/pq/pqVcrLast.png
+
+
+ &Last Frame
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/include/QDicomViewer.h b/src/include/QDicomViewer.h
new file mode 100644
index 0000000..2f4c544
--- /dev/null
+++ b/src/include/QDicomViewer.h
@@ -0,0 +1,83 @@
+#pragma once
+#include
+#include "ui_QDicomViewer.h"
+#include "importwidget.h"
+#include
+#include "exportdialog.h"
+#include "Customwindow.h"
+#include "pqFontPropertyWidget.h"
+
+class QDicomViewer : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+
+ explicit QDicomViewer(QWidget *parent = Q_NULLPTR);
+ ~QDicomViewer();
+
+
+public slots:
+ void Slot_ToolbarVisibilityChanged(bool);
+ void openDICOMFromPACS(int,std::string);
+private:
+ Ui::QDicomViewerClass *ui;
+
+ void loadStyleSheet(const QString &sheetName);
+ void Initial();
+ void createToolButton();
+
+ void SetupFileTool(QToolButton* fileBtn);
+ void SetupImportTool(QToolButton* importBtn);
+ void SetupExportTool(QToolButton *saveBtn);
+
+ void SetupGridTool(QToolButton *gridBtn);
+ void SetupSyncTool(QToolButton *syncBtn);
+ void SetupAnnoTool(QToolButton *annoBtn);
+
+ void SetupSliceTool(QToolButton* sliceBtn);
+ void SetupAdjustTool(QToolButton *winlevelBtn);
+ void SetupPanTool(QToolButton* panBtn);
+ void SetupZoomTool(QToolButton* zoomBtn);
+ void SetupMeasureTool(QToolButton *measureBtn);
+
+ void SetupFlipTool(QToolButton *flipBtn);
+ void SetupFusionTool(QToolButton* fusionBtn);
+ void SetupCineTool(QToolButton* cineBtn);
+ void SetupEmptyTool(QToolButton* emptyBtn);
+
+
+ void SetupFullScreenTool(QToolButton *btnfullscreen);
+ void SetupMaximizeTool(QToolButton *btnmaximize);
+ void SetupMinimizeTool(QToolButton *btnminimize);
+ void SetupCloseTool(QToolButton *btnclose);
+
+
+ void displayThumbnailBar(bool value);
+ void drawDICOM(const std::string &dicomName, SeriesOpenMode openMode);
+ void setConnections();
+ void executeActiveMeasure(ViewContainerWidget *Container, AnnotationActorType annType);
+ void createVCRToolbar(DicomImageView *v);
+
+ QIcon icon_manual;
+ QIcon icon_auto;
+ QIcon icon_dis;
+ QAction *m_sync_item_action[SYNC_ITEM_NUM];
+ QAction* m_sync_state_action;
+ QAction* m_measure_hidden_action;
+ QAction* m_patient_hidden_action;
+ QAction* m_preview_display_action;
+
+ int act_num_of_close;
+ int act_num_of_maximize;
+ int act_num_of_fullscreen;
+ int act_num_of_minimize;
+
+ ExportDialog *exportDialog = nullptr;
+ ImportWidget *m_import =nullptr;
+ QSettings m_qs;
+ Customwindow *m_customwin =nullptr;
+
+ AnnotationActorType m_cur_measure = AnnotationActorType::RulerAnn;
+
+};
diff --git a/src/include/base/DicomLoader.h b/src/include/base/DicomLoader.h
new file mode 100644
index 0000000..81cea6b
--- /dev/null
+++ b/src/include/base/DicomLoader.h
@@ -0,0 +1,86 @@
+#pragma once
+#include "global/include_all.h"
+#include "global/include_vitk.h"
+
+using namespace std;
+typedef std::map> OrienMapType;
+class OrienHelper
+{
+public:
+ static std::string StringFilter(char* str);
+ static void init();
+ static std::vector* getOrienStrList(const std::string &index);
+ static OrienMapType orien_map;
+};
+
+class SeriesInstance;
+
+
+
+
+
+class DicomLoader {
+public:
+
+ static DicomLoader *GetInstance();
+
+
+ static void itkReaderProCallbackFunction_FILE(itk::ProcessObject* obj, const itk::ProgressEvent&, void* data);
+ static void itkReaderProCallbackFunction_DIR(itk::ProcessObject* obj, const itk::ProgressEvent&, void* data);
+ static void itkReaderEndCallbackFunction(itk::ProcessObject* obj, const itk::ProgressEvent&, void* data);
+
+
+ DicomTagInfo_t* createDicomTagsInfo();
+ void ItkPreReadSeries(const std::string &dicomName, SeriesOpenMode openMode);
+ UniqueIDInfo_t* createUniqueID(const std::string &dicomName, SeriesOpenMode openMode);
+ bool IsDuplicate(UniqueIDInfo_t* unique);
+ SeriesInstance* createSeries(UniqueIDInfo_t* uniqueID, DicomTagInfo_t* tag_info,
+ vtkGenericOpenGLRenderWindow* gl_rewin, bool copy = false);
+ AddDicomType getAddDicomType()const
+ {
+ return m_addType;
+ }
+ const PatientsMapType &getPatientsList()
+ {
+ return m_patients;
+ }
+
+
+ //if not duplicate
+ void InitFromRead(SeriesInstance* instance);// , DicomTagInfo_t* tag_info);
+ void InitFromCopy(SeriesInstance* instance);
+
+
+ bool deleteSeriesInstance(SeriesInstance* old);
+ SeriesInstance* addSeriesInstance(SeriesInstance* instance, bool copy =false);
+
+ SeriesInfo_t* getSerieInfo(const UniqueIDInfo &uniqueID);
+ SeriesInstance* getFirstInstance(const UniqueIDInfo &uniqueID);
+ InstancesVecType* getInstancesVec(const UniqueIDInfo &uniqueID);
+ //for export use
+ void getOpenedInstancesVec(InstancesVecType& retVec);
+
+ //void deleteSeriesInstance(SeriesInstance* instance,bool from_map = true);
+ void deleteInstanceFromMap(UniqueIDInfo uniqueID);
+ void setDirObservers(void* client);
+ void setFileObservers(void* client);
+
+private:
+ explicit DicomLoader();
+ ~DicomLoader();
+ static DicomLoader *instance;
+ //void copyDicomTagsInfo(SeriesInstance* origin, SeriesInstance* copy);
+
+
+ //once
+ ConnectorType::Pointer m_itkConnector;
+ SeriesReaderType::Pointer m_itkSeriesReader;
+ ImageIOType::Pointer m_gdcmIO;
+ InputNamesGeneratorType::Pointer m_inputNames;
+
+
+ AddDicomType m_addType;
+ PatientsMapType m_patients;
+
+};
+
diff --git a/src/include/base/dicomviewerbase.h b/src/include/base/dicomviewerbase.h
new file mode 100644
index 0000000..379d109
--- /dev/null
+++ b/src/include/base/dicomviewerbase.h
@@ -0,0 +1,14 @@
+#ifndef _DICOM_VIEWER_BASE_H_
+#define _DICOM_VIEWER_BASE_H_
+
+#define SINGLETON_DEFINE(ClassName) \
+static ClassName& GetInstance() \
+{ \
+ static ClassName type_instance; \
+ return type_instance; \
+} \
+ \
+ClassName(const ClassName&) = delete; \
+ClassName& operator=(const ClassName&) = delete \
+
+#endif
diff --git a/src/include/base/dicomviewerhelper.h b/src/include/base/dicomviewerhelper.h
new file mode 100644
index 0000000..7fd5e63
--- /dev/null
+++ b/src/include/base/dicomviewerhelper.h
@@ -0,0 +1,59 @@
+锘#ifndef _DICOM_VIEWER_HELPER_H_
+#define _DICOM_VIEWER_HELPER_H_
+
+#include "dicomviewerbase.h"
+#include
+#include
+#include
+#include
+#include
+
+
+struct host {
+ QString name;
+ QString ae;
+ QString ip;
+ QString port;
+};
+
+
+class DicomViewerProductCfg
+{
+public:
+ SINGLETON_DEFINE(DicomViewerProductCfg);
+
+ QString ourTitle();
+ bool setOurTitle(QString ae);
+ QString ourPort();
+ bool setOurPort(QString port);
+ bool pacsInfo(QList& info);
+ bool setPacsInfo(QList& info);
+
+
+private:
+ DicomViewerProductCfg();
+ ~DicomViewerProductCfg();
+ bool loadcfg();
+ bool savecfg();
+private:
+ bool m_bLoaded;
+ QJsonDocument m_JsonDocument;
+ QJsonObject m_JsonRootObject;
+};
+
+
+class DicomViewerHelper
+{
+public:
+ static QString applicationPath();
+ static QString ourTitle();
+ static bool setOurTitle(QString ae);
+ static QString ourPort();
+ static bool setOurPort(QString port);
+ static bool pacsInfo(QList& info);
+ static bool setPacsInfo(QList& info);
+
+};
+
+
+#endif
diff --git a/src/include/base/dicomviewertype.h b/src/include/base/dicomviewertype.h
new file mode 100644
index 0000000..2220112
--- /dev/null
+++ b/src/include/base/dicomviewertype.h
@@ -0,0 +1,30 @@
+#ifndef _DICOMVIEWER_TYPE_H_
+#define _DICOMVIEWER_TYPE_H_
+
+#include
+
+struct PACSStudyInfo {
+ QString studyDate;
+ QString patientName;
+ QString patientID;
+ QString accessionNumber;
+ QString patientBirthDate;
+ QString patientSex;
+ QString patientAge;
+ QString studyInstanceUID;
+ QString studyID;
+ QString requestingPhysician;
+};
+
+struct PACSSeriesInfo {
+ QString patientName;
+ QString studyInstanceUID;
+ QString studyID;
+ QString seriesUID;
+ QString modality;
+ QString seriesNumber;
+};
+
+
+#endif // !_DICOMVIERER_TYPE_H_
+
diff --git a/src/include/base/infinitiViewer.h b/src/include/base/infinitiViewer.h
new file mode 100644
index 0000000..65cddc9
--- /dev/null
+++ b/src/include/base/infinitiViewer.h
@@ -0,0 +1,389 @@
+#ifndef infinitiViewer_h
+#define infinitiViewer_h
+
+#include "vtkInteractionImageModule.h" // For export macro
+#include "vtkObject.h"
+#include "vector"
+#include "QList"
+#include "DraggableActor.h"
+
+//for convert vtkEvent to Qt signal
+#include "vtkSignalRaiser.h"
+#include "RulerLegendActor.h"
+#include "QGlobals.h"
+
+class vtkAlgorithm;
+class vtkAlgorithmOutput;
+class vtkImageSlice;
+class vtkLookupTable;
+class vtkScalarsToColors;
+class vtkImageSliceMapper;
+class vtkImageData;
+class vtkInformation;
+class ActorDraggableInteractorStyle;
+class vtkRenderWindow;
+class vtkRenderer;
+class vtkRenderWindowInteractor;
+
+class MeasureStore;
+
+#define IN_TEST_MODE
+
+
+#ifdef IN_TEST_MODE
+class vtkScalarBarActor;
+#endif
+
+class vtkCornerAnnotation;
+class Measure;
+class infinitiViewer : public vtkObject
+{
+public:
+ static infinitiViewer* New();
+ vtkTypeMacro(infinitiViewer, vtkObject);
+ void PrintSelf(ostream& os, vtkIndent indent) override;
+
+
+ enum infinitiViewerEvents
+ {
+ SlicedEvent = vtkCommand::UserEvent + 500,
+ };
+
+ //vtkGetMacro(m_cornerAnnotation, vtkCornerAnnotation);
+ vtkCornerAnnotation* GetvtkCornerAnnotation()
+ {
+ return cornerAnnotation;
+ }
+ void updateCornerInfo(int index);
+ void updateCornerInfoAll();
+ void initCornerInfo(DicomTagInfo_t *pSeriesTags);
+ void updateOrienInfo(TransFormType type);
+ void setUpImageViewer();
+
+ //For Export
+ void initTopLeftCornerInfo(const std::string &lbl_ser_num, const std::string &SeriesNumber);
+ /**
+ * Get the name of rendering window.
+ */
+ virtual const char* GetWindowName();
+
+ /**
+ * Render the resulting image.
+ */
+ virtual void Render(void);
+
+ //@{
+ /**
+ * Set/Get the input image to the viewer.
+ */
+ virtual void SetInputData(vtkImageData* in);
+ virtual vtkImageData* GetInput();
+ virtual void SetInputConnection(vtkAlgorithmOutput* input);
+
+ //@}
+
+ /**
+ * Set/get the slice orientation
+ */
+
+ enum
+ {
+ SLICE_ORIENTATION_YZ = 0,
+ SLICE_ORIENTATION_XZ = 1,
+ SLICE_ORIENTATION_XY = 2
+ };
+
+ vtkGetMacro(SliceOrientation, int);
+ virtual void SetSliceOrientation(int orientation);
+
+ virtual void SetSliceOrientationToXY()
+ {
+ this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_XY);
+ }
+
+ virtual void SetSliceOrientationToYZ()
+ {
+ this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_YZ);
+ }
+
+ virtual void SetSliceOrientationToXZ()
+ {
+ this->SetSliceOrientation(infinitiViewer::SLICE_ORIENTATION_XZ);
+ }
+
+ //@{
+ /**
+ * Set/Get the current slice to display (depending on the orientation
+ * this can be in X, Y or Z).
+ */
+ virtual int GetSlice();
+ virtual void SetSlice(int s);
+ //@}
+
+ //@{
+ /**
+ * Return the minimum and maximum slice values (depending on the orientation
+ * this can be in X, Y or Z).
+ */
+ virtual int GetSliceMin();
+ virtual int GetSliceMax();
+ virtual void GetSliceRange(int range[2]) { this->GetSliceRange(range[0], range[1]); }
+ virtual void GetSliceRange(int& min, int& max);
+ virtual int* GetSliceRange();
+ //@}
+
+ //@{
+ /**
+ * Set window and level for mapping pixels to colors.
+ */
+ virtual double GetColorWindow();
+ virtual double GetColorLevel();
+ virtual void SetColorWindow(double s);
+ virtual void SetColorLevel(double s);
+ void SetNegativeMode(bool negative);
+ void SetLookupTable(vtkLookupTable *lut);
+ //@}
+
+ //@{
+ /**
+ * These are here when using a Tk window.
+ */
+ virtual void SetDisplayId(void* a);
+ virtual void SetWindowId(void* a);
+ virtual void SetParentId(void* a);
+ //@}
+
+ void SetZoomScale(double scale);
+ void SetPanOffset(double* point);
+ //@{
+ /**
+ * Get the position (x and y) of the rendering window in
+ * screen coordinates (in pixels).
+ */
+ virtual int* GetPosition() VTK_SIZEHINT(2);
+
+ /**
+ * Set the position (x and y) of the rendering window in
+ * screen coordinates (in pixels). This resizes the operating
+ * system's view/window and redraws it.
+ */
+ virtual void SetPosition(int x, int y);
+ virtual void SetPosition(int a[2]) { this->SetPosition(a[0], a[1]); }
+ //@}
+
+ //@{
+ /**
+ * Get the size (width and height) of the rendering window in
+ * screen coordinates (in pixels).
+ */
+ virtual int* GetSize() VTK_SIZEHINT(2);
+
+ /**
+ * Set the size (width and height) of the rendering window in
+ * screen coordinates (in pixels). This resizes the operating
+ * system's view/window and redraws it.
+ *
+ * If the size has changed, this method will fire
+ * vtkCommand::WindowResizeEvent.
+ */
+ virtual void SetSize(int width, int height);
+ virtual void SetSize(int a[2]) { this->SetSize(a[0], a[1]); }
+ //@}
+
+ //@{
+ /**
+ * Get the internal render window, renderer, image actor, and
+ * image map instances.
+ */
+ vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
+ vtkGetObjectMacro(Renderer, vtkRenderer);
+ vtkGetObjectMacro(ImageActor, vtkImageSlice);
+ vtkGetObjectMacro(ImageMapper, vtkImageSliceMapper);
+ vtkGetObjectMacro(InteractorStyle, ActorDraggableInteractorStyle);
+ //@}
+
+ //@{
+ /**
+ * Set your own renderwindow and renderer
+ */
+ virtual void SetRenderWindow(vtkRenderWindow* arg);
+ virtual void SetRenderer(vtkRenderer* arg);
+ //@}
+
+ /**
+ * Attach an interactor for the internal render window.
+ */
+ virtual void SetupInteractor(vtkRenderWindowInteractor*);
+
+ //@{
+ /**
+ * Create a window in memory instead of on the screen. This may not
+ * be supported for every type of window and on some windows you may
+ * need to invoke this prior to the first render.
+ */
+ virtual void SetOffScreenRendering(vtkTypeBool);
+ virtual vtkTypeBool GetOffScreenRendering();
+ vtkBooleanMacro(OffScreenRendering, vtkTypeBool);
+ //@}
+
+
+ vtkGetMacro(Fusion, vtkTypeBool);
+ vtkSetMacro(Fusion, vtkTypeBool);
+ //@{
+ /**
+ * Fusion On and Off,if fusion is on ,the renderer will try to show Fusion Data,
+ * which need to be set with SetFusionInputData function. Without SetFusionInputData,
+ * there will no Fusion Data show.
+ */
+ vtkBooleanMacro(Fusion, vtkTypeBool);
+ //@}
+
+ //@{
+ /**
+ * Fusion Opacity, default is 0.5
+ */
+ vtkGetMacro(FusionOpacity, double);
+ //@}
+ void SetFusionOpacity(double);
+ void IncreFusionOpacity(double);
+ void SetScalarBarTitle(double);
+ //@{
+ /**
+ * Set a imageData to fusion with current rendered image.
+ */
+ void SetFusionInputData(vtkImageData*);
+ //@}
+
+ //@{
+ /**
+ * Set color level for fusion lookupTable, only will take effect after SetFusionInputData.
+ */
+ void SetFusionColorLeveL(double level);
+ //@}
+
+ //@{
+ /**
+ * Set color window for fusion lookupTable, only will take effect after SetFusionInputData.
+ */
+ void SetFusionColorWindow(double window);
+ //@}
+
+ //@{
+ /**
+ * Set a ColorTable for fusion, only will take effect after SetFusionInputData.
+ */
+ void SetFusionColorTable(vtkScalarsToColors*);
+ //@}
+ //@{
+ /**
+ * Set a Preset ColorTable for fusion, only will take effect after SetFusionInputData.
+ */
+ void SetFusionColorPreset(const char *preset);
+ //@}
+ //@}
+ //@{
+ /**
+ * Switch fusion color-table to next Preset
+ */
+ void SwitchToNextPreset();
+ //@}
+ //
+ //@{
+ /**
+ * Remove fusion from viewer
+ */
+ void RemoveFusionData();
+ //@}
+
+ //@{
+ /**
+ * Remove fusion actor from viewer
+ */
+ void RemoveFusionActor();
+
+ void DeleteSelectedMeasure();
+ void DeleteCurrentSliceMeasure();
+ void DeleteCurrentSeriesMeasure();
+
+ void ActiveMeasure(Measure* m);
+ void UnActiveMeasure();
+
+ //for convert vtkEvent to Qt signal
+ vtkSignalRaiser* GetSignalRaiser(){
+ return &raiser;
+ }
+
+protected:
+ infinitiViewer();
+ ~infinitiViewer() override;
+
+ virtual void InstallPipeline();
+ virtual void UnInstallPipeline();
+ virtual void PrepareFusionColorTable(vtkScalarsToColors* table, bool reset = false);
+
+ vtkRenderWindow* RenderWindow;
+ vtkRenderer* Renderer;
+ vtkImageSlice* ImageActor;
+ vtkImageSlice* FusionActor;
+ vtkImageSliceMapper* ImageMapper;
+ vtkImageSliceMapper* FusionMapper;
+ vtkRenderWindowInteractor* Interactor;
+ ActorDraggableInteractorStyle* InteractorStyle;
+ vtkTextActor* OpacityActor;
+ vtkCornerAnnotation* cornerAnnotation;
+
+ #ifdef IN_TEST_MODE
+ vtkScalarBarActor* bar;
+ #endif
+
+ int SliceOrientation;
+ int FirstRender;
+ int Slice;
+ int loadedMeasureSlice;
+
+ vtkTypeBool Fusion = false;
+ vtkTypeBool firstFusion = true;
+ double FusionOpacity = 0.5;
+
+
+ virtual void UpdateOrientation();
+ vtkAlgorithm* GetInputAlgorithm();
+ vtkInformation* GetInputInformation();
+ void LoadMeasures(){
+ LoadMeasures(false);
+ }
+ void LoadMeasures(bool forceReload);
+ void AddMeasures(vtkObject*,unsigned long eventid,void* calldata );
+ void RemoveMeasures(vtkObject*,unsigned long eventid,void* calldata );
+
+private:
+
+ void updateTopLeftCornerInfo();
+
+
+
+ infinitiViewer(const infinitiViewer&) = delete;
+ void operator=(const infinitiViewer&) = delete;
+ std::vector> fusion_tf_vector;
+ //for convert vtkEvent to Qt signal
+ vtkSignalRaiser raiser;
+
+ QList* list = nullptr;
+ MeasureStore* measureStore;
+
+ void raiseEvent(vtkObject* sender,unsigned long eventId,void* callData = nullptr){
+ raiser.raiseEvent(sender,eventId,callData);
+ }
+
+ void ClearCurrentSliceMeasure() const;
+
+ void ReloadCurrentSliceMeasure();
+ vtkNew ruler;
+ void RenderRuler();
+ int currentPresetIndex=1;
+
+ DicomCornerInfo m_cornerInfo;
+ char SOP_UID[20];
+};
+
+#endif
diff --git a/src/include/base/seriesinstance.h b/src/include/base/seriesinstance.h
new file mode 100644
index 0000000..efbea17
--- /dev/null
+++ b/src/include/base/seriesinstance.h
@@ -0,0 +1,106 @@
+锘#pragma once
+#include "global/include_all.h"
+#include "global/include_vitk.h"
+#include "global/QGlobals.h"
+#include "ActorDraggableInteractorStyle.h"
+//#include "QVTKWidget.h"
+#include
+
+class myQVTKOpenGLNativeWidget;
+class DicomLoader;
+
+class SeriesInstance :public QObject
+{
+ Q_OBJECT
+ friend class DicomLoader;
+
+public:
+
+ SeriesInstance::SeriesInstance(UniqueIDInfo_t* uniqueID, DicomTagInfo_t* tag_info,
+ vtkGenericOpenGLRenderWindow* glrenWin);
+ ~SeriesInstance();
+
+
+ void setUpSeriesInstance();
+
+ //UniqueID
+ UniqueIDInfo_t* getUniqueID()const {
+ return m_pUniqueID;
+ };
+ SeriesOpenMode getSerirsOpenMode() const
+ {
+ return m_pUniqueID->open_mode;
+ };
+ const char* getCurImageName()const;
+ const char* getCurSeriesName() const;
+
+
+ //SeriesTags
+ DicomTagInfo_t* getDicomTagInfo()const
+ {
+ return m_pSeriesTags;
+ }
+ int GetSeriesNumber()const
+ {
+ return atoi(m_pSeriesTags->m_SeriesNumber.c_str());
+ }
+
+ infinitiViewer* getImageViewer2()
+ {
+ return m_imageViewer;
+ }
+
+ //image data
+ QPixmap GetPixmap();
+ vtkImageData* GetData()
+ {
+ return m_image;
+ };
+
+
+ //camera config
+ double GetExtent()
+ {
+ return m_extent;
+ }
+ void getCameraCfg(double *vup, double *camPos)
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ vup[i] = m_vup[i];
+ camPos[i] = m_cameraPosition[i];
+ }
+ }
+
+//protected:
+// vtkNew m_imageViewer;
+// vtkNew m_image;
+
+
+private:
+ QSize labelSizeHint() const {
+ return QSize(image_label_size, image_label_size);
+ }
+ QImage vtkImageDataToQImage(vtkImageData* imageData);
+
+
+ vtkSmartPointer m_glrenWin;
+
+
+
+ vtkSmartPointer m_imageViewer;
+ vtkSmartPointer m_image;
+ //vtkSmartPointer m_overlap;
+
+ FileNamesContainerType m_fileNames;
+
+ DicomTagInfo_t* m_pSeriesTags;
+ UniqueIDInfo_t* m_pUniqueID;
+
+
+ static qint32 image_label_size;
+
+ double m_extent;
+ double m_cameraPosition[3];
+ double m_vup[3];
+};
diff --git a/src/include/callback/callbackhelper.h b/src/include/callback/callbackhelper.h
new file mode 100644
index 0000000..986fdf7
--- /dev/null
+++ b/src/include/callback/callbackhelper.h
@@ -0,0 +1,30 @@
+#ifndef _CALLBACKHELPER_H_
+#define _CALLBACKHELPER_H_
+
+#include
+
+class DcmDataset;
+
+// A helper class which connect callback and uppper Qt application through signal/slot
+
+class CallbackHelper : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit CallbackHelper(QObject *parent = Q_NULLPTR);
+ ~CallbackHelper();
+
+ void foundResult(int index, DcmDataset *response);
+ void moveProgress(int progress, int total);
+ void moveStoreProgress(int code, std::string filename);
+
+
+signals:
+ void sig_foundResult(int index, DcmDataset *response);
+ void sig_moveProgress(int progress, int total);
+ void sig_moveStoreProgress(int code, std::string filename);
+
+};
+
+#endif // !_CALLBACKHELPER_H_
diff --git a/src/include/callback/cfindcallback.h b/src/include/callback/cfindcallback.h
new file mode 100644
index 0000000..9c2e961
--- /dev/null
+++ b/src/include/callback/cfindcallback.h
@@ -0,0 +1,21 @@
+#ifndef _CFIND_CALLBACK_H_
+#define _CFIND_CALLBACK_H_
+
+#include "dcm_find.h"
+#include "callbackhelper.h"
+
+class CFindCallback : public dcm_cfind_callback
+{
+
+public:
+ CFindCallback();
+ virtual ~CFindCallback();
+ virtual void callback(T_DIMSE_C_FindRQ *request, int &responseCount, T_DIMSE_C_FindRSP *rsp, DcmDataset *responseIndentifiers);
+
+ void setHelper(CallbackHelper *h);
+
+private:
+ CallbackHelper *CFindCallbackHelper;
+};
+
+#endif
diff --git a/src/include/callback/cmovecallback.h b/src/include/callback/cmovecallback.h
new file mode 100644
index 0000000..6fa4567
--- /dev/null
+++ b/src/include/callback/cmovecallback.h
@@ -0,0 +1,24 @@
+#ifndef _CMOVE_CALLBACK_H_
+#define _CMOVE_CALLBACK_H_
+
+#include "dcm_move.h"
+#include "callbackhelper.h"
+
+class CMoveCallback : public dcm_cmove_callback
+{
+
+public:
+ CMoveCallback();
+ ~CMoveCallback();
+
+ virtual void callback(T_DIMSE_C_MoveRQ *request, int responseCount, T_DIMSE_C_MoveRSP *response);
+
+ void setHelper(CallbackHelper *helper);
+
+private:
+ CallbackHelper *CMoveCallbackHelper;
+};
+
+
+#endif // !_CMOVE_CALLBACK_H_
+
diff --git a/src/include/callback/cmovestorescpcallback.h b/src/include/callback/cmovestorescpcallback.h
new file mode 100644
index 0000000..4887d01
--- /dev/null
+++ b/src/include/callback/cmovestorescpcallback.h
@@ -0,0 +1,27 @@
+#ifndef _CMOVE_STORESCP_CALLBACK_H_
+#define _CMOVE_STORESCP_CALLBACK_H_
+
+#include "dcm_move.h"
+#include "callbackhelper.h"
+
+class CMoveStoreSCPCallback : public dcm_cmove_storescp_callback
+{
+
+public:
+ CMoveStoreSCPCallback(std::string outDirectory);
+ ~CMoveStoreSCPCallback();
+
+ virtual void callback(T_DIMSE_StoreProgress *progress, T_DIMSE_C_StoreRQ *request, char *imageFileName, DcmDataset **imageDataSet, T_DIMSE_C_StoreRSP *response, DcmDataset **statusDetail);
+
+ void setHelper(CallbackHelper *helper);
+
+private:
+ CallbackHelper *CMoveStoreScpCallbackHelper;
+ std::string outDirectory_;
+
+};
+
+
+
+#endif // !_CMOVE_STORESCP_CALLBACK_H_
+
diff --git a/src/include/cine/pqVCRController.h b/src/include/cine/pqVCRController.h
new file mode 100644
index 0000000..339071e
--- /dev/null
+++ b/src/include/cine/pqVCRController.h
@@ -0,0 +1,83 @@
+/*=========================================================================
+
+ Program: ParaView
+ Module: pqVCRController.h
+
+ Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
+ All rights reserved.
+
+ ParaView is a free software; you can redistribute it and/or modify it
+ under the terms of the ParaView license version 1.2.
+
+ See License_v1.2.txt for the full ParaView license.
+ A copy of this license can be obtained by contacting
+ Kitware Inc.
+ 28 Corporate Drive
+ Clifton Park, NY 12065
+ USA
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================*/
+
+#ifndef _pqVCRController_h
+#define _pqVCRController_h
+
+//#include "pqComponentsModule.h"
+#include
+#include
+#include
+#include "DicomImageView.h"
+// pqVCRController is the QObject that encapsulates the
+// VCR control functionality.
+// It provides a slot to set the scene that this object
+// is using for animation. Typically, one would connect this
+// slot to a pqAnimationManager like object which keeps track
+// of the active animation scene.
+class pqVCRController : public QObject
+{
+ Q_OBJECT
+public:
+ pqVCRController(QObject* parent = nullptr,DicomImageView* v = nullptr);
+ ~pqVCRController() override;
+Q_SIGNALS:
+ //void playing(bool);
+ //void timeRanges(double, double);
+
+ void tick();
+ void Signal_OnPlaying(bool);
+ void Signal_FPS(int);
+
+public Q_SLOTS:
+ // Connect these signals to appropriate VCR buttons.
+ void reConnect();
+ void onFirstFrame();
+ void onPreviousFrame();
+ void onNextFrame();
+ void onLastFrame();
+ void onPlay(int fps);
+ void onPause();
+
+private Q_SLOTS :
+ void onTick();
+
+
+private:
+ Q_DISABLE_COPY(pqVCRController)
+ QTimer *m_timer;
+ bool m_cplaying = false;
+ int m_cfps = 10;
+ DicomImageView *m_view =nullptr;
+};
+
+#endif
diff --git a/src/include/cine/pqVCRToolbar.h b/src/include/cine/pqVCRToolbar.h
new file mode 100644
index 0000000..f8ca990
--- /dev/null
+++ b/src/include/cine/pqVCRToolbar.h
@@ -0,0 +1,59 @@
+
+#ifndef pqVCRToolbar_h
+#define pqVCRToolbar_h
+#include
+#include
+#include "pqVCRController.h"
+#include "ui_pqVCRToolbar.h"
+#include
+#include
+namespace Ui {
+ class VCRToolbar;
+}
+
+/**
+* pqVCRToolbar is the toolbar with VCR controls.
+* Simply instantiate this and put it in your application UI file or
+* QMainWindow to use it.
+*/
+class DicomImageView;
+class pqVCRToolbar : public QToolBar
+{
+ Q_OBJECT
+public:
+ explicit pqVCRToolbar(QWidget *parent = Q_NULLPTR);
+ ~pqVCRToolbar();
+ void reConnectController(pqVCRController *ctrl);
+
+public Q_SLOTS:
+ void setImageView(DicomImageView*);
+ //virtual void setVisible(bool visible);
+
+Q_SIGNALS:
+ void Signal_Onplay(int);
+ void Signal_OnPause();
+
+private Q_SLOTS:
+ void VCRPlay();
+ void onPlaying(bool);
+ void setEnabled(bool);
+ void loadFPS(int);
+ void setFPS(int);
+ void Display();
+
+
+private:
+
+ pqVCRController* Controller =nullptr;
+ Ui::VCRToolbar ui;
+ QSpinBox *spin_fps;
+ //QLineEdit *led_display;
+
+ bool m_playing = false;
+ int m_fps =10;
+ int slice_num = 0;
+
+
+};
+
+#endif
diff --git a/src/include/dialog/promptdialog.h b/src/include/dialog/promptdialog.h
new file mode 100644
index 0000000..bdac49a
--- /dev/null
+++ b/src/include/dialog/promptdialog.h
@@ -0,0 +1,57 @@
+#ifndef _PROMPT_DIALOG_H_
+#define _PROMPT_DIALOG_H_
+
+#include
+#include
+#include
+
+class QVBoxLayout;
+class QHBoxLayout;
+class QLabel;
+class QPushButton;
+class QSpacerItem;
+
+class PromptDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit PromptDialog(QWidget *parent = Q_NULLPTR);
+ PromptDialog(const QString& msg, QWidget *parent = Q_NULLPTR);
+ ~PromptDialog();
+
+ void setMsg(const QString& msg);
+
+public slots:
+ void close();
+
+ void onTitleBarDestroyed();
+
+protected:
+ virtual bool eventFilter(QObject *obj, QEvent *event);
+
+private:
+ void initUi();
+ void initSys();
+
+private:
+ QVBoxLayout *m_pMainLayout;
+ QWidget *m_pTitleBar;
+ QWidget *m_pMsgWidget;
+ QHBoxLayout *m_pMsgLayout;
+ QLabel *m_pMsgLabel;
+ QWidget *m_pActionWidget;
+ QHBoxLayout *m_pActionLayout;
+ QSpacerItem *m_pActionSpacerItem;
+ QPushButton *m_pConfirmButton;
+
+private:
+ struct
+ {
+ bool dragging;
+ QPoint dragStartPosition;
+ } m_dragState;
+};
+
+#endif // !_PROMPT_DIALOG_H_
+
diff --git a/src/include/dialog/promptdialogtitlebar.h b/src/include/dialog/promptdialogtitlebar.h
new file mode 100644
index 0000000..1cebbf1
--- /dev/null
+++ b/src/include/dialog/promptdialogtitlebar.h
@@ -0,0 +1,38 @@
+#ifndef _PROMPT_DIALOG_TITLEBAR_H_
+#define _PROMPT_DIALOG_TITLEBAR_H_
+
+#include
+
+class QHBoxLayout;
+class QLabel;
+class QPushButton;
+class QSpacerItem;
+
+class PromptTitleBar : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit PromptTitleBar(QWidget *parent = Q_NULLPTR);
+ ~PromptTitleBar();
+
+ void setTitleText(const QString& title);
+
+
+signals:
+ void sigClose();
+
+private:
+ void initUi();
+ void initSys();
+
+private:
+ QHBoxLayout *m_pMainLayout;
+ QLabel *m_pLogoLabel;
+ QLabel *m_pTitleLabel;
+ QSpacerItem *m_pSpacerItem;
+ QPushButton *m_pCloseButton;
+};
+
+#endif // !_PROMPT_DIALOG_TITLEBAR_H_
+
diff --git a/src/include/dialog/qxtspanslider.h b/src/include/dialog/qxtspanslider.h
new file mode 100644
index 0000000..eaee4d6
--- /dev/null
+++ b/src/include/dialog/qxtspanslider.h
@@ -0,0 +1,112 @@
+#ifndef QXTSPANSLIDER_H
+/****************************************************************************
+** Copyright (c) 2006 - 2011, the LibQxt project.
+** See the Qxt AUTHORS file for a list of authors and copyright holders.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+** * Neither the name of the LibQxt project nor the
+** names of its contributors may be used to endorse or promote products
+** derived from this software without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+*****************************************************************************/
+
+#define QXTSPANSLIDER_H
+
+#include
+#include
+
+//#include "qxtnamespace.h"
+//#include "qxtglobal.h"
+
+class QxtSpanSliderPrivate;
+
+class QxtSpanSlider : public QSlider {
+ Q_OBJECT
+
+ //QXT_DECLARE_PRIVATE(QxtSpanSlider)
+ Q_PROPERTY(int lowerValue READ lowerValue WRITE setLowerValue)
+ Q_PROPERTY(int upperValue READ upperValue WRITE setUpperValue)
+ Q_PROPERTY(int lowerPosition READ lowerPosition WRITE setLowerPosition)
+ Q_PROPERTY(int upperPosition READ upperPosition WRITE setUpperPosition)
+ Q_PROPERTY(HandleMovementMode handleMovementMode READ handleMovementMode WRITE setHandleMovementMode)
+ Q_ENUMS(HandleMovementMode)
+
+public:
+ explicit QxtSpanSlider(QWidget* parent = 0);
+ explicit QxtSpanSlider(Qt::Orientation orientation, QWidget* parent = 0);
+ virtual ~QxtSpanSlider();
+
+ enum HandleMovementMode
+ {
+ FreeMovement,
+ NoCrossing,
+ NoOverlapping
+ };
+
+ enum SpanHandle
+ {
+ NoHandle,
+ LowerHandle,
+ UpperHandle
+ };
+
+ HandleMovementMode handleMovementMode() const;
+ void setHandleMovementMode(HandleMovementMode mode);
+
+ int lowerValue() const;
+ int upperValue() const;
+
+ int lowerPosition() const;
+ int upperPosition() const;
+
+public Q_SLOTS:
+ void setLowerValue(int lower);
+ void setUpperValue(int upper);
+ void setSpan(int lower, int upper);
+
+ void setLowerPosition(int lower);
+ void setUpperPosition(int upper);
+
+Q_SIGNALS:
+ void spanChanged(int lower, int upper);
+ void lowerValueChanged(int lower);
+ void upperValueChanged(int upper);
+
+ void lowerPositionChanged(int lower);
+ void upperPositionChanged(int upper);
+
+ void sliderPressed(SpanHandle handle);
+
+protected:
+ virtual void keyPressEvent(QKeyEvent* event);
+ virtual void mousePressEvent(QMouseEvent* event);
+ virtual void mouseMoveEvent(QMouseEvent* event);
+ virtual void mouseReleaseEvent(QMouseEvent* event);
+ virtual void paintEvent(QPaintEvent* event);
+
+private:
+ QxtSpanSliderPrivate* d_ptr;
+ friend class QxtSpanSliderPrivate;
+
+};
+
+#endif // QXTSPANSLIDER_H
diff --git a/src/include/dialog/qxtspanslider_p.h b/src/include/dialog/qxtspanslider_p.h
new file mode 100644
index 0000000..f960efa
--- /dev/null
+++ b/src/include/dialog/qxtspanslider_p.h
@@ -0,0 +1,84 @@
+#ifndef QXTSPANSLIDER_P_H
+/****************************************************************************
+** Copyright (c) 2006 - 2011, the LibQxt project.
+** See the Qxt AUTHORS file for a list of authors and copyright holders.
+** All rights reserved.
+**
+** Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in the
+** documentation and/or other materials provided with the distribution.
+** * Neither the name of the LibQxt project nor the
+** names of its contributors may be used to endorse or promote products
+** derived from this software without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+** DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+*****************************************************************************/
+
+#define QXTSPANSLIDER_P_H
+
+#include
+#include
+#include "qxtspanslider.h"
+
+QT_FORWARD_DECLARE_CLASS(QStylePainter)
+QT_FORWARD_DECLARE_CLASS(QStyleOptionSlider)
+
+class QxtSpanSliderPrivate : public QObject {
+ Q_OBJECT
+public:
+ QxtSpanSliderPrivate();
+ void initStyleOption(QStyleOptionSlider* option, QxtSpanSlider::SpanHandle handle = QxtSpanSlider::UpperHandle) const;
+ int pick(const QPoint& pt) const
+ {
+ return q_ptr->orientation() == Qt::Horizontal ? pt.x() : pt.y();
+ }
+ int pixelPosToRangeValue(int pos) const;
+ void handleMousePress(const QPoint& pos, QStyle::SubControl& control, int value, QxtSpanSlider::SpanHandle handle);
+ void drawHandle(QStylePainter* painter, QxtSpanSlider::SpanHandle handle) const;
+ void setupPainter(QPainter* painter, Qt::Orientation orientation, qreal x1, qreal y1, qreal x2, qreal y2) const;
+ void drawSpan(QStylePainter* painter, const QRect& rect) const;
+ void triggerAction(QAbstractSlider::SliderAction action, bool main);
+ void swapControls();
+
+ int lower;
+ int upper;
+ int lowerPos;
+ int upperPos;
+ int offset;
+ int position;
+ QxtSpanSlider::SpanHandle lastPressed;
+ QxtSpanSlider::SpanHandle mainControl;
+ QStyle::SubControl lowerPressed;
+ QStyle::SubControl upperPressed;
+ QxtSpanSlider::HandleMovementMode movement;
+ bool firstMovement;
+ bool blockTracking;
+
+
+public Q_SLOTS:
+ void updateRange(int min, int max);
+ void movePressedHandle();
+
+private:
+ QxtSpanSlider* q_ptr;
+ friend class QxtSpanSlider;
+
+
+};
+
+#endif // QXTSPANSLIDER_P_H
diff --git a/src/include/export/dicomexporter.h b/src/include/export/dicomexporter.h
new file mode 100644
index 0000000..b59fad5
--- /dev/null
+++ b/src/include/export/dicomexporter.h
@@ -0,0 +1,122 @@
+#ifndef DICOMEXPORTER_H
+#define DICOMEXPORTER_H
+
+#include
+#include "exportoptions.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include "base/infinitiViewer.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "itkMetaDataObject.h"
+#include "itkMetaDataDictionary.h"
+
+
+class DicomExporter : public QObject
+{
+ Q_OBJECT
+ enum FileType
+ {
+ SingleFile,
+ DirType,
+ NonType,
+
+ };
+public:
+ explicit DicomExporter(QObject *parent = nullptr);
+
+ void execute(ExportOptions options);
+
+signals:
+ void exportFinished();
+ void exportProgress(int total, int progress);
+
+public slots:
+
+
+private:
+ //dicom tags
+ const std::string TAG_WindowLevel = "0028|1050";
+ const std::string TAG_WindowWidth = "0028|1051";
+
+ //anonymization
+ const std::string TAG_InstitutionName = "0008|0080";
+ const std::string TAG_InstitutionAddress = "0008|0081";
+ const std::string TAG_ReferringPhysicianName = "0008|0090";
+ const std::string TAG_OperatorsName = "0008|1070";
+ const std::string TAG_PatientAddress = "0010|1040";
+ const std::string TAG_PatientTelephoneNumbers = "0010|2154";
+ const std::string TAG_OtherPatientNames = "0010|1001";
+ const std::string TAG_OtherPatientIDs = "0010|1000";
+ const std::string TAG_OtherPatientIDsSequence = "0010|1002";
+ const std::string TAG_PatientName = "0010|0010";
+ const std::string TAG_PatientBirthDate = "0010|0030";
+ const std::string TAG_PatientSex = "0010|0040";
+ const std::string TAG_PatientAge = "0010|1010";
+ const std::string TAG_PatientID = "0010|0020";
+ const std::string TAG_AccessionNumber = "0008|0050";
+
+ //bmp jpg png tiff exprt releated objects
+ static const unsigned int InputDimensionExport = 3;
+ typedef signed short PixelTypeExport;
+ typedef itk::Image InputImageTypeExport;
+ typedef itk::GDCMImageIO ImageIOTypeExport;
+ typedef itk::ImageSeriesReader SeriesReaderTypeExport;
+ typedef itk::ImageToVTKImageFilter ConnectorTypeExport;
+ typedef itk::GDCMSeriesFileNames InputNamesGeneratorTypeExport;
+
+ //dicom export releated objects
+ typedef signed short OutputPixelType;
+ static const unsigned int OutputDimension = 2;
+ typedef itk::Image Image2DType;
+ typedef itk::ImageSeriesWriter SeriesWriterType;
+
+private:
+ void initVTK();
+ void initDataReader();
+ void loadDicomFileAndRender(int file_type);
+ //void updateCornerInfo(int slice, int maxslice);
+ void doExport(int file_type);
+ QString getFileExtention();
+ void writeToFile(const QString& fileName);
+ void writeToPngFile(vtkSmartPointer windowToImageFilter, const QString& fileName);
+ void writeToBmpFile(vtkSmartPointer windowToImageFilter, const QString& fileName);
+ void writeToJpgFile(vtkSmartPointer windowToImageFilter, const QString& fileName);
+ void writeToTiffFile(vtkSmartPointer windowToImageFilter, const QString& fileName);
+ void exportPicture(const QString& fileName);
+ void exportDicom(const QString& fileName);
+ void exportSingleDicomFile(const QString& fileName);
+ void exportDicomDirectory(const QString& fileName);
+ void modifyDicomTags(SeriesReaderTypeExport::DictionaryArrayRawPointer dicArray);
+ void caculateExportTotalCount();
+
+private:
+ ExportOptions exportOptions;
+ int totalCount;//the total count of image to be exported
+ int exportedNumber;//the exported image index
+
+ //itk vtk releated objects
+ ImageIOTypeExport::Pointer m_gdcmIOExport;
+ SeriesReaderTypeExport::Pointer m_itkSeriesReaderExport;
+ ConnectorTypeExport::Pointer m_itkConnectorExport;
+ InputNamesGeneratorTypeExport::Pointer m_inputNamesExport;
+ vtkSmartPointer m_glrenWinExport;
+ vtkSmartPointer m_imageViewerExport;
+};
+
+#endif // DICOMEXPORTER_H
\ No newline at end of file
diff --git a/src/include/export/dicomexporterthread.h b/src/include/export/dicomexporterthread.h
new file mode 100644
index 0000000..f189fa2
--- /dev/null
+++ b/src/include/export/dicomexporterthread.h
@@ -0,0 +1,33 @@
+#ifndef DICOMEXPORTERTHREAD_H
+#define DICOMEXPORTERTHREAD_H
+
+#include
+#include
+#include "exportoptions.h"
+#include "dicomexporter.h"
+
+class DicomExporterThread : public QThread
+{
+ Q_OBJECT
+public:
+ explicit DicomExporterThread(ExportOptions options, QObject *parent = nullptr);
+
+signals:
+ void exportFinished();
+ void exportProgress(int total, int progress);
+
+public slots:
+
+protected:
+ virtual void run() override;
+
+//private:
+// void init();
+
+private:
+ ExportOptions exportOptions;
+ DicomExporter *exporter;
+
+};
+
+#endif // DICOMEXPORTERTHREAD_H
\ No newline at end of file
diff --git a/src/include/export/exportdialog.h b/src/include/export/exportdialog.h
new file mode 100644
index 0000000..bcfc4a6
--- /dev/null
+++ b/src/include/export/exportdialog.h
@@ -0,0 +1,47 @@
+#ifndef EXPORTDIALOG_H
+#define EXPORTDIALOG_H
+
+#include
+#include "exportoptions.h"
+#include "qdir.h"
+#include "dicomexporterthread.h"
+#include "QFileDialog"
+#include "DicomLoader.h"
+#include "dicomimageview.h"
+
+
+
+
+namespace Ui {
+class ExportDialog;
+}
+
+class ExportDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit ExportDialog(QWidget *parent = nullptr);
+ ~ExportDialog();
+ //void setCurSeries(SeriesInstance *serie);
+ //void setViewContainer(ViewContainerWidget *widget)
+ void setCurView(DicomImageView *view);
+
+public slots:
+ void onBtnExportClicked();
+ void onBtnCancelClicked();
+ void onBtnSelectFolderClicked();
+ void onExportProgress(int totalCount, int progress);
+ void onExportFinished();
+
+private:
+ void init();
+ void initUI();
+
+private:
+ Ui::ExportDialog *ui;
+ //ViewContainerWidget *viewContainerWidget;
+ DicomImageView *cur_view;
+};
+
+#endif // EXPORTDIALOG_H
diff --git a/src/include/export/exportoptions.h b/src/include/export/exportoptions.h
new file mode 100644
index 0000000..cbf1716
--- /dev/null
+++ b/src/include/export/exportoptions.h
@@ -0,0 +1,47 @@
+#ifndef EXPORTOPTIONS_H
+#define EXPORTOPTIONS_H
+
+#include
+#include
+#include
+
+class SeriesInstance;
+
+class ExportOptions
+{
+
+public:
+ explicit ExportOptions();
+
+ QList inputData;//the fileName or directory list to export
+
+ int windowWidth;//exported window width
+ int windowLevel;//exported window level
+
+ //export file format
+ enum FileFormat{Bmp, Jpeg, Png, Tiff, Dicom};
+ //corner annotation option
+ enum CornerAnnotation {Full, Basic, Disabled};
+ //Picture Size
+ enum PictureSize {Default, CurrentSize, CustomSize};
+
+ FileFormat exportFileFormat;
+
+ bool isAnonymization;//apply to export dicom file
+
+ CornerAnnotation cornerAnnotation;// apply to export picture file
+
+ QString exportDirectory;//the directory where file to export to
+
+ QString fileNamePrefix;//the prefix of each exported file names
+
+ bool isViewFilesWhenFinished;// whether to open directory when export finished
+
+ PictureSize pictureSizePolicy;//the size of exprted picture
+
+ QSize customPictureSize;//apply when user choose customsize
+
+ SeriesInstance *serie;
+};
+
+#endif // EXPORTOPTIONS_H
\ No newline at end of file
diff --git a/src/include/global/QGlobals.h b/src/include/global/QGlobals.h
new file mode 100644
index 0000000..d105d81
--- /dev/null
+++ b/src/include/global/QGlobals.h
@@ -0,0 +1,421 @@
+#pragma once
+#include
+#include
+#include
+#include
+#include
+#include "qevent.h"
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+using namespace std;
+
+// 软件版本
+#define Project_NAME "EquilibriumNine DicomViewer"
+#define Project_VER "1.0.0.0"
+
+//软件信息
+#define Project_OrganizationName "EquilibriumNine"
+#define Project_OrganizationDomain ""
+
+
+
+#define SYNC_MANUAL_URL ":/InfiniteViewer/Icon/sync/sync_manual.png"
+#define SYNC_AUTO_URL ":/InfiniteViewer/Icon/sync/sync_auto.png"
+#define SYNC_DIS_URL ":/InfiniteViewer/Icon/sync/sync_dis.png"
+
+#define CLOSE_URL ":/InfiniteViewer/Icon/close.png"
+#define MAX_URL ":/InfiniteViewer/Icon/max.png"
+
+
+const std::string COLOR_MAP_PATH = "./cfg/ColorMaps.json";
+const double scalarSensitivity = 4.0;
+
+
+
+class SeriesInstance;
+class thumbnailImage;
+
+enum DicomModality
+{
+ ReflMode = 1,
+ SosMode,
+ AttMode
+};
+
+enum CornerPos
+{
+ BOTTOM_LEFT,
+ BOTTOM_RIGHT,
+ TOP_LEFT,
+ TOP_RIGHT,
+ BOTTOM_MIDDLE,
+ RIGHT_MIDDLE,
+ LEFT_MIDDLE,
+ TOP_MIDDLE,
+ TOP_RIGHT_PRIVACY
+};
+
+enum TransFormType
+{
+ ROTATE_90_CCW,
+ ROTATE_90_CW,
+ ROTATE_180,
+ H_FLIP,
+ V_FLIP,
+ CLEAR
+};
+
+
+enum AnnotationActorType
+{
+ RulerAnn,
+ AngleAnn,
+ ClosedPolygonAnn,
+ OpenPolygonAnn,
+ ArrowAnn,
+ EllipseAnn,
+ TextAnn,
+ //HiddenAnn,
+ DeleteSelectedAnn,
+ DeleteSliceAnn,
+ DeleteSeriesAnn
+};
+
+
+namespace USER_CONFIG {
+ const QSize DEFAULT_TAG_WINDOW_SIZE(800, 600);
+ const std::string TAG_WINDOW_LEVEL = "0028|1050";
+ const std::string TAG_WINDOW_WIDTH = "0028|1051";
+ //const std::string TAG_IMAGE_ORIENTATION = "0020|0037";
+
+ //const std::string TAG_PATIANT_NAME = "0010|0010";
+ //const std::string TAG_STUDY_DESCRIPTION = "0008|1030";
+ const std::string TAG_SERIES_DESCRIPTION = "0008|103E";
+ //const std::string TAG_INSTITUTE_NAME = "0008|0080";
+ const std::string TAG_SERIES_NUMBER = "0020|0011";
+
+
+ //unique id
+ const std::string TAG_PATIENT_NAME = "0010|0010";
+ const std::string TAG_STUDY_UID = "0020|000D";
+ const std::string TAG_SERIES_UID = "0020|000E";
+
+ const std::string TAG_STUDY_TIME = "0008|0030";
+ const std::string TAG_INSTANCE_NUM = "0020|0013";
+ const std::string TAG_PATIANT_BIRTH = "0010|0030";
+ const std::string TAG_SLICE_NUM = "0054|0081";
+ const std::string TAG_PATIENT_ORIENTATION = "0020|0020";
+}
+
+#define CORNER_NUM 9
+typedef struct DicomCornerInfo
+{
+ int win_level;
+ int win_width;
+ std::string ConstAnno[CORNER_NUM];
+}DicomCornerInfo_t;
+
+
+
+
+enum SyncState
+{
+ AUTO_SYNC,
+ MANUAL_SYNC,
+ DIS_SYNC
+};
+
+enum SyncItem
+{
+ SLICE_POS,
+ ZOOM_PAN,
+ WIDTH_LEVEL
+};
+
+enum AddDicomType
+{
+ DUPLICATE_TYPE,
+ PATINET_LEVEL,
+ STUDY_LEVEL,
+ SERIES_LEVEL,
+ OVERRIDE_LEVEL
+ //OVERRIDE_SERIES,
+ //OVERRIDE_IMAGE
+};
+
+
+
+
+
+typedef struct DicomTasInfo
+{
+ int WL;
+ int WW;
+ double spacing[3];
+ std::string lbl_ser_num;
+
+ std::string m_dicomName;
+ std::string m_PatientName;
+ std::string m_PatientID;
+ std::string m_PatientBirth;
+ //std::string m_PatientDOB;
+ //std::string m_StudyID;
+ std::string m_StudyDescription;
+ std::string m_StudyDate;
+ std::string m_StudyTime;
+ std::string m_SeriesNumber;
+ std::string m_SeriesDescription;
+ std::string m_Modality;
+ std::string m_SliceNumber;
+
+ //std::string m_BodyPart;
+ //std::string m_NumberOfSeriesInStudy;
+ //std::string m_NumberOfStudyRelatedSeries;
+ //std::string m_PatientSex;
+ //std::string m_PatientAge;
+ //std::string m_StudyDate;
+ //std::string m_Modality;
+ //std::string m_Manufacturer;
+ std::string m_Institution;
+ //std::string m_Model;
+ //std::string m_ScanOptions;
+ std::string m_orientation;
+ //std::string m_StudyInstanceUID;
+ //std::string m_SeriesInstanceUID;
+
+}DicomTagInfo_t;
+
+
+
+enum SeriesOpenMode {
+ FILE_OPEN_MODE,
+ DIR_OPEN_MODE
+};
+
+typedef struct UniqueIDInfo
+{
+ std::string patient_name;
+ std::string study_uid;
+ std::string series_uid;
+ SeriesOpenMode open_mode;
+ std::string instance_num;
+ std::string dicom_name;
+ //std::string series_modality;
+}UniqueIDInfo_t;
+
+//typedef std::shared_ptr DicomTagInfo_t*;
+//typedef std::shared_ptr UniqueIDInfo_t*;
+
+namespace DicomUtil
+{
+ //not include open_mode
+ static bool EqualsUnique(const UniqueIDInfo &uid1, const UniqueIDInfo & uid2)
+ {
+ if (uid1.patient_name == uid2.patient_name &&
+ uid1.study_uid == uid2.study_uid &&
+ uid1.series_uid == uid2.series_uid) {
+ return true;
+ }
+ return false;
+ }
+}
+
+class FlipExportHelper
+{
+
+public:
+
+ static bool GetFlip()
+ {
+ return flip;
+ }
+ static void toggleFlip()
+ {
+ flip = !flip;
+ }
+
+private:
+ static bool flip;
+};
+
+class AnnoHelper
+{
+
+public:
+ static bool IsPrivacy()
+ {
+ return privacyOn;
+ }
+ static void PrivacyOn()
+ {
+ privacyOn = true;
+ }
+ static void PrivacyOff()
+ {
+ privacyOn = false;
+ }
+
+ static bool IsAnno()
+ {
+ return annotOn;
+ }
+ static void toggleAnno()
+ {
+ annotOn = !annotOn;
+ }
+
+private:
+ static bool privacyOn;
+ static bool annotOn;
+};
+
+
+
+class FontSizeHelper
+{
+
+public:
+ static int getSize(QSize size)
+ {
+ double ratio = size.width()*1.0 / desktop_width;
+ int real = font_size - int(25.0*pow(1 - ratio, 2));
+ return real;
+ }
+ static int desktop_height;
+ static int desktop_width;
+ static int font_size;
+ const int static font_fixed = 25;
+};
+
+class VCRHelper
+{
+public:
+ static int getVCRXOffset()
+ {
+ int x = thumbnailbar_offset * (1 - thumbnailbar_coeff_inv) - vcr_toolbar_offset;
+ return x;
+ }
+ static int getVCRYOffset()
+ {
+ int y = toolbar_coeff_inv * toolbar_Height;
+ return y;
+ }
+ static void setThumbnailbar(bool value)
+ {
+ if (value == true)
+ {
+ thumbnailbar_coeff_inv = 0;
+ }
+ else
+ {
+ thumbnailbar_coeff_inv = 1;
+ }
+ }
+
+ static void setToolbar(bool value)
+ {
+ if (value == true)
+ {
+ toolbar_coeff_inv = 0;
+ }
+ else
+ {
+ toolbar_coeff_inv = -1;
+ }
+ }
+
+ static const int vcr_toolbar_offset = 115;
+ static const int toolbar_Height = 50;
+ static const int toolbtn2_Size = 28;
+ static const int vcr_toolbar_Width = 220;
+
+private:
+ static const int thumbnailbar_offset = 150;
+ static int toolbar_coeff_inv;
+ static int thumbnailbar_coeff_inv;
+};
+
+#define SYNC_ITEM_NUM 3
+#define SYNC_STATE_NUM 3
+class SyncHelper
+{
+public:
+ static bool getSyncItem(SyncItem index)
+ {
+ return _syc_item[_syc_state][index];
+ }
+ static void setSyncItem(SyncItem index, bool sync)
+ {
+ _syc_item[_syc_state][index] = sync;
+ }
+ static void setSyncItems(bool sync)
+ {
+ for (int i = 0; i < SYNC_ITEM_NUM; i++)
+ {
+ _syc_item[_syc_state][i] = sync;
+ }
+ }
+ static SyncState getSyncState()
+ {
+ return _syc_state;
+ }
+ static void setSyncState(SyncState curState)
+ {
+ _syc_state = curState;
+ }
+ static const QString SyncStateName[SYNC_STATE_NUM];// = { "AUTO_SYNC","MANUAL_SYNC","DIS_SYNC" };
+ static const QString SyncItemName[SYNC_ITEM_NUM];// = { "SLICE_LOC","ZOOM_PAN","WIDTH_LEVEL" };
+private:
+ static SyncState _syc_state;
+ static bool _syc_item[SYNC_STATE_NUM][SYNC_ITEM_NUM];
+ static bool _sync_flag; //for just zoom and pan
+
+
+};
+
+
+typedef std::vector InstancesVecType;
+
+typedef struct SeriesInfo
+{
+ SeriesOpenMode open_mode;
+ std::string instance_num;
+ bool pixmap_valid;
+ QPixmap series_pixmap;
+ UniqueIDInfo_t* unique_info;
+ DicomTagInfo_t* tag_info;
+ thumbnailImage* thumb_nail;
+ InstancesVecType* instances;
+ SeriesInfo() :pixmap_valid(false), unique_info(nullptr),tag_info(nullptr),thumb_nail(nullptr), instances(nullptr) {}
+}SeriesInfo_t;
+typedef std::map SeriesMapType;
+
+
+typedef struct StudyInfo
+{
+ std::string study_date;
+ std::string study_time;
+ std::string study_description;
+ QPushButton *study_label;
+ SeriesMapType *series;
+ StudyInfo():study_label(nullptr), series(nullptr) {}
+}StudyInfo_t;
+typedef std::map StudiesMapType;
+
+typedef struct PatientInfo
+{
+ std::string patient_name;
+ std::string birth_date;
+ QPushButton *patient_label;
+ StudiesMapType *studies;
+ PatientInfo():patient_label(nullptr), studies(nullptr){}
+}PatientInfo_t;
+typedef std::map PatientsMapType;
diff --git a/src/include/global/include_all.h b/src/include/global/include_all.h
new file mode 100644
index 0000000..80c914c
--- /dev/null
+++ b/src/include/global/include_all.h
@@ -0,0 +1,9 @@
+#pragma once
+#include
+#include
+#include
+#include
+#include
+#include "QGlobals.h"
+
+
diff --git a/src/include/global/include_dcmtk.h b/src/include/global/include_dcmtk.h
new file mode 100644
index 0000000..71adbd1
--- /dev/null
+++ b/src/include/global/include_dcmtk.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "dcmtk/config/osconfig.h"
+#include "dcmtk/dcmdata/dcfilefo.h"
+#include "dcmtk/dcmdata/dcdatset.h"
+#include "dcmtk/dcmjpeg/djdecode.h"
+#include "dcmtk/dcmdata/dcrledrg.h"
+#include "dcmtk/dcmdata/dcdeftag.h"
+#include "dcmtk/ofstd/ofstdinc.h"
+#include "dcmtk/dcmdata/dclist.h"
+#include "dcmtk/dcmdata/dcmetinf.h"
+#include "dcmtk/dcmdata/dctk.h"
+
diff --git a/src/include/global/include_vitk.h b/src/include/global/include_vitk.h
new file mode 100644
index 0000000..830c908
--- /dev/null
+++ b/src/include/global/include_vitk.h
@@ -0,0 +1,117 @@
+#pragma once
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "infinitiViewer.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+//screenshot
+#include
+#include
+#include
+
+//for blending
+#include
+#include
+#include
+
+#include
+//#include
+//
+//#include "itkCommand.h"
+//
+//#include
+//#include
+//
+//#include
+
+//#include "vtkVersion.h"
+//#include "vtkImageViewer.h"
+//#include "vtkImageMapper3D.h"
+//#include "vtkRenderWindowInteractor.h"
+//#include "vtkSmartPointer.h"
+//#include "vtkImageActor.h"
+//#include "vtkInteractorStyleImage.h"
+//#include "vtkRenderer.h"
+//#include "itkRGBPixel.h"
+
+//#define NUM_CLASSES 3
+//#define MAX_NUM_ITER 1
+
+//#include "itkImageFileReader.h"
+//#include "itkImageFileWriter.h"
+
+//newly added
+#include
+#include
+#include
+#include
+#include
+#include "QVTKInteractorAdapter.h"
+//max version:vtk 8.2.0
+//#include
+
+//min version: vtk 8.2.0
+#include
+
+//ITK headers
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+//#include
+//#include
+//#include
+
+
+
+
+//newly added0
+#include
+#include
+
+static const unsigned int InputDimension = 3;
+static const unsigned int OutputDimension = 2;
+
+typedef signed short PixelType;
+typedef itk::Image InputImageType;
+typedef itk::GDCMImageIO ImageIOType;
+typedef itk::GDCMSeriesFileNames InputNamesGeneratorType;
+typedef itk::ImageToVTKImageFilter ConnectorType;
+typedef itk::MetaDataDictionary DictionaryType;
+typedef itk::MetaDataObject MetaDataStringType;
+typedef itk::ImageSeriesReader SeriesReaderType;
+
+typedef std::vector< std::string > FilenamesContainer;
+typedef FilenamesContainer FileNamesContainerType;
+
+
+
+typedef itk::ImageFileWriter ImageWriterType;
+
+typedef itk::Image< PixelType, OutputDimension > Image2DType;
+typedef itk::ImageSeriesWriter SeriesWriterType;
+
+
+
diff --git a/src/include/measure/ActorDraggableInteractorStyle.h b/src/include/measure/ActorDraggableInteractorStyle.h
new file mode 100644
index 0000000..0105430
--- /dev/null
+++ b/src/include/measure/ActorDraggableInteractorStyle.h
@@ -0,0 +1,230 @@
+//
+// Created by 87714 on 2021/6/19.
+//
+
+#ifndef OMEGAV_ACTORDRAGGABLEINTERACTORSTYLE_H
+#define OMEGAV_ACTORDRAGGABLEINTERACTORSTYLE_H
+
+#include
+#include
+#include "vtkInteractorStyleImage.h"
+#include "vtkNew.h" // For ivars
+#include "functional"
+#include "vtkCornerAnnotation.h"
+#include "vtkCommand.h"
+
+#define VTKIS_DRAG 33
+#define VTKIS_MEASURE 36
+#define VTKIS_COLORMAP 37
+
+#define VTKIS_IMAGE_PAN 5
+#define VTKIS_IMAGE_ZOOM 6
+#define VTKIS_IMAGE_WINDOWLEVEL 7
+
+
+class vtkProp;
+class Measure;
+class vtkImageSlice;
+
+class ActorDraggableInteractorStyle : public vtkInteractorStyleImage {
+public:
+ static ActorDraggableInteractorStyle* New();
+ vtkTypeMacro(ActorDraggableInteractorStyle, vtkInteractorStyleImage);
+
+ enum DraggableStyleEvents
+ {
+ DragEvent = vtkCommand::UserEvent + 300,
+ DragEndEvent,
+ StartMeasureEvent,
+ EndMeasureEvent,
+ SlicedEvent,
+ EndDollyEvent,
+ PopPropEvent,
+ DoubleClickEvent,
+ DeleteMeasureEvent,
+ RightButtonClickEvent,
+ ScalarOpacityEvent,
+ ScalarShiftEvent
+ };
+
+ /**
+ * Called when the user moves the mouse
+ * Default behavior forwards the event to the observed scene.
+ */
+ void OnMouseMove() override;
+
+ /**
+ * Called when the user clicks the mouse left button.
+ * Default behavior forwards the event to the observed scene.
+ */
+ void OnRightButtonDown() override;
+ void OnLeftButtonDown() override;
+
+ /**
+ * Called when the user releases the mouse left button.
+ * Default behavior forwards the event to the observed scene.
+ */
+ void OnLeftButtonUp() override;
+
+ void OnChar() override;
+ void EndDolly() override;
+
+
+ void WindowLevel()override;
+
+ void SetCurrentImageNumber(int i) override;
+
+ vtkSetClampMacro(InteractionMode, int, VTKIS_IMAGE2D, VTKIS_IMAGE_WINDOWLEVEL);
+ void SetInteractionModeToImage2D() {}
+ void SetInteractionModeToImage3D() {}
+
+ void SetInteractionModeFromEnum(int InteractionMode)
+ {
+ this->UnActiveMeasure();
+ this->SetInteractionMode(InteractionMode);
+ }
+
+ //void SetInteractionModeToImageSlicing() {
+ // this->UnActiveMeasure();
+ // this->SetInteractionMode(VTKIS_IMAGE_SLICING);
+ //}
+ //void SetInteractionModeToImagePan(){
+ // this->UnActiveMeasure();
+ // this->SetInteractionMode(VTKIS_IMAGE_PAN);
+ //}
+ //void SetInteractionModeToImageWindowLevel(){
+ // this->UnActiveMeasure();
+ // this->SetInteractionMode(VTKIS_IMAGE_WINDOWLEVEL);
+ //}
+ //void SetInteractionModeToImageZoom(){
+ // this->UnActiveMeasure();
+ // this->SetInteractionMode(VTKIS_IMAGE_ZOOM);
+ //}
+
+
+ vtkSetObjectMacro(CornerAnnotation, vtkCornerAnnotation);
+
+ vtkProp* GetSelectedProp()
+ {
+ return selectedProp;
+ }
+ void ClearSelectedProp() {
+ if (dragProp == selectedProp) dragProp = nullptr;
+ selectedProp = nullptr;
+ }
+ void ActiveMeasure(Measure* m);
+ void UnActiveMeasure();
+ //void SetCornderAnnoEna(bool enable)
+ //{
+ // isCornderAnno = enable;
+ //}
+
+protected:
+ ActorDraggableInteractorStyle();
+ ~ActorDraggableInteractorStyle() override;
+ void StartDrag() {
+ this->StartState(VTKIS_DRAG);
+ }
+ void EndDrag() {
+ if (this->State != VTKIS_DRAG)
+ {
+ return;
+ }
+ this->StopState();
+ }
+ void Drag();
+
+
+ void StartColorMapping()
+ {
+ OpacityTrigger = false;
+ ConsumedOpacity = 0;
+ this->StartState(VTKIS_COLORMAP);
+ }
+
+ void EndColorMapping();
+ void ColorMapping();
+ bool OpacityTrigger = false;
+
+ void StartMeasure() {
+ this->StartState(VTKIS_MEASURE);
+ }
+ void EndMeasure() {
+ if (this->State != VTKIS_MEASURE)
+ {
+ return;
+ }
+ this->StopState();
+ this->InvokeEvent(EndMeasureEvent, this->measure);
+ }
+ void StartPan() override;
+ void EndPan() override;
+ void EndWindowLevel() override;
+ void MeasurePlace();
+ void NoneStatePick();
+ void DispatchEvent();
+
+
+private:
+ ActorDraggableInteractorStyle(const ActorDraggableInteractorStyle&) = delete;
+ void operator=(const ActorDraggableInteractorStyle&) = delete;
+ vtkNew picker;
+
+ vtkProp* scalarProp = nullptr;
+ vtkProp* dragProp = nullptr;
+ vtkProp* selectedProp = nullptr;
+ int DragStartOrigin[2] = { 0, 0 };
+ vtkCornerAnnotation * CornerAnnotation = nullptr;
+ //bool isCornderAnno = true;
+ Measure* measure = nullptr;
+ double PanStartOrigin[3] = { 0.0, 0.0, 0.0 };
+ double DollyStartScale = 1.0;
+ vtkImageSlice * CurrentImageSlice = nullptr;
+ int lastslice = -1;
+
+ int ScalarStartPosition[2] = { 0, 0 };
+ int ScalarCurrentPosition[2] = { 0, 0 };
+ double ConsumedOpacity = 0;
+
+ void TestOutPut(vtkObject*, unsigned long eventid, void* calldata) {
+ switch (eventid) {
+ case DraggableStyleEvents::SlicedEvent:
+ {
+ int* r = (int*)calldata;
+
+ printf("Sliced, current slice number:%d \r\n", r[0]);
+
+ break;
+ }
+ case DraggableStyleEvents::EndDollyEvent: {
+ double *d = (double *)calldata;
+
+ printf("EndDolly, scale param:%f,%f \r\n", d[0], d[1]);
+
+ break;
+ }
+ case vtkCommand::EventIds::EndPanEvent: {
+ double *d = (double *)calldata;
+
+ printf("EndPan, last focalpoint:%f,%f,%f;current focalpoint:%f,%f,%f \r\n", d[0], d[1], d[2], d[3],
+ d[4], d[5]);
+
+ break;
+ }
+ case vtkCommand::EventIds::EndWindowLevelEvent:
+ {
+ double *d = (double *)calldata;
+
+ printf("EndWindowLevel, scale param:%f,%f \r\n", d[0], d[1]);
+
+ break;
+ }
+ default:
+
+ printf("current event :%s", vtkCommand::GetStringFromEventId(eventid));
+ break;
+ }
+ }
+};
+
+#endif //OMEGAV_ACTORDRAGGABLEINTERACTORSTYLE_H
diff --git a/src/include/measure/AngleAnnotationActor.h b/src/include/measure/AngleAnnotationActor.h
new file mode 100644
index 0000000..16d1d26
--- /dev/null
+++ b/src/include/measure/AngleAnnotationActor.h
@@ -0,0 +1,83 @@
+//
+// Created by on 2021/7/11.
+//
+
+#ifndef OMEGAV_ANGLEANNOTATIONACTOR_H
+#define OMEGAV_ANGLEANNOTATIONACTOR_H
+
+
+#include "DraggableActor.h"
+#include "Measure.h"
+
+class ControlPointActor;
+class vtkTextProperty;
+
+
+class AngleAnnotationActor : public DraggableActor, public Measure {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static AngleAnnotationActor *New();
+
+ vtkTypeMacro(AngleAnnotationActor, DraggableActor
+ );
+
+ //@}
+ void SetRenderer(vtkRenderer *ren);
+
+ void Highlight(int highlightOn) override;
+
+ void BuildShape() override;
+
+ void SetWorldPosition1(double x, double y, double z);
+
+ void SetWorldPosition1(double *pos) {
+ SetWorldPosition1(pos[0], pos[1], pos[2]);
+ }
+
+ void SetWorldPosition2(double x, double y, double z);
+
+ void SetWorldPosition2(double *pos) {
+ SetWorldPosition2(pos[0], pos[1], pos[2]);
+ }
+ void SetWorldPosition3(double x, double y, double z);
+
+ void SetWorldPosition3(double *pos) {
+ SetWorldPosition3(pos[0], pos[1], pos[2]);
+ }
+
+ bool onMeasureLeftButtonDown(vtkRenderWindowInteractor *) override;
+
+ void onMeasureMouseMove(vtkRenderWindowInteractor *) override;
+
+ bool onMeasureLeftButtonUp(vtkRenderWindowInteractor *) override;
+
+ NextMeasureMacro(AngleAnnotationActor);
+
+ void ForceDelete() override {
+ this->SetRenderer(nullptr);
+#ifdef _DEBUG
+ printf("LineAnnotationActor delete \r\n");
+#endif // _DEBUG
+ DraggableActor::Delete();
+ }
+protected:
+ AngleAnnotationActor();
+
+ ~AngleAnnotationActor() override;
+
+private:
+ ControlPointActor *controlP1 = nullptr;
+ ControlPointActor *controlP2 = nullptr;
+ ControlPointActor *controlP3 = nullptr;
+ vtkTextProperty* textProperty;
+ int placedPointCount = 0;
+ void controlPointCb(vtkObject *, unsigned long event, void *data);
+
+ void selfDragCb(vtkObject *, unsigned long event, void *data);
+};
+
+
+#endif //OMEGAV_ANGLEANNOTATIONACTOR_H
\ No newline at end of file
diff --git a/src/include/measure/AnnotationActor.h b/src/include/measure/AnnotationActor.h
new file mode 100644
index 0000000..42e70fc
--- /dev/null
+++ b/src/include/measure/AnnotationActor.h
@@ -0,0 +1,124 @@
+//
+// Created by krad on 2021/6/7.
+//
+
+#ifndef OMEGAV_ANNOTATIONACTOR_H
+#define OMEGAV_ANNOTATIONACTOR_H
+
+#include "vtkProp.h"
+#include "vtkPointHandleRepresentation2D.h"
+#include "vtkActor2D.h"
+#include "vtkAxisActor2D.h"
+#include "vtkPolyDataMapper2D.h"
+#include "vtkActor2D.h"
+#include "vtkCommand.h"
+
+#include "vtkNew.h" // for ivars
+#include "vtkPoints.h"
+#include "vtkPointSet.h"
+#include
+
+class vtkPolyData;
+class vtkPolyDataMapper2D;
+class vtkRenderer;
+class AnnotationActor:public vtkProp {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static AnnotationActor* New();
+ vtkTypeMacro(AnnotationActor,vtkProp);
+ void PrintSelf(ostream& os, vtkIndent indent) override;
+ //@}
+
+ //@{
+ /**
+ * Handles usually have their coordinates set in display coordinates
+ * (generally by an associated widget) and internally maintain the position
+ * in world coordinates. (Using world coordinates insures that handles are
+ * rendered in the right position when the camera view changes.) These
+ * methods are often subclassed because special constraint operations can
+ * be used to control the actual positioning.
+ */
+ virtual void SetDisplayPosition(int index, double pos[3]);
+ virtual void GetDisplayPosition(int index, double pos[3]);
+ virtual double* GetDisplayPosition(int index) VTK_SIZEHINT(3);
+ virtual void SetWorldPosition(int index, double pos[3]);
+ virtual void GetWorldPosition(int index, double pos[3]);
+ virtual double* GetWorldPosition(int index) VTK_SIZEHINT(3);
+ //@}
+
+ virtual void SetRenderer(vtkRenderer *ren);
+ virtual vtkRenderer* GetRenderer();
+ virtual void BuildAnnotation();
+
+
+ void Pick() override;
+ void MouseEntered(){
+ this->InvokeEvent(vtkCommand::EnterEvent,nullptr);
+ Highlight(1);
+ };
+ void MouseLeave(){
+ Highlight(0);
+ this->InvokeEvent(vtkCommand::LeaveEvent,nullptr);
+ };
+
+ virtual void Highlight(int highlightOn);
+
+ //@{
+ /**
+ * Methods to make this class behave as a vtkProp.
+ */
+ double *GetBounds() VTK_SIZEHINT(6) override {return nullptr;}
+ void GetActors(vtkPropCollection *) override {}
+ void GetVolumes(vtkPropCollection *) override {}
+ void ShallowCopy(vtkProp *prop) override {};
+ void GetActors2D(vtkPropCollection *) override;
+ void ReleaseGraphicsResources(vtkWindow *) override;
+ int RenderOverlay(vtkViewport *viewport) override;
+ //@}
+
+ int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override {return 0;}
+ int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override {return 0;}
+ int RenderVolumetricGeometry(vtkViewport *vtkNotUsed(viewport)) override {return 0;}
+ vtkTypeBool HasTranslucentPolygonalGeometry() override { return 0; }
+
+
+ vtkGetObjectMacro(BaseDataPoints,vtkPoints);
+ vtkSetObjectMacro(BaseDataPoints,vtkPoints);
+
+ void transform(float x,float y);
+ void ApplyTransform();
+
+protected:
+ AnnotationActor();
+ ~AnnotationActor() override;
+
+ vtkPoints* BaseDataPoints;
+ vtkPoints* renderPoints;
+ vtkPoints* tempStorePoints = nullptr;
+ vtkNew renderData;
+ vtkNew tempData;
+ //for test
+ vtkActor2D* actor2D;
+ vtkActor2D* actor2D2;
+ vtkPolyDataMapper2D* mapper;
+ vtkPolyDataMapper2D* mapper2;
+ vtkRenderer* renderer;
+
+private:
+ AnnotationActor(const AnnotationActor&) = delete;
+ void operator=(const AnnotationActor&) = delete;
+ void printPick() {
+ printf("pick!!!\r\n");
+ }
+ void printPick2() {
+ printf("pick2!!!\r\n");
+ }
+ bool transforming = false;
+ vtkNew cursor;
+};
+
+
+#endif //OMEGAV_ANNOTATIONACTOR_H
diff --git a/src/include/measure/ArrowAnnotationActor.h b/src/include/measure/ArrowAnnotationActor.h
new file mode 100644
index 0000000..e0e711d
--- /dev/null
+++ b/src/include/measure/ArrowAnnotationActor.h
@@ -0,0 +1,39 @@
+//
+// Created by 87714 on 2021/8/10.
+//
+
+#ifndef OMEGAV_ARROWANNOTATIONACTOR_H
+#define OMEGAV_ARROWANNOTATIONACTOR_H
+
+#include "LineAnnotationActor.h"
+class ArrowAnnotationActor: public LineAnnotationActor{
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static ArrowAnnotationActor* New();
+ vtkTypeMacro(ArrowAnnotationActor,LineAnnotationActor);
+ //@}
+
+ NextMeasureMacro(ArrowAnnotationActor);
+ void BuildShape() override;
+ void Highlight(int highlightOn) override;
+ bool onMeasureLeftButtonDown(vtkRenderWindowInteractor*) override;
+
+protected:
+ ArrowAnnotationActor();
+ ~ArrowAnnotationActor() override;
+ void HighlightOn(){
+ Highlight(1);
+ }
+ void HighlightOff(){
+ Highlight(0);
+ }
+
+private:
+ vtkPoints * arrowRenderPoints;
+};
+
+
+#endif //OMEGAV_ARROWANNOTATIONACTOR_H
diff --git a/src/include/measure/ControlPointActor.h b/src/include/measure/ControlPointActor.h
new file mode 100644
index 0000000..2cc2246
--- /dev/null
+++ b/src/include/measure/ControlPointActor.h
@@ -0,0 +1,38 @@
+//
+// Created by 87714 on 2021/6/22.
+//
+
+#ifndef OMEGAV_CONTROLPOINTACTOR_H
+#define OMEGAV_CONTROLPOINTACTOR_H
+
+#include "DraggableActor.h"
+
+class ControlPointActor:public DraggableActor {
+
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static ControlPointActor* New();
+ vtkTypeMacro(ControlPointActor,DraggableActor);
+ //@}
+
+ void BuildShape();
+ void Highlight(int highlightOn) override ;
+ double* GetWorldPosition();
+ void SetWorldPosition(double x,double y, double z);
+ void SetWorldPosition(double* pos){
+ SetWorldPosition(pos[0],pos[1],pos[2]);
+ }
+protected:
+ ControlPointActor();
+ ~ControlPointActor() override;
+
+ vtkNew shadowData;
+
+
+};
+
+
+#endif //OMEGAV_CONTROLPOINTACTOR_H
diff --git a/src/include/measure/ControlPointRActor.h b/src/include/measure/ControlPointRActor.h
new file mode 100644
index 0000000..c8339af
--- /dev/null
+++ b/src/include/measure/ControlPointRActor.h
@@ -0,0 +1,31 @@
+//
+// Created by 87714 on 2021/8/10.
+//
+
+#ifndef OMEGAV_CONTROLPOINTRACTOR_H
+#define OMEGAV_CONTROLPOINTRACTOR_H
+#include "ControlPointActor.h"
+
+class ControlPointRActor: public ControlPointActor {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static ControlPointRActor* New();
+ vtkTypeMacro(ControlPointRActor,ControlPointActor);
+ //@}
+
+ void BuildShape();
+ void Highlight(int highlightOn) override;
+ void MouseEntered() override {
+ this->InvokeEvent(vtkCommand::EnterEvent, nullptr);
+ }
+ void MouseLeave() override {
+ this->InvokeEvent(vtkCommand::LeaveEvent, nullptr);
+ }
+ vtkIdType Index;
+};
+
+
+#endif //OMEGAV_CONTROLPOINTRACTOR_H
diff --git a/src/include/measure/DraggableActor.h b/src/include/measure/DraggableActor.h
new file mode 100644
index 0000000..886e71d
--- /dev/null
+++ b/src/include/measure/DraggableActor.h
@@ -0,0 +1,161 @@
+//
+// Created by 87714 on 2021/6/21.
+//
+
+#ifndef OMEGAV_DRAGGABLEACTOR_H
+#define OMEGAV_DRAGGABLEACTOR_H
+
+#include "vtkProp.h"
+#include "vtkPointHandleRepresentation2D.h"
+#include "vtkActor2D.h"
+#include "vtkAxisActor2D.h"
+#include "vtkPolyDataMapper2D.h"
+#include "vtkActor2D.h"
+#include "vtkCommand.h"
+#include "functional"
+
+#include "vtkNew.h" // for ivars
+#include "vtkPoints.h"
+#include "vtkPointSet.h"
+#include "Measure.h"
+
+class vtkPolyData;
+class vtkPolyDataMapper2D;
+class vtkRenderer;
+class vtkTextActor;
+
+using DragCallBack = std::function;
+
+class DraggableActor : public vtkProp {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static DraggableActor *New();
+
+ vtkTypeMacro(DraggableActor, vtkProp);
+// void PrintSelf(ostream& os, vtkIndent indent) override;
+ //@}
+
+ enum DraggableActorEvents {
+ DragEvent = vtkCommand::UserEvent + 300,
+ DragEndEvent,
+ SelectedEvent,
+ UnSelectedEvent,
+ };
+
+ virtual void SetRenderer(vtkRenderer *ren);
+
+ virtual vtkRenderer *GetRenderer() {
+ return Renderer;
+ };
+
+ virtual void BuildShape() {};
+
+ virtual bool Hit(int x, int y);
+
+ virtual DraggableActor *GetDragItem() {
+ return this;
+ };
+
+ void Pick() override;
+
+ virtual void MouseEntered() {
+ this->InvokeEvent(vtkCommand::EnterEvent, nullptr);
+ Highlight(1);
+ };
+
+ virtual void MouseLeave() {
+ Highlight(0);
+ this->InvokeEvent(vtkCommand::LeaveEvent, nullptr);
+ };
+
+ virtual void Highlight(int highlightOn);
+ vtkGetMacro(Highlighted,bool);
+ vtkSetMacro(Highlighted,bool);
+
+ virtual void Select(int Selected);
+ vtkGetMacro(Selected,bool);
+ vtkSetMacro(Selected,bool);
+ void SelectedOn(){
+ Select(1);
+ }
+ void SelectedOff(){
+ Select(0);
+ }
+ virtual void RenderWithState();
+
+ //@{
+ /**
+ * Methods to make this class behave as a vtkProp.
+ */
+ double *GetBounds() VTK_SIZEHINT(6) override { return nullptr; }
+
+ void GetActors(vtkPropCollection *) override {}
+
+ void GetVolumes(vtkPropCollection *) override {}
+
+ void ShallowCopy(vtkProp *prop) override {};
+
+ void ReleaseGraphicsResources(vtkWindow *) override;
+
+ int RenderOverlay(vtkViewport *viewport) override;
+ //@}
+
+ int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
+
+ int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
+
+ int RenderVolumetricGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
+
+ vtkTypeBool HasTranslucentPolygonalGeometry() override { return 0; }
+
+ virtual void Transform(float x, float y);
+ virtual void ApplyTransform();
+
+ void SetOnDrag(DragCallBack f) {
+ this->OnDrag = f;
+ }
+
+ void SetOnDragEnd(DragCallBack f) {
+ this->OnDragEnd = f;
+ }
+ void Hide();
+ void Show();
+
+protected:
+ DraggableActor();
+ ~DraggableActor() override;
+
+ vtkPoints *BaseDataPoints;
+ vtkPoints *renderPoints;
+ vtkPoints *tempStorePoints = nullptr;
+ vtkNew renderData;
+ //for test
+ vtkActor2D * actor2D;
+ vtkActor2D * shadow2D;
+ vtkActor2D * senseArea;
+ vtkActor2D * text = nullptr;
+ vtkRenderer *Renderer;
+
+ void GetSlicePlanePoint(double x, double y, vtkRenderer *renderer, double *result);
+
+ bool transforming = false;
+ bool Highlighted = false;
+ bool Selected = false;
+
+ void RebuildRenderPoint();
+
+private:
+ DraggableActor(const DraggableActor &) = delete;
+
+ void operator=(const DraggableActor &) = delete;
+
+ DragCallBack OnDrag = nullptr;
+
+ DragCallBack OnDragEnd = nullptr;
+};
+
+
+#endif //OMEGAV_DRAGGABLEACTOR_H
diff --git a/src/include/measure/EllipseAnnotationActor.h b/src/include/measure/EllipseAnnotationActor.h
new file mode 100644
index 0000000..50b5cf6
--- /dev/null
+++ b/src/include/measure/EllipseAnnotationActor.h
@@ -0,0 +1,47 @@
+//
+// Created by 87714 on 2021/6/22.
+//
+
+#ifndef OMEGAV_EllipseANNOTATIONACTOR_H
+#define OMEGAV_EllipseANNOTATIONACTOR_H
+
+#include "DraggableActor.h"
+#include "Measure.h"
+class vtkTextProperty;
+class ControlPointActor;
+class EllipseAnnotationActor: public DraggableActor, public Measure {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static EllipseAnnotationActor* New();
+ vtkTypeMacro(EllipseAnnotationActor,DraggableActor);
+ //@}
+ void controlPointsTransform(float x,float y);
+ void controlPointsApplyTransform();
+ void SetRenderer(vtkRenderer* ren);
+ void BuildShape() override;
+ void Transform(float x, float y) override;
+ void ApplyTransform() override;
+ bool onMeasureLeftButtonDown(vtkRenderWindowInteractor*) override;
+ void onMeasureMouseMove(vtkRenderWindowInteractor*) override;
+ bool onMeasureLeftButtonUp(vtkRenderWindowInteractor*) override;
+ NextMeasureMacro(EllipseAnnotationActor);
+protected:
+ EllipseAnnotationActor();
+ ~EllipseAnnotationActor() override;
+
+private:
+ ControlPointActor* controlP_rt= nullptr;
+ ControlPointActor* controlP_lb = nullptr;
+ ControlPointActor* controlP_rb = nullptr;
+ ControlPointActor* controlP_lt= nullptr;
+ void selfDragCb(vtkObject*, unsigned long event, void* data);
+ void controlPointCb(vtkObject * sender, unsigned long event, void *data);
+ void drawCircle(double *p1,double *p2);
+ vtkTextProperty* textProperty;
+};
+
+
+#endif //OMEGAV_EllipseANNOTATIONACTOR_H
diff --git a/src/include/measure/EventsCenter.h b/src/include/measure/EventsCenter.h
new file mode 100644
index 0000000..b860b98
--- /dev/null
+++ b/src/include/measure/EventsCenter.h
@@ -0,0 +1,66 @@
+//
+// Created by 87714 on 2021/6/23.
+//
+
+#ifndef OMEGAV_EVENTSCENTER_H
+#define OMEGAV_EVENTSCENTER_H
+
+#include
+#include "QtCore/qmap.h"
+#include "QString"
+#define aLLEventMacro() \
+ _add_Event(DefaultEvent)\
+ _add_Event(DragEvent)
+
+
+enum Events{
+ #define _add_Event(enum) enum,
+ aLLEventMacro()
+ #undef _add_Event
+};
+class EventObject {
+public:
+ void* Sender= nullptr;
+ bool Cancel = false;
+ QMap Detail;
+ void AddDetailValue(const QString& key, void* val)
+ {
+ Detail[key]=val;
+ }
+};
+class EventsCenter:public QObject {
+ Q_OBJECT
+public:
+ static EventsCenter* Instance(){
+ return instance;
+ }
+ static void TriggerEvent(Events eventId, EventObject &callData){
+ Instance()->triggerEvent(eventId, callData);
+ }
+signals:
+ #define _add_Event(enum) void enum (EventObject &);
+ aLLEventMacro()
+ #undef _add_Event
+private:
+ void triggerEvent(Events eventId, EventObject &callData){
+ switch (eventId) {
+ #define _add_Event(enum) \
+ case Events::enum:\
+ {\
+ emit enum(callData);\
+ break;\
+ };
+
+ aLLEventMacro()
+ #undef _add_Event
+ default:
+ emit DefaultEvent(callData);
+ break;
+ }
+ }
+ static EventsCenter* instance;
+
+};
+
+
+#endif //OMEGAV_EVENTSCENTER_H
diff --git a/src/include/measure/HoverButton.h b/src/include/measure/HoverButton.h
new file mode 100644
index 0000000..a62731f
--- /dev/null
+++ b/src/include/measure/HoverButton.h
@@ -0,0 +1,24 @@
+//
+// Created by 87714 on 2021/7/22.
+//
+
+#ifndef OMEGAV_HOVERBUTTON_H
+#define OMEGAV_HOVERBUTTON_H
+
+#include
+class HoverButton:public QPushButton {
+ Q_OBJECT
+public:
+ explicit HoverButton(QWidget *parent = Q_NULLPTR);
+ ~HoverButton();
+ signals:
+ void hovered();
+ void endHover();
+
+protected:
+ void enterEvent(QEvent *) override;
+ void leaveEvent(QEvent *) override ;
+};
+
+
+#endif //OMEGAV_HOVERBUTTON_H
diff --git a/src/include/measure/KDicomObjects.h b/src/include/measure/KDicomObjects.h
new file mode 100644
index 0000000..3a6e448
--- /dev/null
+++ b/src/include/measure/KDicomObjects.h
@@ -0,0 +1,87 @@
+//
+// Created by 87714 on 2021/7/25.
+//
+
+#ifndef OMEGAV_KDICOMOBJECTS_H
+#define OMEGAV_KDICOMOBJECTS_H
+
+
+#include
+#include
+#include
+
+
+using namespace std;
+class KDicomPatient;
+class KDicomStudy;
+class KDicomSeries;
+class KDicomImage{
+public:
+ string SOPInstanceUID;
+ string RefFilePath;
+ int ImageIndex = 0;
+ signed long InstanceNumber = 0;
+ double WindowWidth = 255.0;
+ double WindowCenter = 0.0;
+ double PatientImagePosition[3] = {0.0,0.0,0.0};
+ double PatientImageOrientation[6] = {0.0,0.0,0.0,0.0,0.0,0.0};
+ double PixelSpacing[2] = {1.0,1.0};
+ double SliceThickness = 1.0;
+ unsigned short Rows = 0;
+ unsigned short Columns = 0;
+ KDicomSeries* Series = nullptr;
+ ~KDicomImage(){
+ Series = nullptr;
+ }
+};
+class KDicomSeries
+{
+public:
+ string StudyUID;
+ string seriesUID;
+ string SeriesDescription;
+ string AccessionNumber;
+ signed long SeriesNumber = 0;
+ signed long AcquisitionNumber = 0;
+ KDicomStudy* Study;
+ vector> Images;
+ ~KDicomSeries(){
+ Study = nullptr;
+ }
+};
+class KDicomStudy
+{
+public:
+ string StudyDate;
+ string StudyDescription;
+ string InstitutionName;
+ string StudyUID;
+ string StudyID;
+ string Modality;
+ KDicomPatient* Patient;
+
+ unordered_map> Series;
+ ~KDicomStudy(){
+ Patient = nullptr;
+ }
+};
+class KDicomPatient{
+public:
+ string PatientName;
+ string PatientID;
+ string PatientSex;
+ string PatientBirthDate;
+ unordered_map> Studys;
+};
+class KDicomRoot{
+public:
+ static KDicomRoot* Instance(){
+ static KDicomRoot root;
+ return &root;
+ }
+ unordered_map> Patients;
+ void LoadFromDir(const char * path);
+};
+
+
+#endif //OMEGAV_KDICOMOBJECTS_H
diff --git a/src/include/measure/LineAnnotationActor.h b/src/include/measure/LineAnnotationActor.h
new file mode 100644
index 0000000..2666415
--- /dev/null
+++ b/src/include/measure/LineAnnotationActor.h
@@ -0,0 +1,51 @@
+//
+// Created by 87714 on 2021/6/22.
+//
+
+#ifndef OMEGAV_LINEANNOTATIONACTOR_H
+#define OMEGAV_LINEANNOTATIONACTOR_H
+#include "DraggableActor.h"
+#include "Measure.h"
+class ControlPointActor;
+class LineAnnotationActor: public DraggableActor, public Measure {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static LineAnnotationActor* New();
+ vtkTypeMacro(LineAnnotationActor,DraggableActor);
+ //@}
+ void SetRenderer(vtkRenderer* ren);
+ void BuildShape() override;
+ void SetWorldPosition1(double x,double y, double z);
+ void SetWorldPosition1(double* pos){
+ SetWorldPosition1(pos[0],pos[1],pos[2]);
+ }
+ void SetWorldPosition2(double x,double y, double z);
+ void SetWorldPosition2(double* pos){
+ SetWorldPosition2(pos[0],pos[1],pos[2]);
+ }
+
+ bool onMeasureLeftButtonDown(vtkRenderWindowInteractor*) override;
+ void onMeasureMouseMove(vtkRenderWindowInteractor*) override;
+ bool onMeasureLeftButtonUp(vtkRenderWindowInteractor*) override;
+ NextMeasureMacro(LineAnnotationActor);
+ void ForceDelete() override {
+ this->SetRenderer(nullptr);
+#ifdef _DEBUG
+ printf("LineAnnotationActor delete \r\n");
+#endif
+ DraggableActor::Delete();
+ }
+protected:
+ LineAnnotationActor();
+ ~LineAnnotationActor() override;
+ ControlPointActor* controlP1= nullptr;
+ ControlPointActor* controlP2= nullptr;
+ void selfDragCb(vtkObject*, unsigned long event, void* data);
+ void controlPointCb(vtkObject * sender, unsigned long event, void *data);
+};
+
+
+#endif //OMEGAV_LINEANNOTATIONACTOR_H
diff --git a/src/include/measure/Measure.h b/src/include/measure/Measure.h
new file mode 100644
index 0000000..6c30068
--- /dev/null
+++ b/src/include/measure/Measure.h
@@ -0,0 +1,63 @@
+
+#ifndef OMEGAV_MEASURE_H
+#define OMEGAV_MEASURE_H
+
+#define NextMeasureMacro(newMeasure) \
+Measure* GetNextMeasure() override\
+{\
+ return newMeasure::New();\
+}\
+
+
+#include
+#include "vtkRenderWindowInteractor.h"
+class Measure{
+public:
+ virtual bool onMeasureDoubleClick(vtkRenderWindowInteractor*){ return this->Placing;};
+ //Measure left bond
+ virtual bool onMeasureLeftButtonDown(vtkRenderWindowInteractor*){ return false;};
+ //Mouse movement handle during measurement
+ virtual void onMeasureMouseMove(vtkRenderWindowInteractor*){};
+ //Left-click up, and the returned value indicates whether the measurement setting operation continues.
+ virtual bool onMeasureLeftButtonUp(vtkRenderWindowInteractor*){return false;};
+ //not used
+ virtual void onTerminate(vtkRenderWindowInteractor*){};
+ bool isMeasurePlacing(){
+ return this->Placing;
+ }
+ void SetPlacing(bool p){
+ if (Hidden)
+ {
+ Hidden = false;
+ }
+ this->Placing=p;
+ }
+
+ void SetMeasureID(const QString &Id){
+ id = Id;
+ }
+
+ QString GetMeasureID(){
+ return id;
+ }
+
+ static void SetHidden(bool h){
+ Measure::Hidden=h;
+ }
+
+ static bool GetHidden(){
+ return Measure::Hidden;
+ }
+
+ virtual Measure* GetNextMeasure(){ return nullptr;}
+ virtual void ForceDelete(){};
+ virtual bool Valid(){return true;}
+
+protected:
+ static bool Hidden;
+private:
+ bool Placing = false;
+ QString id = "";
+};
+
+#endif //OMEGAV_MEASURE_H
diff --git a/src/include/measure/MeasureStore.h b/src/include/measure/MeasureStore.h
new file mode 100644
index 0000000..c7d9c1b
--- /dev/null
+++ b/src/include/measure/MeasureStore.h
@@ -0,0 +1,34 @@
+//
+// Created by 87714 on 2021/7/19.
+//
+
+#ifndef OMEGAV_MEASURESTORE_H
+#define OMEGAV_MEASURESTORE_H
+class DraggableActor;
+class Measure;
+#include "unordered_map"
+#include "QMap"
+#include "QList"
+class MeasureStore {
+public:
+ static MeasureStore* Instance(){
+ if (instance == nullptr)
+ {
+ instance = new MeasureStore();
+ }
+ return instance;
+ }
+ void Store(QString SeriesUid,int slice,Measure* measure);
+ void Remove(Measure* measure);
+ void RemoveAllInSlice(QString SeriesUid,int slice);
+ void RemoveAllInSeries(QString SeriesUid);
+ void Clear();
+ QList* GetMeasures(QString SeriesUid, int slice);
+
+private:
+ QMap>> store;
+ static MeasureStore* instance;
+};
+
+
+#endif //OMEGAV_MEASURESTORE_H
diff --git a/src/include/measure/OpenPolyAnnotationActor.h b/src/include/measure/OpenPolyAnnotationActor.h
new file mode 100644
index 0000000..5c9a55e
--- /dev/null
+++ b/src/include/measure/OpenPolyAnnotationActor.h
@@ -0,0 +1,56 @@
+//
+// Created by 87714 on 2021/8/13.
+//
+
+#ifndef OMEGAV_OPENPOLYANNOTATIONACTOR_H
+#define OMEGAV_OPENPOLYANNOTATIONACTOR_H
+
+#include "DraggableActor.h"
+#include "Measure.h"
+class ControlPointRActor;
+class OpenPolyAnnotationActor: public DraggableActor, public Measure {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static OpenPolyAnnotationActor* New();
+ vtkTypeMacro(OpenPolyAnnotationActor,DraggableActor);
+ //@}
+ void SetRenderer(vtkRenderer* ren) override;
+ void BuildShape() override;
+ void SetPointWorldPosition(vtkIdType index, double x, double y, double z);
+
+ void Highlight(int f) override ;
+ bool onMeasureDoubleClick(vtkRenderWindowInteractor*) override;
+ bool onMeasureLeftButtonDown(vtkRenderWindowInteractor*) override;
+ void onMeasureMouseMove(vtkRenderWindowInteractor*) override;
+ bool onMeasureLeftButtonUp(vtkRenderWindowInteractor*) override;
+ NextMeasureMacro(OpenPolyAnnotationActor);
+ void ForceDelete() override {
+ this->SetRenderer(nullptr);
+ printf("OpenPolyAnnotationActor delete \r\n");
+ Delete();
+ }
+ vtkSetMacro(Closed, vtkTypeBool);
+ vtkGetMacro(Closed, vtkTypeBool);
+ vtkBooleanMacro(Closed, vtkTypeBool);
+ bool Valid() override {
+ return Closed==0?BaseDataPoints->GetNumberOfPoints()>1:BaseDataPoints->GetNumberOfPoints()>2;
+ }
+protected:
+ OpenPolyAnnotationActor();
+ ~OpenPolyAnnotationActor() override;
+ void HighlightOn(){
+ Highlight(1);
+ }
+ void HighlightOff(){
+ Highlight(0);
+ }
+ std::vector controlPointList;
+ vtkTypeBool Closed = 0;
+ void selfDragCb(vtkObject*, unsigned long event, void* data);
+ void controlPointCb(vtkObject * sender, unsigned long event, void *data);
+};
+
+#endif //OMEGAV_OPENPOLYANNOTATIONACTOR_H
diff --git a/src/include/measure/QDicomUitility.h b/src/include/measure/QDicomUitility.h
new file mode 100644
index 0000000..980c6e2
--- /dev/null
+++ b/src/include/measure/QDicomUitility.h
@@ -0,0 +1,56 @@
+//
+// Created by 87714 on 2021/7/26.
+//
+
+#ifndef OMEGAV_QDICOMUITILITY_H
+#define OMEGAV_QDICOMUITILITY_H
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+QPixmap GetImageFormDcmFile(const QString& filepath, int wl, int ww)
+{
+ DcmRLEDecoderRegistration::registerCodecs(OFFalse, OFTrue);//娉ㄥ唽瑙g爜鍣
+ /// register JPEG decompression codecs
+ DJDecoderRegistration::registerCodecs();//娉ㄥ唽瑙g爜鍣
+ DJLSDecoderRegistration::registerCodecs();//
+// FMJPEG2KDecoderRegistration::registerCodecs();//jpeg2000
+ DcmFileFormat *fileFormat = new DcmFileFormat();//璇诲彇鏂囦欢鑾峰彇浼犺緭璇硶
+ QPixmap pixmap(100,100);
+ pixmap.fill(Qt::black);
+ if (fileFormat->loadFile(filepath.toLatin1().data()).good())
+ {
+ DcmDataset * dset = fileFormat->getDataset();
+
+ //灏嗗師濮嬩紶杈撹娉曡緭鍏icomImage缂栬瘧绫诲簱鑷垜瑙e帇鍘嬬缉鐨勫浘鍍
+ DicomImage dcmImage(fileFormat, dset->getOriginalXfer(),CIF_MayDetachPixelData);
+ unsigned long w = 100;
+ bool flag = dcmImage.getWidth() > dcmImage.getHeight();
+ DicomImage* sdcmImage = dcmImage.createScaledImage(w,0,0,1);
+ sdcmImage->setWindow(wl, ww);
+ uchar* data = (uchar*)sdcmImage->getOutputData(8);//鎸8浣嶇殑浣嶅鍙栨暟鎹
+ unsigned long size = sdcmImage->getOutputDataSize(8);
+ QImage image(data, sdcmImage->getWidth(), sdcmImage->getHeight(), QImage::Format_Grayscale8);//浣跨敤8浣嶆繁搴︾殑鐏板害鍥惧仛杈撳嚭
+ if (sdcmImage->getHeight() > 100) image = image.scaledToHeight(100);
+ QPainter p(&pixmap);
+ p.drawPixmap(50 - image.width()/2, 50-image.height()/2, QPixmap::fromImage(image));
+
+ // p.save();
+ }
+ delete fileFormat;
+ DcmRLEDecoderRegistration::cleanup();
+ DJDecoderRegistration::cleanup();
+ DJLSDecoderRegistration::cleanup();
+// FMJPEG2KDecoderRegistration::cleanup();
+ return pixmap;
+}
+
+
+#endif //OMEGAV_QDICOMUITILITY_H
diff --git a/src/include/measure/RulerAnnotationActor.h b/src/include/measure/RulerAnnotationActor.h
new file mode 100644
index 0000000..b520434
--- /dev/null
+++ b/src/include/measure/RulerAnnotationActor.h
@@ -0,0 +1,47 @@
+//
+// Created by 87714 on 2021/7/12.
+//
+
+#ifndef OMEGAV_RULERANNOTATIONACTOR_H
+#define OMEGAV_RULERANNOTATIONACTOR_H
+
+
+#include "LineAnnotationActor.h"
+
+class RulerAnnotationActor : public LineAnnotationActor {
+public:
+ static RulerAnnotationActor* New();
+ vtkTypeMacro(RulerAnnotationActor,LineAnnotationActor);
+ void BuildShape() override;
+ NextMeasureMacro(RulerAnnotationActor);
+
+ void setCalibration(double s)
+ {
+ isCalibration = true;
+ calib_dis = s;
+ }
+ double getCalibration() {
+ if (isCalibration)
+ {
+ return calib_dis;
+ }
+ else
+ {
+ return real_dis;
+ }
+ }
+
+protected:
+ RulerAnnotationActor();
+ ~RulerAnnotationActor() override;
+
+private:
+ void selfCalibCb(vtkObject *, unsigned long, void *data);
+ vtkTextProperty* textProperty;
+ double real_dis;
+ double calib_dis;
+ bool isCalibration = false;
+};
+
+
+#endif //OMEGAV_RULERANNOTATIONACTOR_H
diff --git a/src/include/measure/RulerLegendActor.h b/src/include/measure/RulerLegendActor.h
new file mode 100644
index 0000000..9b073e1
--- /dev/null
+++ b/src/include/measure/RulerLegendActor.h
@@ -0,0 +1,67 @@
+//
+// Created by 87714 on 2021/9/2.
+//
+
+#ifndef OMEGAV_RULERLEGENDACTOR_H
+#define OMEGAV_RULERLEGENDACTOR_H
+
+#include "vtkProp.h"
+#include "vtkActor2D.h"
+#include "vtkPolyData.h"
+#include "vtkNew.h" // for ivars
+
+class RulerLegendActor : public vtkProp {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static RulerLegendActor *New();
+
+ vtkTypeMacro(RulerLegendActor, vtkProp);
+
+ virtual void BuildShape(int* size, double scale);
+
+ //@{
+ /**
+ * Methods to make this class behave as a vtkProp.
+ */
+ double *GetBounds() VTK_SIZEHINT(6) override { return nullptr; }
+
+ void GetActors(vtkPropCollection *) override {}
+
+ void GetVolumes(vtkPropCollection *) override {}
+
+ void ShallowCopy(vtkProp *prop) override {};
+
+ void ReleaseGraphicsResources(vtkWindow *) override;
+
+ /**
+ * Method use to make this actor render in 2D scene;
+ * @param viewport
+ * @return render is success
+ */
+ int RenderOverlay(vtkViewport *viewport) override;
+
+ int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
+
+ int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
+
+ int RenderVolumetricGeometry(vtkViewport *vtkNotUsed(viewport)) override { return 0; }
+
+ vtkTypeBool HasTranslucentPolygonalGeometry() override { return 0; }
+
+
+protected:
+ RulerLegendActor();
+ ~RulerLegendActor() override;
+
+ vtkNew renderData;
+ vtkActor2D * actor2D;
+
+private:
+ RulerLegendActor(const RulerLegendActor &) = delete;
+ void operator=(const RulerLegendActor &) = delete;
+};
+
+#endif //OMEGAV_RULERLEGENDACTOR_H
diff --git a/src/include/measure/SeriesItem.h b/src/include/measure/SeriesItem.h
new file mode 100644
index 0000000..016fc7f
--- /dev/null
+++ b/src/include/measure/SeriesItem.h
@@ -0,0 +1,25 @@
+//
+// Created by 87714 on 2021/7/23.
+//
+
+#ifndef OMEGAV_SERIESITEM_H
+#define OMEGAV_SERIESITEM_H
+
+#include
+#include
+#include
+class SeriesItem:public QWidget {
+Q_OBJECT
+public:
+ explicit SeriesItem(QWidget *parent = Q_NULLPTR);
+ ~SeriesItem() override;
+ void SetStudy(QString studyUid,QString studyDate, QString Modality);
+ void AddSeries(QString seriesUid,QString des,int count);
+private:
+ QVBoxLayout mainLayout;
+ QPushButton studyHeader;
+ int series_count=0;
+};
+
+
+#endif //OMEGAV_SERIESITEM_H
diff --git a/src/include/measure/StudyItem.h b/src/include/measure/StudyItem.h
new file mode 100644
index 0000000..38449a8
--- /dev/null
+++ b/src/include/measure/StudyItem.h
@@ -0,0 +1,32 @@
+//
+// Created by 87714 on 2021/7/23.
+//
+
+#ifndef OMEGAV_STUDYITEM_H
+#define OMEGAV_STUDYITEM_H
+
+#include
+#include
+#include
+class StudyItem: public QWidget {
+Q_OBJECT
+public:
+ explicit StudyItem(QWidget *parent = Q_NULLPTR);
+ ~StudyItem() override;
+ void setPatientID(QString patientId){
+ this->patientID=patientId;
+ }
+ void SetStudy(QString studyUid,QString studyDate, QString studyDes,QString Modality);
+ void AddSeries(QString seriesUid,QString des,QPixmap img);
+ signals:
+ void SeriesButtonClick(QString patientID,QString studyUid,QString seriesUid);
+private:
+ QVBoxLayout mainLayout;
+ QPushButton studyHeader;
+ QString patientID;
+ QString studyUid;
+ int series_count=0;
+};
+
+
+#endif //OMEGAV_STUDYITEM_H
diff --git a/src/include/measure/TextAnnotationActor.h b/src/include/measure/TextAnnotationActor.h
new file mode 100644
index 0000000..67e6277
--- /dev/null
+++ b/src/include/measure/TextAnnotationActor.h
@@ -0,0 +1,61 @@
+//
+// Created by 87714 on 2021/6/22.
+//
+
+#ifndef OMEGAV_TEXTANNOTATIONACTOR_H
+#define OMEGAV_TEXTANNOTATIONACTOR_H
+#include "DraggableActor.h"
+#include "Measure.h"
+#include "vtkTextMapper.h"
+#include "vtkTextProperty.h"
+class ControlPointActor;
+//class pqFontPropertyWidget;
+class TextAnnotationActor : public DraggableActor, public Measure {
+public:
+ //@{
+ /**
+ * Standard methods for instances of this class.
+ */
+ static TextAnnotationActor* New();
+ vtkTypeMacro(TextAnnotationActor, DraggableActor);
+ //@}
+ void SetRenderer(vtkRenderer* ren);
+
+ vtkTextProperty* GetTextProp()
+ {
+ return this->textProperty;
+ }
+ char * GetTextInput()
+ {
+ return m_TextStr;
+ }
+ void SetTextInput(const char* str);
+
+ void ResetTextProp();
+ void BuildShape() override;
+ void SetWorldPosition1(double x, double y, double z);
+ void SetWorldPosition1(double* pos) {
+ SetWorldPosition1(pos[0], pos[1], pos[2]);
+ }
+ void SetWorldPosition2(double x, double y, double z);
+ void SetWorldPosition2(double* pos) {
+ SetWorldPosition2(pos[0], pos[1], pos[2]);
+ }
+ bool onMeasureLeftButtonDown(vtkRenderWindowInteractor*) override;
+ void onMeasureMouseMove(vtkRenderWindowInteractor*) override;
+ bool onMeasureLeftButtonUp(vtkRenderWindowInteractor*) override;
+ NextMeasureMacro(TextAnnotationActor);
+protected:
+ TextAnnotationActor();
+ ~TextAnnotationActor() override;
+
+private:
+ void selfDragCb(vtkObject*, unsigned long event, void* data);
+ void selfPickCb(vtkObject*, unsigned long event, void* data);
+ vtkTextProperty* textProperty;
+ vtkRenderWindowInteractor *m_iren;
+ char m_TextStr[100];
+};
+
+
+#endif //OMEGAV_TEXTANNOTATIONACTOR_H
diff --git a/src/include/measure/calibrationWidget.h b/src/include/measure/calibrationWidget.h
new file mode 100644
index 0000000..6dbb7b7
--- /dev/null
+++ b/src/include/measure/calibrationWidget.h
@@ -0,0 +1,22 @@
+#pragma once
+#include
+#include "ui_calibrationWidget.h"
+#include "RulerAnnotationActor.h"
+
+namespace Ui {
+ class calibrationWidget;
+}
+
+class calibrationWidget : public QDialog
+{
+ Q_OBJECT
+public:
+ explicit calibrationWidget(RulerAnnotationActor *rulerActor,vtkRenderWindowInteractor* iren);
+ ~calibrationWidget();
+public slots:
+ void SetTextInput();
+private:
+ Ui::calibrationWidget ui;
+ RulerAnnotationActor* _rulerActor;
+ vtkRenderWindowInteractor* _rulerRender;
+};
\ No newline at end of file
diff --git a/src/include/measure/pqFontPropertyWidget.h b/src/include/measure/pqFontPropertyWidget.h
new file mode 100644
index 0000000..55e0f75
--- /dev/null
+++ b/src/include/measure/pqFontPropertyWidget.h
@@ -0,0 +1,43 @@
+#pragma once
+
+#include
+#include "ui_pqFontPropertyWidget.h"
+#include "TextAnnotationActor.h"
+
+namespace Ui {
+ class FontPropertyWidget;
+}
+
+
+//class DicomImageView;
+class pqFontPropertyWidget : public QDialog
+{
+ Q_OBJECT
+public:
+ static pqFontPropertyWidget* GetPropDlg();
+ void SetTextActor(TextAnnotationActor*);
+ void SetRenderWindowInteractor(vtkRenderWindowInteractor* ren);
+
+ //void SetViewer(DicomImageView*);
+ void reloadProperties();
+public slots:
+ void SetFontSize(int);
+ void SetOpacity(double);
+ void SetFontFamily(int);
+ void BoldOn(bool);
+ void ItalicOn(bool);
+ void ShadowOn(bool);
+ //void ColorEditor();
+ void ColorChooser();
+ void SetTextInput();
+ void ResetText();
+
+private:
+ static pqFontPropertyWidget *propDlg;
+ explicit pqFontPropertyWidget(QWidget *parent = Q_NULLPTR);
+ ~pqFontPropertyWidget();
+ Ui::FontPropertyWidget ui;
+ TextAnnotationActor* textActor;
+ vtkRenderWindowInteractor* tRender;
+ //DicomImageView* viewer;
+};
diff --git a/src/include/measure/vtkArrow2DSource.h b/src/include/measure/vtkArrow2DSource.h
new file mode 100644
index 0000000..4f729c1
--- /dev/null
+++ b/src/include/measure/vtkArrow2DSource.h
@@ -0,0 +1,39 @@
+//
+// Created by 87714 on 2021/8/11.
+//
+
+#ifndef OMEGAV_VTKARROW2DSOURCE_H
+#define OMEGAV_VTKARROW2DSOURCE_H
+
+#include "vtkPolyLineSource.h"
+
+class vtkArrow2DSource : public vtkPolyLineSource
+{
+public:
+ /**
+ * Construct cone with angle of 45 degrees.
+ */
+ static vtkArrow2DSource *New();
+
+ vtkTypeMacro(vtkArrow2DSource,vtkPolyDataAlgorithm);
+ void PrintSelf(ostream& os, vtkIndent indent) override;
+ /**
+ * Set the length, of the tip. It default to 10.0
+ */
+ vtkSetClampMacro(TipLength,double,0.0,1.0);
+ vtkGetMacro(TipLength,double);
+ //@}
+protected:
+ vtkArrow2DSource();
+ ~vtkArrow2DSource() override;
+
+ int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector *) override;
+
+private:
+ vtkArrow2DSource(const vtkArrow2DSource&) = delete;
+ void operator=(const vtkArrow2DSource&) = delete;
+ double TipLength = 10.0;
+};
+
+
+#endif //OMEGAV_VTKARROW2DSOURCE_H
diff --git a/src/include/measure/vtkSignalRaiser.h b/src/include/measure/vtkSignalRaiser.h
new file mode 100644
index 0000000..4136569
--- /dev/null
+++ b/src/include/measure/vtkSignalRaiser.h
@@ -0,0 +1,23 @@
+//
+// Created by 87714 on 2021/7/23.
+//
+
+#ifndef OMEGAV_VTKSIGNALRAISER_H
+#define OMEGAV_VTKSIGNALRAISER_H
+
+#include
+#include
+class vtkSignalRaiser: public QObject {
+ Q_OBJECT
+public:
+ signals:
+ void raiseEvent(vtkObject* sender,unsigned long eventId,void* callData = nullptr);
+
+public :
+ void raise(vtkObject* sender,unsigned long eventId,void* callData = nullptr){
+ emit raiseEvent(sender,eventId,callData);
+ }
+};
+
+
+#endif //OMEGAV_VTKSIGNALRAISER_H
diff --git a/src/include/util/ColorMapReader.h b/src/include/util/ColorMapReader.h
new file mode 100644
index 0000000..2f3084a
--- /dev/null
+++ b/src/include/util/ColorMapReader.h
@@ -0,0 +1,55 @@
+//
+// Created by 87714 on 2021/9/4.
+//
+
+#ifndef OMEGAV_COLORMAPREADER_H
+#define OMEGAV_COLORMAPREADER_H
+
+#include
+#include
+#include
+#include
+#include "QGlobals.h"
+
+using namespace std;
+class ColorMapReader {
+public:
+ ColorMapReader() = default;
+ //ColorMapReader(){
+ // //ParseFile(path);
+ //}
+ bool ParseFile(const char* path);
+ vector& GetPresetNames() {
+ printf("%x\r\n", &names);
+ return names;
+ }
+ enum PresetType {
+ Undefined,
+ RGBPoints,
+ IndexedColors
+ };
+ PresetType GetPresetType(const char* name);
+ const vector& GetPresetValues(const char* name);
+ double* GetPresetNanColor(const char* name);
+ static ColorMapReader* DefaultPresets() {
+ static ColorMapReader defaultInstance;
+ //static ColorMapReader defaultInstance(":/Config/Json/ColorMaps.json");
+ if (defaultInstance.ParseFile(COLOR_MAP_PATH.c_str()))
+ {
+ return &defaultInstance;
+ }
+ else
+ {
+ return nullptr;
+ }
+ }
+private:
+ //vector Names;
+ QJsonDocument doc;
+ vector names;
+ vector valStore;
+ unordered_map name_index_map;
+};
+
+
+#endif //OMEGAV_COLORMAPREADER_H
diff --git a/src/include/view/dicomimageview.h b/src/include/view/dicomimageview.h
new file mode 100644
index 0000000..4941d1d
--- /dev/null
+++ b/src/include/view/dicomimageview.h
@@ -0,0 +1,233 @@
+锘#pragma once
+#include
+#include
+#include
+#include
+#include "base/SeriesInstance.h"
+#include "view/myQVTKOpenGLNativeWidget.h"
+
+#include
+class infinitiViewer;
+class vtkCornerAnnotation;
+class vtkGenericOpenGLRenderWindow;
+class MyTitleBar;
+class pqVCRController;
+class pqVCRToolbar;
+
+
+namespace scrollScope {
+ enum TriggerType
+ {
+ USER_TRIGGER, //a,b,c
+ STYLE_TRIGGER,//b,c
+ SYNC_ONLY,//do nothing
+ };
+}
+class DicomImageView : public QFrame
+{
+ Q_OBJECT
+ typedef QOpenGLWidget Superclass;
+public:
+ //a:real effect
+ //b:corner info update
+ //c:scroll value sync
+ explicit DicomImageView(QWidget* parent = Q_NULLPTR);
+ ~DicomImageView() override;
+
+
+ void ShowMetaData();
+ myQVTKOpenGLNativeWidget* getGLWidget()
+ {
+ return _glWidt;
+ }
+ vtkGenericOpenGLRenderWindow* getRenWin()
+ {
+ return m_glrenWin;
+ }
+ infinitiViewer* getImageViewer()
+ {
+ return _ImageViewer;
+ }
+
+ void setScrollChangedType(int type)
+ {
+ _ScrollTriggerType = type;
+ }
+ void setHighlight(bool yes);
+ void Render();
+
+ //Series
+ void setDicomImageView(SeriesInstance *series);
+ bool HasSeries();
+ int getSeriesNumber();
+ SeriesInstance* getSeriesInstance()
+ {
+ return _Series;
+ }
+
+ //Reset
+ void ResetView();
+
+
+ //Corner Info
+ void updateCornerInfoAll();
+ void updateCornerInfoPrivacy();
+
+ //Window level
+ void getWindowLevel(double &level, double &width);
+ void setWindowLevel(double level, double width);
+
+ //Transformation
+ void ClearTransformations();
+ void HFlip();
+ void VFlip();
+ void Rotate(double angle, TransFormType operation);
+
+
+ //Fusion
+ bool IsFusion();
+ void IncreFusionOpacity(double percent);
+ void SetFusionInput(DicomImageView *overlap);
+ void removeViewWithFusion();
+
+
+ //Measure
+ void ActiveMeasure(Measure *m);
+ void DeleteSelectedMeasure();
+ void DeleteCurrentSliceMeasure();
+ void DeleteCurrentSeriesMeasure();
+ void removeViewWithMeasure();
+
+
+ //Sync slice
+ void AddSlice(int step);
+ void SetSlice(int slice);
+ void SetZoomScale(double scale);
+ void SetPanOffset(double * p);
+
+ //CineMode
+ void onFirstFrame();
+ void onPreviousFrame();
+ void onNextFrame();
+ void onLastFrame();
+ bool IsCine() { return isCine; }
+ void cineModeOn();
+ bool isVCRVisible();
+ void setVCRVisible(bool);
+ void setVCRToolbar(pqVCRToolbar* toolbar)
+ {
+ _vcr_toolbar = toolbar;
+ }
+ pqVCRToolbar* getVCRToolbar()
+ {
+ return _vcr_toolbar;
+ }
+ pqVCRController* getVCRController()
+ {
+ return _vcr_ctrl;
+ }
+
+ //Negative
+ void ToggleNegativeMode();
+
+
+signals:
+ /**
+ * This signal will be emitted whenever a mouse event occurs within the QVTK window.
+ */
+
+ void scroll_ValueChanged(int);
+ void Signal_ViewEmpty(DicomImageView *view);
+ void Signal_ViewClicked(DicomImageView *view);
+ void Signal_viewDoubleclicked(DicomImageView *view);
+ void Signal_scrollValueChanged(DicomImageView *view, int slice);
+ void Signal_DragDropEvent(DicomImageView *view,thumbnailImage* tb);
+ void Signal_SyncEvent(DicomImageView *view, int interactionMode,void* calldata);
+ void Signal_WindowLevelEventForFusion(double level,double width);
+ void Signal_Transformation(TransFormType);
+
+public slots:
+ //for title bar use
+ void Slot_viewDoubleclicked();
+ void Slot_ViewEmpty();
+ void Slot_scrollValueChanged(int);
+ void Slot_WindowLevelEventForFusion(double level, double width);
+ void Slot_UpdateOrienInfo(TransFormType);
+
+protected:
+ void mousePressEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
+ void mouseReleaseEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
+ void mouseDoubleClickEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
+
+ void dragEnterEvent(QDragEnterEvent *e);
+ void dragMoveEvent(QDragMoveEvent *e);
+ void dropEvent(QDropEvent *e);
+ void dragLeaveEvent(QDragLeaveEvent *e);
+ void resizeEvent(QResizeEvent *event);
+
+
+private:
+ void removeFusion();
+
+ void OverlayOn()
+ {
+ isOverlay = true;
+ }
+ void OverlayOff()
+ {
+ isOverlay = false;
+ }
+ bool IsOverlay()
+ {
+ return isOverlay;
+ }
+ void SetBaseView(DicomImageView *v)
+ {
+ _base = v;
+ }
+ void SetOverlayView(DicomImageView *v)
+ {
+ _overlay = v;
+ }
+
+
+
+ //Callback
+ void doubleclickedEventCb(vtkObject* sender, unsigned long eventId, void* calldata = nullptr);
+ void scalarEventCb(vtkObject* sender, unsigned long eventId, void* calldata = nullptr);
+ void updateWindowLevelCb(vtkObject*caller, unsigned long eid, void *calldata);
+ void syncEventFunc(vtkObject*caller, unsigned long eid, void *calldata);
+
+
+ void initCineModeThread();
+ MyTitleBar* createMyTitleBar();
+ void orphanizeSeriesInstance();
+ void ResetPanZoom();
+
+ //bool deleteOlderSeries(SeriesInstance* old);
+ void initScrollbar();
+ void CopyFromSeries(SeriesInstance *series);
+
+ vtkSmartPointer m_glrenWin;
+
+ infinitiViewer* _ImageViewer = nullptr;
+ SeriesInstance* _Series =nullptr;
+ QScrollBar* _scrollBar =nullptr;
+ MyTitleBar *_titleBar =nullptr;
+ myQVTKOpenGLNativeWidget* _glWidt = nullptr;
+ pqVCRToolbar* _vcr_toolbar = nullptr;
+ pqVCRController *_vcr_ctrl = nullptr;
+ QThread _thread;
+ DicomImageView *_overlay = nullptr;
+ DicomImageView *_base = nullptr;
+
+ int _SliceStep =0;
+ int _PrevSlice =0;
+ int _ScrollTriggerType = scrollScope::TriggerType::USER_TRIGGER;
+
+ bool isCine = false;
+ bool isNegative = false;
+ bool isOverlay = false;
+};
diff --git a/src/include/view/myQVTKOpenGLNativeWidget.h b/src/include/view/myQVTKOpenGLNativeWidget.h
new file mode 100644
index 0000000..455f062
--- /dev/null
+++ b/src/include/view/myQVTKOpenGLNativeWidget.h
@@ -0,0 +1,289 @@
+/*=========================================================================
+
+ Program: Visualization Toolkit
+ Module: myQVTKOpenGLNativeWidget.h
+
+ Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
+ All rights reserved.
+ See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notice for more information.
+
+=========================================================================*/
+/**
+ * @class myQVTKOpenGLNativeWidget
+ * @brief QOpenGLWidget subclass to house a vtkGenericOpenGLRenderWindow in a Qt
+ * application.
+ *
+ * myQVTKOpenGLNativeWidget extends QOpenGLWidget to make it work with a
+ * vtkGenericOpenGLRenderWindow. This is akin to QVTKWidget except it uses Qt to create and
+ * manage the OpenGL context using QOpenGLWidget (added in Qt 5.4).
+ *
+ * While myQVTKOpenGLNativeWidget is intended to be a replacement for QVTKWidget when
+ * using Qt 5, there are a few difference between myQVTKOpenGLNativeWidget and
+ * QVTKWidget.
+ *
+ * Unlike QVTKWidget, myQVTKOpenGLNativeWidget only works with vtkGenericOpenGLRenderWindow.
+ * This is necessary since QOpenGLWidget wants to take over the window management as
+ * well as the OpenGL context creation. Getting that to work reliably with
+ * vtkXRenderWindow or vtkWin32RenderWindow (and other platform specific
+ * vtkRenderWindow subclasses) was tricky and fraught with issues.
+ *
+ * Since myQVTKOpenGLNativeWidget uses QOpenGLWidget to create the OpenGL context,
+ * it uses QSurfaceFormat (set using `QOpenGLWidget::setFormat` or
+ * `QSurfaceFormat::setDefaultFormat`) to create appropriate window and context.
+ * You can use `myQVTKOpenGLNativeWidget::copyToFormat` to obtain a QSurfaceFormat
+ * appropriate for a vtkRenderWindow.
+ *
+ * A typical usage for myQVTKOpenGLNativeWidget is as follows:
+ * @code{.cpp}
+ *
+ * // before initializing QApplication, set the default surface format.
+ * QSurfaceFormat::setDefaultFormat(myQVTKOpenGLNativeWidget::defaultFormat());
+ *
+ * vtkNew window;
+ * QPointer widget = new myQVTKOpenGLNativeWidget(...);
+ * widget->SetRenderWindow(window.Get());
+ *
+ * // If using any of the standard view e.g. vtkContextView, then
+ * // you can do the following.
+ * vtkNew view;
+ * view->SetRenderWindow(window.Get());
+ *
+ * // You can continue to use `window` as a regular vtkRenderWindow
+ * // including adding renderers, actors etc.
+ *
+ * @endcode
+ *
+ * @section OpenGLContext OpenGL Context
+ *
+ * In QOpenGLWidget (superclass for myQVTKOpenGLNativeWidget), all rendering happens in a
+ * framebuffer object. Thus, care must be taken in the rendering code to never
+ * directly re-bind the default framebuffer i.e. ID 0.
+ *
+ * myQVTKOpenGLNativeWidget creates an internal QOpenGLFramebufferObject, independent of the
+ * one created by superclass, for vtkRenderWindow to do the rendering in. This
+ * explicit double-buffering is useful in avoiding temporary back-buffer only
+ * renders done in VTK (e.g. when making selections) from destroying the results
+ * composed on screen.
+ *
+ * @section RenderAndPaint Handling Render and Paint.
+ *
+ * QWidget subclasses (including `QOpenGLWidget` and `myQVTKOpenGLNativeWidget`) display
+ * their contents on the screen in `QWidget::paint` in response to a paint event.
+ * `QOpenGLWidget` subclasses are expected to do OpenGL rendering in
+ * `QOpenGLWidget::paintGL`. QWidget can receive paint events for various
+ * reasons including widget getting focus/losing focus, some other widget on
+ * the UI e.g. QProgressBar in status bar updating, etc.
+ *
+ * In VTK applications, any time the vtkRenderWindow needs to be updated to
+ * render a new result, one call `vtkRenderWindow::Render` on it.
+ * vtkRenderWindowInteractor set on the render window ensures that as
+ * interactions happen that affect the rendered result, it calls `Render` on the
+ * render window.
+ *
+ * Since paint in Qt can be called more often then needed, we avoid potentially
+ * expensive `vtkRenderWindow::Render` calls each time that happens. Instead,
+ * myQVTKOpenGLNativeWidget relies on the VTK application calling
+ * `vtkRenderWindow::Render` on the render window when it needs to update the
+ * rendering. `paintGL` simply passes on the result rendered by the most render
+ * vtkRenderWindow::Render to Qt windowing system for composing on-screen.
+ *
+ * There may still be occasions when we may have to render in `paint` for
+ * example if the window was resized or Qt had to recreate the OpenGL context.
+ * In those cases, `myQVTKOpenGLNativeWidget::paintGL` can request a render by calling
+ * `myQVTKOpenGLNativeWidget::renderVTK`.
+ *
+ * @section Caveats
+ * myQVTKOpenGLNativeWidget only supports **OpenGL2** rendering backend.
+ * myQVTKOpenGLNativeWidget does not support stereo,
+ * please use QVTKOpenGLWidget if you need support for stereo rendering
+ *
+ * myQVTKOpenGLNativeWidget is targeted for Qt version 5.5 and above.
+ *
+ */
+#ifndef myQVTKOpenGLNativeWidget_h
+#define myQVTKOpenGLNativeWidget_h
+
+#include
+
+#include "QVTKInteractor.h" // needed for QVTKInteractor
+#include "vtkGUISupportQtModule.h" // for export macro
+#include "vtkNew.h" // needed for vtkNew
+#include "vtkSmartPointer.h" // needed for vtkSmartPointer
+
+class QOpenGLDebugLogger;
+class QOpenGLFramebufferObject;
+class QVTKInteractor;
+class QVTKInteractorAdapter;
+class QVTKOpenGLNativeWidgetObserver;
+class vtkGenericOpenGLRenderWindow;
+class DicomImageView;
+
+//class VTKGUISUPPORTQT_EXPORT myQVTKOpenGLNativeWidget : public QOpenGLWidget
+class myQVTKOpenGLNativeWidget : public QOpenGLWidget
+{
+ Q_OBJECT
+ typedef QOpenGLWidget Superclass;
+public:
+ myQVTKOpenGLNativeWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ ~myQVTKOpenGLNativeWidget() override;
+
+ //@{
+ /**
+ * Get/Set the currently used vtkGenericOpenGLRenderWindow.
+ * GetRenderWindow() creates and returns a new vtkGenericOpenGLRenderWindow
+ * if it is not already provided.
+ */
+ void SetImageView(DicomImageView *v);
+ DicomImageView* GetImageView();
+
+ void SetRenderWindow(vtkGenericOpenGLRenderWindow* win);
+ void SetRenderWindow(vtkRenderWindow* win);
+ virtual vtkRenderWindow* GetRenderWindow();
+ //@}
+
+ /**
+ * Get the QEvent to VTK events translator.
+ */
+ virtual QVTKInteractorAdapter* GetInteractorAdapter() { return this->InteractorAdapter; }
+
+ /**
+ * Get the QVTKInteractor that was either created by default or set by the user.
+ */
+ virtual QVTKInteractor* GetInteractor();
+
+ /**
+ * Sets up vtkRenderWindow ivars using QSurfaceFormat.
+ */
+ static void copyFromFormat(const QSurfaceFormat& format, vtkRenderWindow* win);
+
+ /**
+ * Using the vtkRenderWindow, setup QSurfaceFormat.
+ */
+ static void copyToFormat(vtkRenderWindow* win, QSurfaceFormat& format);
+
+ /**
+ * Returns a typical QSurfaceFormat suitable for most applications using
+ * myQVTKOpenGLNativeWidget. Note that this is not the QSurfaceFormat that gets used
+ * if none is specified. That is set using `QSurfaceFormat::setDefaultFormat`.
+ */
+ static QSurfaceFormat defaultFormat();
+
+ /**
+ * Enable or disable support for HiDPI displays.
+ */
+ virtual void setEnableHiDPI(bool enable);
+ virtual bool enableHiDPI() { return this->EnableHiDPI; }
+
+ /**
+ * Set the cursor on this widget.
+ */
+ void setQVTKCursor(const QCursor &cursor);
+
+signals:
+ /**
+ * This signal will be emitted whenever a mouse event occurs within the QVTK window.
+ */
+ void mouseEvent(QMouseEvent* event);
+
+protected slots:
+ /**
+ * Called as a response to `QOpenGLContext::aboutToBeDestroyed`. This may be
+ * called anytime during the widget lifecycle. We need to release any OpenGL
+ * resources allocated in VTK work in this method.
+ */
+ virtual void cleanupContext();
+
+private slots:
+ /**
+ * recreates the FBO used for VTK rendering.
+ */
+ void recreateFBO();
+
+ /**
+ * called before the render window starts to render. We ensure that this->FBO
+ * is bound and ready to use.
+ */
+ void startEventCallback();
+
+ /**
+ * callback for changing the cursor. Called when vtkGenericOpenGLRenderWindow
+ * fires the CursorChangedEvent.
+ */
+ void cursorChangedCallback(vtkObject* caller, unsigned long vtk_event,
+ void* client_data, void* call_data);
+
+protected:
+ //virtual void wheelEvent(QWheelEvent *event);
+
+ bool event(QEvent* evt) Q_DECL_OVERRIDE;
+ void initializeGL() Q_DECL_OVERRIDE;
+ void resizeGL(int w, int h) Q_DECL_OVERRIDE;
+ void paintGL() Q_DECL_OVERRIDE;
+
+ //void mousePressEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
+ //void mouseMoveEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
+ //void mouseReleaseEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
+ //void mouseDoubleClickEvent(QMouseEvent* event) Q_DECL_OVERRIDE;
+
+ /**
+ * This method is called to indicate that vtkRenderWindow needs to reinitialize
+ * itself before the next render (done in myQVTKOpenGLNativeWidget::paintGL).
+ * This is needed when the context gets recreated
+ * or the default FrameBufferObject gets recreated, for example.
+ */
+ void requireRenderWindowInitialization();
+
+ /**
+ * This method may be called in `paintGL` to request VTK to do a render i.e.
+ * trigger render on the render window via its interactor.
+ *
+ * It will return true if render (or an equivalent action) was performed to
+ * update the frame buffer made available to VTK for rendering with latest
+ * rendering.
+ *
+ * Default implementation never returns false. However, subclasses can return
+ * false to indicate to myQVTKOpenGLNativeWidget that it cannot generate a reasonable
+ * image to be displayed in myQVTKOpenGLNativeWidget. In which case, the `paintGL`
+ * call will return leaving the `defaultFramebufferObject` untouched.
+ *
+ * Since by default `QOpenGLWidget::UpdateBehavior` is set to
+ * QOpenGLWidget::PartialUpdate, this means whatever was rendered in the frame
+ * buffer in most recent successful call will be preserved, unless the widget
+ * was forced to recreate the FBO as a result of resize or screen change.
+ *
+ * @sa Section @ref RenderAndPaint.
+ */
+ virtual bool renderVTK();
+
+protected:
+ vtkSmartPointer RenderWindow;
+ QVTKInteractorAdapter* InteractorAdapter;
+
+ bool EnableHiDPI;
+ int OriginalDPI;
+
+ static const double DevicePixelRatioTolerance;
+
+private:
+ Q_DISABLE_COPY(myQVTKOpenGLNativeWidget);
+
+ /**
+ * Called when vtkCommand::WindowFrameEvent is fired by the
+ * vtkGenericOpenGLRenderWindow.
+ */
+ void windowFrameEventCallback();
+
+ QOpenGLFramebufferObject* FBO;
+ bool InPaintGL;
+ bool DoVTKRenderInPaintGL;
+ vtkNew Observer;
+ friend class QVTKOpenGLNativeWidgetObserver;
+ QOpenGLDebugLogger* Logger;
+ DicomImageView *view;
+};
+
+#endif
diff --git a/src/include/view/subview/DicomTreeModel.h b/src/include/view/subview/DicomTreeModel.h
new file mode 100644
index 0000000..9a8a066
--- /dev/null
+++ b/src/include/view/subview/DicomTreeModel.h
@@ -0,0 +1,41 @@
+/* This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ */
+
+#ifndef DICOMTREEMODEL_H
+#define DICOMTREEMODEL_H
+
+#include
+#include
+#include
+class DcmFileFormat;
+
+/*! Model for a tree view to represent DICOM dataset structire.
+ */
+
+
+class DicomTreeModel : public QStandardItemModel
+{
+ Q_OBJECT
+
+public:
+
+ DicomTreeModel(DcmFileFormat *file, QObject *parent = 0);
+
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+
+private:
+ //Attach list of tags to tree model item.
+ template
+ static void attachTagList(QStandardItem *item, T *dataset);
+
+};
+
+#endif // DICOMTREEMODEL_H
diff --git a/src/include/view/subview/customwindow.h b/src/include/view/subview/customwindow.h
new file mode 100644
index 0000000..bab744d
--- /dev/null
+++ b/src/include/view/subview/customwindow.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include
+#include "ui_customwindow.h"
+
+class DicomImageView;
+class Customwindow : public QDialog
+{
+ Q_OBJECT
+
+public:
+ Customwindow(QWidget *parent = Q_NULLPTR);
+ ~Customwindow();
+
+ void setCurrentView(DicomImageView *cur);
+
+public slots:
+ void onBtnOKClicked();
+ void onBtnCancelClicked();
+
+private:
+ Ui::Customwindow ui;
+ DicomImageView *m_curV;
+};
diff --git a/src/include/view/subview/gridpopwidget.h b/src/include/view/subview/gridpopwidget.h
new file mode 100644
index 0000000..7c86876
--- /dev/null
+++ b/src/include/view/subview/gridpopwidget.h
@@ -0,0 +1,31 @@
+#ifndef GRIDPOPWIDGET_H
+#define GRIDPOPWIDGET_H
+
+#include
+
+namespace Ui {
+ class GridPopWidget;
+}
+
+class GridPopWidget : public QWidget {
+ Q_OBJECT
+
+ public:
+ explicit GridPopWidget(QWidget *parent = nullptr);
+ ~GridPopWidget();
+
+ signals:
+ void Signal_ViewLayout(int col, int row);
+
+ protected:
+ void mousePressEvent(QMouseEvent *e);
+ void mouseMoveEvent(QMouseEvent *e);
+ void hideEvent(QHideEvent *e);
+
+ private:
+ Ui::GridPopWidget *ui;
+
+ QList > wArr;
+};
+
+#endif // GRIDPOPWIDGET_H
diff --git a/src/include/view/subview/importtitlebar.h b/src/include/view/subview/importtitlebar.h
new file mode 100644
index 0000000..434d738
--- /dev/null
+++ b/src/include/view/subview/importtitlebar.h
@@ -0,0 +1,46 @@
+#ifndef _IMPORTTITLEBAR_H_
+#define _IMPORTTITLEBAR_H_
+
+#include
+
+class QButtonGroup;
+class QHBoxLayout;
+class QLabel;
+class QSpacerItem;
+class QPushButton;
+
+class ImportTitleBar : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit ImportTitleBar(QWidget *parent = Q_NULLPTR);
+ ~ImportTitleBar();
+
+ void setTitleText(const QString& title);
+
+public slots:
+ void onButtonClicked(int index);
+
+signals:
+ void sigClose();
+ void sigShowMaximum();
+ void sigShowMinimum();
+
+private:
+ void initUi();
+ void initSys();
+
+private:
+ QHBoxLayout *m_pMainLayout;
+ QLabel *m_pLogoLabel;
+ QLabel *m_pTitleLabel;
+ QSpacerItem *m_pSpacerItem;
+ QPushButton *m_pCloseButton;
+ QPushButton *m_pMinimumButton;
+ QPushButton *m_pMaximumButton;
+ QButtonGroup *m_pButtonGroup;
+};
+
+#endif // !_IMPORTTITLEBAR_H_
+
diff --git a/src/include/view/subview/importwidget.h b/src/include/view/subview/importwidget.h
new file mode 100644
index 0000000..762cd37
--- /dev/null
+++ b/src/include/view/subview/importwidget.h
@@ -0,0 +1,142 @@
+#ifndef _IMPORTWIDGET_H_
+#define _IMPORTWIDGET_H_
+
+#include
+#include
+#include
+#include
+#include
+#include "base/dicomviewerhelper.h"
+#include "base/dicomviewertype.h"
+#include "queryworker.h"
+#include "moveworker.h"
+#include "radiusprogressbar.h"
+//#include "radiusprogressbar.h"
+
+class QVBoxLayout;
+class QGridLayout;
+class QHBoxLayout;
+class QPushButton;
+class QComboBox;
+class QDateEdit;
+class QLineEdit;
+class QTableView;
+class QStandardItemModel;
+class QItemSelectionModel;
+class ConfigurationDialog;
+class PromptDialog;
+class CallbackHelper;
+class DcmDataset;
+class QProgressBar;
+class QSpacerItem;
+
+class ImportWidget : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit ImportWidget(QWidget *parent = Q_NULLPTR);
+ ~ImportWidget();
+
+signals:
+ void sigMoveDone(int code, std::string dir);
+
+public slots:
+ void close();
+ void showMaximum();
+ void showMinumum();
+ void query();
+ void clear();
+ void configure();
+ void onPacsInfoUpdated();
+ void onDateFilterChanged(const QString &);
+
+ void onTitleBarDestroyed();
+
+ void onQueryDone(int);
+ void onStudyFoundResult(PACSStudyInfo);
+ void onSeriesFoundResult(PACSSeriesInfo);
+ //////void onFoundResult(int index, DcmDataset *response);
+ void onStudySelected(const QModelIndex &);
+ void onSeriesSelected(const QModelIndex &);
+ void onSeriesDoubleClicked(const QModelIndex &);
+ void moveDone(int, QString);
+ void moveProgress(int, int);
+ void moveStoreProgress(int, std::string);
+
+protected:
+ virtual bool eventFilter(QObject *obj, QEvent *event);
+
+private:
+ void initUi();
+ void initSys();
+ void initFilterPacs();
+ void initFilterModality();
+ void initFilterDate();
+ void initFilterDicom();
+ void initStudyHeader();
+ void initStudy();
+ void initSeriesHeader();
+ void initSeries();
+ void getNetParams(std::string& peerIP, unsigned long& peerPort, std::string& peerTitle, unsigned long& ourPort, std::string& ourTitle);
+ void updateStudyView();
+ void updateSeriesView();
+ void getDateIntervalForQuery(QString& startDate, QString& endDate);
+
+private:
+ QVBoxLayout *m_pMainLayout;
+ QWidget *m_pTitleBar;
+ QGridLayout *m_pFilterLayout;
+ QPushButton *m_pSettingButton;
+ QComboBox *m_pPacsComboBox;
+ QComboBox *m_pModalityComboBox;
+ QDateEdit *m_pStartDate;
+ QDateEdit *m_pEndDate;
+ QComboBox *m_pDicomComboBox;
+ QComboBox *m_pDateComboBox;
+ QLineEdit *m_pDicomEdit;
+ QPushButton *m_pSearchButton;
+ QPushButton *m_pClearButton;
+ QTableView *m_pStudyResult;
+ QTableView *m_pSeriesResult;
+
+ QWidget *m_pFilterWidget;
+ QWidget *m_pProgressWidget;
+ QHBoxLayout *m_pProgressLayout;
+ QSpacerItem *m_pProgressItem;
+ QProgressBar *m_pProgressBar;
+ //RadiusProgressBar *m_pProgressBar;
+
+ ConfigurationDialog *m_pSettingDialog;
+ PromptDialog* m_pMsgBox;
+ QList m_lHosts;
+
+ QStandardItemModel *m_pStudyModel;
+ //QItemSelectionModel *m_pStudySelectionModel;
+ QStringList m_lStudyHeaders;
+
+ QStandardItemModel *m_pSeriesModel;
+ //QItemSelectionModel *m_pSeriesSelectionModel;
+ QStringList m_lSeriesHeaders;
+
+ CallbackHelper *m_CallbackHelper;
+ QList m_studyInfo;
+ QList m_seriesInfo;
+
+ int currentSeriesRow;
+
+ QThread* m_pQueryWorkerThread;
+ QueryWorker* m_pQueryWorker;
+ QThread* m_pMoveWorkerThread;
+ MoveWorker* m_pMoveWorker;
+
+private:
+ struct
+ {
+ bool dragging;
+ QPoint dragStartPosition;
+ } m_dragState;
+
+};
+
+#endif // !_IMPORTWIDGET_H_
diff --git a/src/include/view/subview/metaDataWindow.h b/src/include/view/subview/metaDataWindow.h
new file mode 100644
index 0000000..3635ed5
--- /dev/null
+++ b/src/include/view/subview/metaDataWindow.h
@@ -0,0 +1,32 @@
+#pragma once
+#include
+#include
+#include
+#include
+#include "DicomTreeModel.h"
+
+class DcmFileFormat;
+class DcmDataset;
+class metaDataWindow : public QMdiSubWindow
+{
+ Q_OBJECT
+
+public:
+ metaDataWindow(DcmFileFormat *file, QWidget *parent = 0);
+ ~metaDataWindow();
+
+ /**
+ * Tells whether this DICOM window displays an image.
+ * @return true if there is an image displayed.
+ */
+ bool containsImage() const;
+private:
+ Q_DISABLE_COPY(metaDataWindow)
+
+ DcmFileFormat *m_file = nullptr;
+ //DcmDataset *m_dataset = nullptr;
+ DicomTreeModel *m_treeModel;
+ QTreeView *m_treeView;
+ bool m_valid;
+};
+
diff --git a/src/include/view/subview/moveworker.h b/src/include/view/subview/moveworker.h
new file mode 100644
index 0000000..f5908b4
--- /dev/null
+++ b/src/include/view/subview/moveworker.h
@@ -0,0 +1,40 @@
+#ifndef _MOVEWORKER_H_
+#define _MOVEWORKER_H_
+
+#include
+#include "../../../include/base/dicomviewertype.h"
+#include "../../../include/callback/callbackhelper.h"
+#include "../../../include/callback/cmovecallback.h"
+#include "../../../include/callback/cmovestorescpcallback.h"
+
+
+class MoveWorker : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit MoveWorker(const QString& peerIP, unsigned long long peerPort, const QString& peerTitle, unsigned long long ourPort, const QString& ourTitle, const QString& outputDirectory, QObject *parent = Q_NULLPTR);
+ void setOutputDirectory(const QString& outputDir);
+ Q_INVOKABLE void moveBySeriesUID(const QString& studyInstanceUID, const QString& seriesInstanceUID);
+
+signals:
+ void notifyMoveDone(int, QString dir);
+ void notifyMoveProgress(int, int);
+ void notifyMoveStoreProgress(int, std::string);
+
+public slots:
+ void onMoveProgress(int, int);
+ void onMoveStoreProgress(int, std::string);
+
+private:
+ QString m_strPeerIP_;
+ unsigned long long m_ulPeerPort_;
+ QString m_strPeerTitle_;
+ unsigned long long m_ulOurPort_;
+ QString m_strOurTitle_;
+ QString m_strOutputDirectory_;
+ CallbackHelper* m_pCallbackHelper;
+};
+
+
+#endif // !_MOVEWORKER_H_
diff --git a/src/include/view/subview/mytitlebar.h b/src/include/view/subview/mytitlebar.h
new file mode 100644
index 0000000..0665e2f
--- /dev/null
+++ b/src/include/view/subview/mytitlebar.h
@@ -0,0 +1,106 @@
+#include
+#include
+#include
+#include
+
+//enum ButtonType
+//{
+// MIN_BUTTON = 0, // Minimize and close buttons;
+// MIN_MAX_BUTTON , // Minimize, maximize and close buttons;
+// ONLY_CLOSE_BUTTON // Only close button;
+//};
+
+class MyTitleBar : public QFrame
+{
+ Q_OBJECT
+
+public:
+ MyTitleBar(QWidget *parent);
+ //Here parent does not give the default value of NULL, to ensure that the parent pointer must be assigned when the MyTitleBar object is created; and the assignment is not NULL;
+ ~MyTitleBar();
+ void SetHighlight(bool yes);
+ // Set the background color of the title bar and whether to set the background color of the title bar to be transparent;
+//protected:
+// void paintEvent(QPaintEvent *event);
+
+ // Set the button type on the title bar;
+ //void setButtonType(ButtonType buttonType);
+ // Set whether the title in the title bar will scroll; you can see the effect for details;
+ //void setTitleRoll();
+ // Set the width of the window border;
+ //void setWindowBorderWidth(int borderWidth);
+
+ // Save/Get the position and size of the window before maximizing;
+ //void saveRestoreInfo(const QPoint point, const QSize size);
+ //void getRestoreInfo(QPoint& point, QSize& size);
+
+private:
+ // Set the title bar icon;
+ void setTitleIcon(QString filePath, QSize IconSize = QSize(25, 25));
+ // Set the title content;
+ void setTitleContent(QString titleContent, int titleFontSize = 9);
+ // Set the length of the title bar;
+ void setTitleWidth(int width);
+ void setBackgroundColor(QColor pickColor);
+
+
+ void mouseDoubleClickEvent(QMouseEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+ // void mouseMoveEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+
+ // Initialize the control;
+ void initControl();
+ // Binding of signal slots;
+ void initConnections();
+ // Load the style file;
+ void loadStyleSheet(const QString &sheetName);
+
+signals:
+ // The signal triggered by the button;
+ //void signalViewClicked();
+ void signalButtonMaxClicked();
+ void signalButtonCloseClicked();
+
+private slots:
+ // The slot triggered by the button;
+ // void onButtonMinClicked();
+ //void onButtonRestoreClicked();
+ void onButtonMaxClicked();
+ void onButtonCloseClicked();
+ //void onRollTitle();
+
+private:
+ QLabel* m_pIcon; // title bar icon;
+ QLabel* m_pTitleContent; // Title bar content;
+ //QPushButton* m_pButtonMin; // Minimize button;
+ //QPushButton* m_pButtonRestore; // Maximize restore button;
+ QPushButton* m_pButtonMax; // Maximize button;
+ QPushButton* m_pButtonClose; // Close button;
+
+ //QColor m_color;
+ // The background color of the title bar;
+ // int m_colorR;
+ // int m_colorG;
+ // int m_colorB;
+ //int m_alpha;
+ // maximize and minimize variables;
+ // QPoint m_restorePos;
+ //QSize m_restoreSize;
+ // Variables of moving window;
+ bool m_isPressed;
+ // QPoint m_startMovePos;
+ // marquee effect clock in title bar;
+ // QTimer m_titleRollTimer;
+ // Title bar content;
+ QString m_titleContent;
+ // Button type;
+ //ButtonType m_buttonType;
+ // width of window border;
+ //int m_windowBorderWidth;
+ // Whether the title bar is transparent;
+ //bool m_isTransparent;
+
+ QIcon icon_close;
+ QIcon icon_max;
+};
diff --git a/src/include/view/subview/pacsconfiguration.h b/src/include/view/subview/pacsconfiguration.h
new file mode 100644
index 0000000..469d079
--- /dev/null
+++ b/src/include/view/subview/pacsconfiguration.h
@@ -0,0 +1,110 @@
+#ifndef _PACS_CONFIGURATION_H_
+#define _PACS_CONFIGURATION_H_
+
+#include