2022-01-24 10:10:45 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
#include <QtWidgets/QMainWindow>
|
|
|
|
|
|
#include "ui_QDicomViewer.h"
|
|
|
|
|
|
#include "importwidget.h"
|
|
|
|
|
|
#include <QSettings>
|
|
|
|
|
|
#include "exportdialog.h"
|
|
|
|
|
|
#include "Customwindow.h"
|
|
|
|
|
|
#include "pqFontPropertyWidget.h"
|
|
|
|
|
|
|
2022-02-23 13:09:53 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @brief 主窗口Class
|
|
|
|
|
|
* 继承自QMainWindow,主要用于显示整个界面
|
|
|
|
|
|
*/
|
2022-01-24 10:10:45 +08:00
|
|
|
|
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;
|
|
|
|
|
|
|
2022-02-23 13:09:53 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 从qrc中读取指定抿成的StyleSheet文件
|
|
|
|
|
|
* @param sheetName StyleSheet文件名
|
|
|
|
|
|
*/
|
2022-01-24 10:10:45 +08:00
|
|
|
|
void loadStyleSheet(const QString &sheetName);
|
2022-02-23 13:09:53 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 初始化函数,主要实现了Button的构建和槽函数绑定
|
|
|
|
|
|
*/
|
2022-01-24 10:10:45 +08:00
|
|
|
|
void Initial();
|
|
|
|
|
|
void createToolButton();
|
2022-02-23 13:09:53 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 用于设置ToolButton相关的属性(文字、图标、槽等)的一组函数
|
|
|
|
|
|
* @{
|
|
|
|
|
|
*/
|
2022-01-24 10:10:45 +08:00
|
|
|
|
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);
|
2022-02-23 13:09:53 +08:00
|
|
|
|
//@}
|
2022-01-24 10:10:45 +08:00
|
|
|
|
|
2022-02-23 13:09:53 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 设置是否显示缩略图栏
|
|
|
|
|
|
* TODO:考虑改名为setThumbnailBarDisplay
|
|
|
|
|
|
* @param value
|
|
|
|
|
|
*/
|
2022-01-24 10:10:45 +08:00
|
|
|
|
void displayThumbnailBar(bool value);
|
2022-02-23 13:09:53 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 打开DICOM,并在界面上绘制出显示效果
|
|
|
|
|
|
* @param dicomName DICOM文件路径
|
|
|
|
|
|
* @param openMode 文件打开方式,文件方式或文件夹方式
|
|
|
|
|
|
*/
|
2022-01-24 10:10:45 +08:00
|
|
|
|
void drawDICOM(const std::string &dicomName, SeriesOpenMode openMode);
|
2022-02-23 13:09:53 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 设置部分空间的槽函数连接
|
|
|
|
|
|
*/
|
|
|
|
|
|
void SetupConnections();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 按照annType的类型,在Container中执行对应的Measurement操作
|
|
|
|
|
|
* @param Container 包含RenderWindow的QTWidget容器
|
|
|
|
|
|
* @param annType 需要执行操作的AnnotationActorType
|
|
|
|
|
|
*/
|
2022-01-24 10:10:45 +08:00
|
|
|
|
void executeActiveMeasure(ViewContainerWidget *Container, AnnotationActorType annType);
|
2022-02-23 13:09:53 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 为对应的DicomImageView构建对应的播放控件
|
|
|
|
|
|
* @param v
|
|
|
|
|
|
*/
|
2022-01-24 10:10:45 +08:00
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
};
|