first commit

This commit is contained in:
xueyan hu
2022-01-24 10:10:45 +08:00
commit b2842e622c
202 changed files with 22619 additions and 0 deletions

157
src/Combinear.qss Normal file
View File

@@ -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;
}

BIN
src/Icon/angle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/Icon/anno.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
src/Icon/arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/Icon/cine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
src/Icon/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/Icon/cursor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/Icon/distance.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/Icon/ellipse.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
src/Icon/flip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
src/Icon/full_screen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/Icon/fusion.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/Icon/grid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/Icon/hidden.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
src/Icon/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/Icon/import.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/Icon/import2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
src/Icon/line.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
src/Icon/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
src/Icon/max.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/Icon/minimize.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

BIN
src/Icon/openfile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/Icon/pan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/Icon/polygon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
src/Icon/polyline.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
src/Icon/pq/pqApply.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/Icon/pq/pqBold24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

BIN
src/Icon/pq/pqCancel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
src/Icon/pq/pqDelete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

BIN
src/Icon/pq/pqItalics24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
src/Icon/pq/pqShadow24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

BIN
src/Icon/pq/pqVcrBack.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

BIN
src/Icon/pq/pqVcrFirst.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

BIN
src/Icon/pq/pqVcrFpsUp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

BIN
src/Icon/pq/pqVcrLast.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

BIN
src/Icon/pq/pqVcrPause.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

BIN
src/Icon/pq/pqVcrPlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

BIN
src/Icon/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/Icon/slice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
src/Icon/sync/sync_auto.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/Icon/sync/sync_dis.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/Icon/text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/Icon/textProp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
src/Icon/trashbin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B

BIN
src/Icon/triangle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

BIN
src/Icon/windowlevel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
src/Icon/zoom.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

67
src/QDicomViewer.qrc Normal file
View File

@@ -0,0 +1,67 @@
<RCC>
<qresource prefix="/importwidget">
<file>Resources/import/add.png</file>
<file>Resources/import/arrow.png</file>
<file>Resources/import/close.png</file>
<file>Resources/import/icon.png</file>
<file>Resources/import/max.png</file>
<file>Resources/import/max_ba.png</file>
<file>Resources/import/min.png</file>
<file>Resources/import/remove.png</file>
<file>Resources/import/setting.png</file>
</qresource>
<qresource prefix="/StyleSheet">
<file>Combinear.qss</file>
</qresource>
<qresource prefix="/InfiniteViewer">
<file>Icon/angle.png</file>
<file>Icon/distance.png</file>
<file>Icon/grid.png</file>
<file>Icon/hidden.png</file>
<file>Icon/openfile.png</file>
<file>Icon/pan.png</file>
<file>Icon/windowlevel.png</file>
<file>Icon/zoom.png</file>
<file>Icon/sync/sync_auto.png</file>
<file>Icon/sync/sync_dis.png</file>
<file>Icon/sync/sync_manual.png</file>
<file>Icon/save.png</file>
<file>Icon/anno.png</file>
<file>Icon/flip.png</file>
<file>Icon/cine.png</file>
<file>Icon/fusion.png</file>
<file>Icon/trashbin.png</file>
<file>Icon/slice.png</file>
<file>Icon/import.png</file>
<file>Icon/logo.png</file>
<file>Icon/close.png</file>
<file>Icon/max.png</file>
<file>Icon/triangle-down-black.png</file>
<file>Icon/triangle-down-white.png</file>
<file>Icon/text.png</file>
<file>Icon/ellipse.png</file>
<file>Icon/textProp.png</file>
<file>Icon/arrow.png</file>
<file>Icon/polygon.png</file>
<file>Icon/polyline.png</file>
<file>Icon/full_screen.png</file>
<file>Icon/maximize-restore.png</file>
<file>Icon/minimize.png</file>
</qresource>
<qresource prefix="/pqWidgets">
<file>Icon/pq/pqBold24.png</file>
<file>Icon/pq/pqItalics24.png</file>
<file>Icon/pq/pqShadow24.png</file>
<file>Icon/pq/pqApply.png</file>
<file>Icon/pq/pqCancel.png</file>
<file>Icon/pq/pqDelete.png</file>
<file>Icon/pq/pqVcrBack.png</file>
<file>Icon/pq/pqVcrFirst.png</file>
<file>Icon/pq/pqVcrForward.png</file>
<file>Icon/pq/pqVcrFpsDown.png</file>
<file>Icon/pq/pqVcrFpsUp.png</file>
<file>Icon/pq/pqVcrLast.png</file>
<file>Icon/pq/pqVcrPause.png</file>
<file>Icon/pq/pqVcrPlay.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

166
src/form/QDicomViewer.ui Normal file
View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QDicomViewerClass</class>
<widget class="QMainWindow" name="QDicomViewerClass">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1099</width>
<height>761</height>
</rect>
</property>
<property name="windowTitle">
<string>QDicomViewer</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QWidget" name="centralWidget">
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="main_widget" native="true">
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="ThumbnailBarWidget" name="thumbnailBar" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Britannic Bold</family>
</font>
</property>
</widget>
</item>
<item>
<widget class="ViewContainerWidget" name="viewContainer" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="floatable">
<bool>false</bool>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>ViewContainerWidget</class>
<extends>QWidget</extends>
<header>view/viewcontainerwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ThumbnailBarWidget</class>
<extends>QWidget</extends>
<header location="global">view/thumbnailbarwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../QDicomViewer.qrc"/>
<include location="../QDicomViewer.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>calibrationWidget</class>
<widget class="QDialog" name="calibrationWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>321</width>
<height>96</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
</font>
</property>
<property name="windowTitle">
<string>Length Calibration</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<family>Arial</family>
</font>
</property>
<property name="text">
<string>Enter new distance</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="led_TextInput"/>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>mm</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>131</width>
<height>31</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okButton">
<property name="font">
<font>
<family>Arial</family>
</font>
</property>
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="font">
<font>
<family>Arial</family>
</font>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>okButton</sender>
<signal>clicked()</signal>
<receiver>calibrationWidget</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>278</x>
<y>253</y>
</hint>
<hint type="destinationlabel">
<x>96</x>
<y>254</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancelButton</sender>
<signal>clicked()</signal>
<receiver>calibrationWidget</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>369</x>
<y>253</y>
</hint>
<hint type="destinationlabel">
<x>179</x>
<y>282</y>
</hint>
</hints>
</connection>
</connections>
</ui>

154
src/form/customwindow.ui Normal file
View File

@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Customwindow</class>
<widget class="QDialog" name="Customwindow">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>345</width>
<height>185</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>345</width>
<height>185</height>
</size>
</property>
<property name="windowTitle">
<string>Customwindow</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Window level</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>71</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="led_WL">
<property name="minimumSize">
<size>
<width>70</width>
<height>25</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_4" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Window width</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>71</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="led_WW">
<property name="minimumSize">
<size>
<width>70</width>
<height>25</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>126</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pBtn_OK">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="PBtn_Cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

294
src/form/exportdialog.ui Normal file
View File

@@ -0,0 +1,294 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExportDialog</class>
<widget class="QDialog" name="ExportDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>544</width>
<height>384</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>544</width>
<height>384</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Export Type</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Export File</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="rbCurrentImage">
<property name="text">
<string>Current Image</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="rbCurrentSeries">
<property name="text">
<string>Current Series</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="0" column="3">
<widget class="QRadioButton" name="rbAllOpendSeries">
<property name="text">
<string>All Opened Series</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>File Format</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="rbJPEG">
<property name="text">
<string>JPEG</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_2</string>
</attribute>
</widget>
</item>
<item row="1" column="2">
<widget class="QRadioButton" name="rbBMP">
<property name="text">
<string>BMP</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_2</string>
</attribute>
</widget>
</item>
<item row="1" column="3">
<widget class="QRadioButton" name="rbPNG">
<property name="text">
<string>PNG</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_2</string>
</attribute>
</widget>
</item>
<item row="2" column="1">
<widget class="QRadioButton" name="rbTIFF">
<property name="text">
<string>TIFF</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_2</string>
</attribute>
</widget>
</item>
<item row="2" column="2">
<widget class="QRadioButton" name="rbDICOM">
<property name="text">
<string>DICOM</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_2</string>
</attribute>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Export Location</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Export Folder</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="edtExportFolder"/>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="btnSelectFolder">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Choose Folder...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>FileName Prefix</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="edtFileNamePrefix"/>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>199</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>File Settings</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Annotations</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbFull">
<property name="text">
<string>Full</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_3</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbBasic">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Basic(anonymous)</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_3</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbDisabled">
<property name="text">
<string>Disabled</string>
</property>
<attribute name="buttonGroup">
<string notr="true">buttonGroup_3</string>
</attribute>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>0</number>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>343</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnExport">
<property name="text">
<string>Export</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnCancel">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
<buttongroups>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup_3"/>
<buttongroup name="buttonGroup"/>
</buttongroups>
</ui>

2366
src/form/gridpopwidget.ui Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,206 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FontPropertyWidget</class>
<widget class="QWidget" name="FontPropertyWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>136</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Text Property</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLineEdit" name="led_TextInput">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Specify the path to a TTF file here.</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="ButtonLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QPushButton" name="pbtn_Accept">
<property name="text">
<string>Apply</string>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqApply.png</normaloff>:/pqWidgets/Icon/pq/pqApply.png</iconset>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbtn_Reset">
<property name="toolTip">
<string>Resets any changed properties to their values from the last time 'Apply' was clicked.</string>
</property>
<property name="text">
<string>Reset</string>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqCancel.png</normaloff>:/pqWidgets/Icon/pq/pqCancel.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbtn_Delete">
<property name="text">
<string>Delete</string>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqDelete.png</normaloff>:/pqWidgets/Icon/pq/pqDelete.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="cbx_FontFamily">
<property name="toolTip">
<string>Select font</string>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<property name="minimumContentsLength">
<number>2</number>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spx_FontSize">
<property name="toolTip">
<string>Set font size</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbtn_FontColor">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="dspx_Opacity">
<property name="toolTip">
<string>Set font opacity</string>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tbtn_Bold">
<property name="toolTip">
<string>Bold</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqBold24.png</normaloff>:/pqWidgets/Icon/pq/pqBold24.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tbnt_Italics">
<property name="toolTip">
<string>Italics</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqItalics24.png</normaloff>:/pqWidgets/Icon/pq/pqItalics24.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tbtn_Shadow">
<property name="toolTip">
<string>Shadow</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqShadow24.png</normaloff>:/pqWidgets/Icon/pq/pqShadow24.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../QDicomViewer.qrc"/>
</resources>
<connections/>
</ui>

101
src/form/pqVCRToolbar.ui Normal file
View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>VCRToolbar</class>
<widget class="QToolBar" name="VCRToolbar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>250</width>
<height>40</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>250</width>
<height>40</height>
</size>
</property>
<property name="windowTitle">
<string>VCR Controls</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="PV_MUST_BE_MASTER" stdset="0">
<bool>true</bool>
</property>
<action name="actionVCRPlay">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqVcrPlay.png</normaloff>:/pqWidgets/Icon/pq/pqVcrPlay.png</iconset>
</property>
<property name="text">
<string>&amp;Play</string>
</property>
</action>
<action name="actionVCRPreviousFrame">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqVcrBack.png</normaloff>:/pqWidgets/Icon/pq/pqVcrBack.png</iconset>
</property>
<property name="text">
<string>Pre&amp;vious Frame</string>
</property>
<property name="PV_MUST_BE_MASTER" stdset="0">
<bool>true</bool>
</property>
</action>
<action name="actionVCRFirstFrame">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqVcrFirst.png</normaloff>:/pqWidgets/Icon/pq/pqVcrFirst.png</iconset>
</property>
<property name="text">
<string>&amp;First Frame</string>
</property>
</action>
<action name="actionVCRNextFrame">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqVcrForward.png</normaloff>:/pqWidgets/Icon/pq/pqVcrForward.png</iconset>
</property>
<property name="text">
<string>&amp;Next Frame</string>
</property>
</action>
<action name="actionVCRLastFrame">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="../QDicomViewer.qrc">
<normaloff>:/pqWidgets/Icon/pq/pqVcrLast.png</normaloff>:/pqWidgets/Icon/pq/pqVcrLast.png</iconset>
</property>
<property name="text">
<string>&amp;Last Frame</string>
</property>
</action>
<addaction name="actionVCRFirstFrame"/>
<addaction name="actionVCRPreviousFrame"/>
<addaction name="actionVCRPlay"/>
<addaction name="actionVCRNextFrame"/>
<addaction name="actionVCRLastFrame"/>
</widget>
<resources>
<include location="../QDicomViewer.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,83 @@
#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_QDicomViewer.h"
#include "importwidget.h"
#include <QSettings>
#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;
};

View File

@@ -0,0 +1,86 @@
#pragma once
#include "global/include_all.h"
#include "global/include_vitk.h"
using namespace std;
typedef std::map<std::string,std::vector<std::string>> OrienMapType;
class OrienHelper
{
public:
static std::string StringFilter(char* str);
static void init();
static std::vector<std::string>* 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;
};

View File

@@ -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

View File

@@ -0,0 +1,59 @@
#ifndef _DICOM_VIEWER_HELPER_H_
#define _DICOM_VIEWER_HELPER_H_
#include "dicomviewerbase.h"
#include <QString>
#include <QList>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
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<host>& info);
bool setPacsInfo(QList<host>& 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<host>& info);
static bool setPacsInfo(QList<host>& info);
};
#endif

View File

@@ -0,0 +1,30 @@
#ifndef _DICOMVIEWER_TYPE_H_
#define _DICOMVIEWER_TYPE_H_
#include <QString>
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_

View File

@@ -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<std::vector<double>> fusion_tf_vector;
//for convert vtkEvent to Qt signal
vtkSignalRaiser raiser;
QList<Measure*>* 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<RulerLegendActor> ruler;
void RenderRuler();
int currentPresetIndex=1;
DicomCornerInfo m_cornerInfo;
char SOP_UID[20];
};
#endif

View File

@@ -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 <memory>
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<infinitiViewer> m_imageViewer;
// vtkNew<vtkImageData> m_image;
private:
QSize labelSizeHint() const {
return QSize(image_label_size, image_label_size);
}
QImage vtkImageDataToQImage(vtkImageData* imageData);
vtkSmartPointer<vtkGenericOpenGLRenderWindow> m_glrenWin;
vtkSmartPointer <infinitiViewer> m_imageViewer;
vtkSmartPointer <vtkImageData> m_image;
//vtkSmartPointer <vtkImageData> 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];
};

View File

@@ -0,0 +1,30 @@
#ifndef _CALLBACKHELPER_H_
#define _CALLBACKHELPER_H_
#include <QObject>
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_

View File

@@ -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

View File

@@ -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_

View File

@@ -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_

View File

@@ -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 <QObject>
#include <QPointer>
#include <QTimer>
#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

View File

@@ -0,0 +1,59 @@
#ifndef pqVCRToolbar_h
#define pqVCRToolbar_h
#include <QToolBar>
#include <QSpinBox>
#include "pqVCRController.h"
#include "ui_pqVCRToolbar.h"
#include <QLineEdit>
#include <QThread>
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

View File

@@ -0,0 +1,57 @@
#ifndef _PROMPT_DIALOG_H_
#define _PROMPT_DIALOG_H_
#include <QWidget>
#include <QDialog>
#include <QEvent>
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_

View File

@@ -0,0 +1,38 @@
#ifndef _PROMPT_DIALOG_TITLEBAR_H_
#define _PROMPT_DIALOG_TITLEBAR_H_
#include <QWidget>
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_

View File

@@ -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 <COPYRIGHT HOLDER> 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.
**
** <http://libqxt.org> <foundation@libqxt.org>
*****************************************************************************/
#define QXTSPANSLIDER_H
#include <QSlider>
#include <QLabel>
//#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

View File

@@ -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 <COPYRIGHT HOLDER> 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.
**
** <http://libqxt.org> <foundation@libqxt.org>
*****************************************************************************/
#define QXTSPANSLIDER_P_H
#include <QStyle>
#include <QObject>
#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

View File

@@ -0,0 +1,122 @@
#ifndef DICOMEXPORTER_H
#define DICOMEXPORTER_H
#include <QObject>
#include "exportoptions.h"
#include <itkImage.h>
#include <itkGDCMImageIO.h>
#include <itkImageSeriesReader.h>
#include <itkImageSeriesWriter.h>
#include <itkImageToVTKImageFilter.h>
#include <itkGDCMSeriesFileNames.h>
#include "base/infinitiViewer.h"
#include <vtkRenderer.h>
#include <vtkSmartPointer.h>
#include <vtkRenderWindow.h>
#include <vtkCornerAnnotation.h>
#include <vtkWindowToImageFilter.h>
#include <vtkImageCast.h>
#include <vtkPNGWriter.h>
#include <vtkBMPWriter.h>
#include <vtkJPEGWriter.h>
#include <vtkTIFFWriter.h>
#include <qfileinfo.h>
#include <qdir.h>
#include <sstream>
#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<PixelTypeExport, InputDimensionExport> InputImageTypeExport;
typedef itk::GDCMImageIO ImageIOTypeExport;
typedef itk::ImageSeriesReader<InputImageTypeExport> SeriesReaderTypeExport;
typedef itk::ImageToVTKImageFilter<InputImageTypeExport> ConnectorTypeExport;
typedef itk::GDCMSeriesFileNames InputNamesGeneratorTypeExport;
//dicom export releated objects
typedef signed short OutputPixelType;
static const unsigned int OutputDimension = 2;
typedef itk::Image<OutputPixelType, OutputDimension> Image2DType;
typedef itk::ImageSeriesWriter<InputImageTypeExport, Image2DType> 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<vtkWindowToImageFilter> windowToImageFilter, const QString& fileName);
void writeToBmpFile(vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter, const QString& fileName);
void writeToJpgFile(vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter, const QString& fileName);
void writeToTiffFile(vtkSmartPointer<vtkWindowToImageFilter> 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<vtkRenderWindow> m_glrenWinExport;
vtkSmartPointer<infinitiViewer> m_imageViewerExport;
};
#endif // DICOMEXPORTER_H

View File

@@ -0,0 +1,33 @@
#ifndef DICOMEXPORTERTHREAD_H
#define DICOMEXPORTERTHREAD_H
#include <QObject>
#include <QThread>
#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

View File

@@ -0,0 +1,47 @@
#ifndef EXPORTDIALOG_H
#define EXPORTDIALOG_H
#include <QDialog>
#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

View File

@@ -0,0 +1,47 @@
#ifndef EXPORTOPTIONS_H
#define EXPORTOPTIONS_H
#include <QObject>
#include <qsize.h>
#include <qlist.h>
class SeriesInstance;
class ExportOptions
{
public:
explicit ExportOptions();
QList<QString> 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

View File

@@ -0,0 +1,421 @@
#pragma once
#include <QWidget>
#include <QSize>
#include <QString>
#include <QSurfaceFormat>
#include <QEvent>
#include "qevent.h"
#include <QImage>
#include <QPixmap>
#include <QVBoxLayout>
#include <QPushButton>
#include <memory>
#include <QGuiApplication>
#include <QScreen>
#include <sstream>
using namespace std;
// <20><><EFBFBD><EFBFBD><EFBFBD>
#define Project_NAME "EquilibriumNine DicomViewer"
#define Project_VER "1.0.0.0"
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
#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> DicomTagInfo_t*;
//typedef std::shared_ptr<UniqueIDInfo_t> 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 <SeriesInstance*> 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<std::string, SeriesInfo_t*> 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<std::string, StudyInfo_t*> 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<std::string, PatientInfo_t*> PatientsMapType;

View File

@@ -0,0 +1,9 @@
#pragma once
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include "QGlobals.h"

View File

@@ -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"

View File

@@ -0,0 +1,117 @@
#pragma once
#include <vtkSmartPointer.h>
#include <vtkImageReader2Factory.h>
#include <vtkImageReader2.h>
#include <vtkAssemblyPath.h>
#include <vtkCell.h>
#include <vtkCommand.h>
#include <vtkCornerAnnotation.h>
#include <vtkDataArray.h>
#include <vtkDICOMImageReader.h>
#include <vtkImageActor.h>
#include <vtkImageData.h>
#include "infinitiViewer.h"
#include <vtkImageChangeInformation.h>
#include <vtkInteractorStyleImage.h>
#include <vtkPointData.h>
#include <vtkPropPicker.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkTextProperty.h>
#include <vtkNamedColors.h>
//screenshot
#include <vtkWindowToImageFilter.h>
#include <vtkImageCast.h>
#include <vtkPNGWriter.h>
//for blending
#include <vtkImageBlend.h>
#include <vtkImageMapToColors.h>
#include <vtkLookupTable.h>
#include <vtkCallbackCommand.h>
//#include <itkImageToVTKImageFilter.h>
//
//#include "itkCommand.h"
//
//#include <itkImage.h>
//#include <itkImageFileReader.h>
//
//#include <itkImageToVTKImageFilter.h>
//#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 <vtkCamera.h>
#include <itkCommand.h>
#include <vtkOpenGLRenderWindow.h>
#include <QSurfaceFormat>
#include <vtkGenericOpenGLRenderWindow.h>
#include "QVTKInteractorAdapter.h"
//max version:vtk 8.2.0
//#include <QVTKWidget.h>
//min version: vtk 8.2.0
#include <QVTKOpenGLNativeWidget.h>
//ITK headers
#include <itkImage.h>
#include <itkGDCMImageIO.h>
#include <itkGDCMSeriesFileNames.h>
#include <itkImageSeriesReader.h>
#include <itkImageToVTKImageFilter.h>
#include <itkImageFileWriter.h>
#include <itkImageSeriesWriter.h>
//#include <vnl/vnl_vector.hxx>
//#include <vnl/algo/vnl_svd.hxx>
//#include <vnl/algo/vnl_qr.hxx>
//newly added0
#include <vtkOBJReader.h>
#include <vtkMetaImageReader.h>
static const unsigned int InputDimension = 3;
static const unsigned int OutputDimension = 2;
typedef signed short PixelType;
typedef itk::Image<PixelType, InputDimension> InputImageType;
typedef itk::GDCMImageIO ImageIOType;
typedef itk::GDCMSeriesFileNames InputNamesGeneratorType;
typedef itk::ImageToVTKImageFilter<InputImageType> ConnectorType;
typedef itk::MetaDataDictionary DictionaryType;
typedef itk::MetaDataObject<std::string> MetaDataStringType;
typedef itk::ImageSeriesReader<InputImageType> SeriesReaderType;
typedef std::vector< std::string > FilenamesContainer;
typedef FilenamesContainer FileNamesContainerType;
typedef itk::ImageFileWriter<InputImageType> ImageWriterType;
typedef itk::Image< PixelType, OutputDimension > Image2DType;
typedef itk::ImageSeriesWriter <InputImageType, Image2DType > SeriesWriterType;

View File

@@ -0,0 +1,230 @@
//
// Created by 87714 on 2021/6/19.
//
#ifndef OMEGAV_ACTORDRAGGABLEINTERACTORSTYLE_H
#define OMEGAV_ACTORDRAGGABLEINTERACTORSTYLE_H
#include <vtkPropPicker.h>
#include <vtkPointPicker.h>
#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<vtkPropPicker> 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

View File

@@ -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

View File

@@ -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 <vtkCursor2D.h>
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<vtkPolyData> renderData;
vtkNew<vtkPolyData> 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<vtkCursor2D> cursor;
};
#endif //OMEGAV_ANNOTATIONACTOR_H

Some files were not shown because too many files have changed in this diff Show More