Refactor QDicomViewer, extract toolbar DefaultToolBar class, refactor state -> button ready, need add state check.
This commit is contained in:
@@ -82,7 +82,8 @@ enum AnnotationActorType
|
|||||||
ArrowAnn,
|
ArrowAnn,
|
||||||
EllipseAnn,
|
EllipseAnn,
|
||||||
TextAnn,
|
TextAnn,
|
||||||
//HiddenAnn,
|
};
|
||||||
|
enum AnnotationDeleteType{
|
||||||
DeleteSelectedAnn,
|
DeleteSelectedAnn,
|
||||||
DeleteSliceAnn,
|
DeleteSliceAnn,
|
||||||
DeleteSeriesAnn
|
DeleteSeriesAnn
|
||||||
@@ -188,11 +189,15 @@ public:
|
|||||||
}
|
}
|
||||||
static void PrivacyOn()
|
static void PrivacyOn()
|
||||||
{
|
{
|
||||||
|
if (privacyOn) return;
|
||||||
privacyOn = true;
|
privacyOn = true;
|
||||||
|
EventsCenter::TriggerEvent(AnonymizeStateChanged);
|
||||||
}
|
}
|
||||||
static void PrivacyOff()
|
static void PrivacyOff()
|
||||||
{
|
{
|
||||||
|
if (!privacyOn) return;
|
||||||
privacyOn = false;
|
privacyOn = false;
|
||||||
|
EventsCenter::TriggerEvent(AnonymizeStateChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsAnno()
|
static bool IsAnno()
|
||||||
@@ -202,6 +207,7 @@ public:
|
|||||||
static void toggleAnno()
|
static void toggleAnno()
|
||||||
{
|
{
|
||||||
annotOn = !annotOn;
|
annotOn = !annotOn;
|
||||||
|
EventsCenter::TriggerEvent(AnnotationStateChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -219,6 +225,12 @@ public:
|
|||||||
}
|
}
|
||||||
static void setMeasureType(int type){
|
static void setMeasureType(int type){
|
||||||
measureType = type;
|
measureType = type;
|
||||||
|
EventsCenter::TriggerEvent(MeasureTypeChanged);
|
||||||
|
}
|
||||||
|
static void deleteMeasure(int deleteType){
|
||||||
|
EventObject type;
|
||||||
|
type.AddDetailValue("type",deleteType);
|
||||||
|
EventsCenter::TriggerEvent(MeasureDelete, &type);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
static int measureType;
|
static int measureType;
|
||||||
|
|||||||
@@ -5,14 +5,20 @@
|
|||||||
#ifndef OMEGAV_EVENTSCENTER_H
|
#ifndef OMEGAV_EVENTSCENTER_H
|
||||||
#define OMEGAV_EVENTSCENTER_H
|
#define OMEGAV_EVENTSCENTER_H
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QObject>
|
||||||
#include "QtCore/qmap.h"
|
#include <QMap>
|
||||||
#include "QString"
|
#include <QString>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
#define aLLEventMacro() \
|
#define aLLEventMacro() \
|
||||||
_add_Event(DefaultEvent)\
|
_add_Event(DefaultEvent)\
|
||||||
_add_Event(DragEvent)\
|
_add_Event(DragEvent)\
|
||||||
_add_Event(SyncStateChanged)
|
_add_Event(SyncStateChanged)\
|
||||||
|
_add_Event(AnnotationStateChanged)\
|
||||||
|
_add_Event(AnonymizeStateChanged)\
|
||||||
|
_add_Event(MeasureHideChanged)\
|
||||||
|
_add_Event(MeasureTypeChanged)\
|
||||||
|
_add_Event(MeasureDelete)
|
||||||
|
|
||||||
|
|
||||||
enum Events{
|
enum Events{
|
||||||
@@ -24,8 +30,8 @@ class EventObject {
|
|||||||
public:
|
public:
|
||||||
void* Sender= nullptr;
|
void* Sender= nullptr;
|
||||||
bool Cancel = false;
|
bool Cancel = false;
|
||||||
QMap<QString,void*> Detail;
|
QMap<QString,QVariant> Detail;
|
||||||
void AddDetailValue(const QString& key, void* val)
|
void AddDetailValue(const QString& key, QVariant val)
|
||||||
{
|
{
|
||||||
Detail[key]=val;
|
Detail[key]=val;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Measure* GetNextMeasure() override\
|
|||||||
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include "Events/EventsCenter.h"
|
||||||
|
|
||||||
class vtkRenderWindowInteractor;
|
class vtkRenderWindowInteractor;
|
||||||
|
|
||||||
@@ -49,7 +50,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void SetHidden(bool h) {
|
static void SetHidden(bool h) {
|
||||||
|
if (Measure::Hidden == h) return;
|
||||||
Measure::Hidden = h;
|
Measure::Hidden = h;
|
||||||
|
EventsCenter::TriggerEvent(MeasureHideChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool GetHidden() {
|
static bool GetHidden() {
|
||||||
|
|||||||
@@ -19,6 +19,20 @@
|
|||||||
ImageViewManager::ImageViewManager(QObject *parent)
|
ImageViewManager::ImageViewManager(QObject *parent)
|
||||||
: QObject(parent), currentView(nullptr), currentFusionView(nullptr), mMaxed(false) {
|
: QObject(parent), currentView(nullptr), currentFusionView(nullptr), mMaxed(false) {
|
||||||
|
|
||||||
|
connect(EventsCenter::Default(),&EventsCenter::AnnotationStateChanged,
|
||||||
|
this, &ImageViewManager::updateCornerInfoAll);
|
||||||
|
|
||||||
|
connect(EventsCenter::Default(),&EventsCenter::AnonymizeStateChanged,
|
||||||
|
this, &ImageViewManager::updateCornerInfoPrivacy);
|
||||||
|
|
||||||
|
connect(EventsCenter::Default(),&EventsCenter::MeasureHideChanged,
|
||||||
|
this, &ImageViewManager::renderAll);
|
||||||
|
|
||||||
|
connect(EventsCenter::Default(),&EventsCenter::MeasureTypeChanged,
|
||||||
|
this, &ImageViewManager::activeMeasure);
|
||||||
|
|
||||||
|
connect(EventsCenter::Default(),&EventsCenter::MeasureDelete,
|
||||||
|
this, &ImageViewManager::deleteMeasure);
|
||||||
}
|
}
|
||||||
|
|
||||||
// views manage----------------------------------------------------------------
|
// views manage----------------------------------------------------------------
|
||||||
@@ -299,6 +313,28 @@ void ImageViewManager::activeMeasure() {
|
|||||||
}, nullptr, nullptr, ImageViewManager::All);
|
}, nullptr, nullptr, ImageViewManager::All);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImageViewManager::deleteMeasure(EventObject* deleteType){
|
||||||
|
switch (deleteType->Detail["type"].toInt()) {
|
||||||
|
case AnnotationDeleteType::DeleteSelectedAnn:
|
||||||
|
if (currentView != nullptr) {
|
||||||
|
currentView->deleteSelectedMeasure();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case AnnotationDeleteType::DeleteSliceAnn:
|
||||||
|
if (currentView != nullptr) {
|
||||||
|
currentView->deleteCurrentSliceMeasure();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case AnnotationDeleteType::DeleteSeriesAnn:
|
||||||
|
if (currentView != nullptr) {
|
||||||
|
currentView->deleteCurrentSeriesMeasure();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ImageViewManager::switchSliceOrientation() {
|
void ImageViewManager::switchSliceOrientation() {
|
||||||
currentView->setSliceOrientation((currentView->getSliceOrientation() + 1) % 3);
|
currentView->setSliceOrientation((currentView->getSliceOrientation() + 1) % 3);
|
||||||
emit currentViewReload(currentView);
|
emit currentViewReload(currentView);
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ public:
|
|||||||
|
|
||||||
void activeMeasure();
|
void activeMeasure();
|
||||||
|
|
||||||
|
void deleteMeasure(EventObject* deleteType);
|
||||||
|
|
||||||
void switchSliceOrientation();
|
void switchSliceOrientation();
|
||||||
|
|
||||||
void updateCornerInfoAll();
|
void updateCornerInfoAll();
|
||||||
|
|||||||
@@ -125,9 +125,11 @@ void DefaultToolBar::initButtons() {
|
|||||||
SetupExportTool();
|
SetupExportTool();
|
||||||
SetupGridTool();
|
SetupGridTool();
|
||||||
SetupSyncTool();
|
SetupSyncTool();
|
||||||
|
SetupAnnoTool();
|
||||||
SetupModeTool();
|
SetupModeTool();
|
||||||
SetupTransformTool();
|
SetupTransformTool();
|
||||||
SetupFusionTool();
|
SetupFusionTool();
|
||||||
|
SetupMPR();
|
||||||
SetupCineTool();
|
SetupCineTool();
|
||||||
SetupEmptyTool();
|
SetupEmptyTool();
|
||||||
SetupScreenTool();
|
SetupScreenTool();
|
||||||
@@ -205,7 +207,7 @@ void DefaultToolBar::SetupSyncTool() {
|
|||||||
void DefaultToolBar::syncStateChanged() const {
|
void DefaultToolBar::syncStateChanged() const {
|
||||||
switch (SyncHelper::getSyncState()) {
|
switch (SyncHelper::getSyncState()) {
|
||||||
case AUTO_SYNC:
|
case AUTO_SYNC:
|
||||||
// mBtnSync->setIcon(mAutoIcon);
|
mBtnSync->setIcon(mAutoIcon);
|
||||||
mActionSyncState->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[AUTO_SYNC]));
|
mActionSyncState->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[AUTO_SYNC]));
|
||||||
for (int i = 0; i < SYNC_ITEM_NUM; i++) {
|
for (int i = 0; i < SYNC_ITEM_NUM; i++) {
|
||||||
mSyncActions[i]->setDisabled(false);
|
mSyncActions[i]->setDisabled(false);
|
||||||
@@ -216,7 +218,7 @@ void DefaultToolBar::syncStateChanged() const {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MANUAL_SYNC:{
|
case MANUAL_SYNC:{
|
||||||
// mBtnSync->setIcon(mManualIcon);
|
mBtnSync->setIcon(mManualIcon);
|
||||||
mActionSyncState->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[MANUAL_SYNC]));
|
mActionSyncState->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[MANUAL_SYNC]));
|
||||||
mSyncActions[SLICE_POS]->setChecked(SyncHelper::getSyncItem(SLICE_POS));
|
mSyncActions[SLICE_POS]->setChecked(SyncHelper::getSyncItem(SLICE_POS));
|
||||||
mSyncActions[WIDTH_LEVEL]->setChecked(SyncHelper::getSyncItem(WIDTH_LEVEL));
|
mSyncActions[WIDTH_LEVEL]->setChecked(SyncHelper::getSyncItem(WIDTH_LEVEL));
|
||||||
@@ -224,7 +226,7 @@ void DefaultToolBar::syncStateChanged() const {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIS_SYNC:
|
case DIS_SYNC:
|
||||||
// mBtnSync->setIcon(mDisIcon);
|
mBtnSync->setIcon(mDisIcon);
|
||||||
mActionSyncState->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[DIS_SYNC]));
|
mActionSyncState->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[DIS_SYNC]));
|
||||||
for (int i = 0; i < SYNC_ITEM_NUM; i++) {
|
for (int i = 0; i < SYNC_ITEM_NUM; i++) {
|
||||||
mSyncActions[i]->setChecked(false);
|
mSyncActions[i]->setChecked(false);
|
||||||
@@ -239,7 +241,7 @@ void DefaultToolBar::syncStateChanged() const {
|
|||||||
void DefaultToolBar::SetupModeTool() {
|
void DefaultToolBar::SetupModeTool() {
|
||||||
mBtnWindow->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
mBtnWindow->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||||
mBtnWindow->setToolTip(QString("Adjust window level"));
|
mBtnWindow->setToolTip(QString("Adjust window level"));
|
||||||
connect(mBtnWindow, &QToolButton::clicked, this, [&] {
|
connect(mBtnWindow, &QToolButton::clicked, this, [=]() {
|
||||||
emit modeChanged(7);
|
emit modeChanged(7);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -255,17 +257,17 @@ void DefaultToolBar::SetupModeTool() {
|
|||||||
mBtnWindow->setMenu(m);
|
mBtnWindow->setMenu(m);
|
||||||
|
|
||||||
mBtnPan->setToolTip(QString("Pan image"));
|
mBtnPan->setToolTip(QString("Pan image"));
|
||||||
connect(mBtnPan, &QToolButton::clicked, this, [&] {
|
connect(mBtnPan, &QToolButton::clicked, this, [=]() {
|
||||||
emit modeChanged(5);
|
emit modeChanged(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
mBtnZoom->setToolTip(QString("Zoom image"));
|
mBtnZoom->setToolTip(QString("Zoom image"));
|
||||||
connect(mBtnZoom, &QToolButton::clicked, this, [&] {
|
connect(mBtnZoom, &QToolButton::clicked, this, [=]() {
|
||||||
emit modeChanged(6);
|
emit modeChanged(6);
|
||||||
});
|
});
|
||||||
|
|
||||||
mBtnSlice->setToolTip(QString("Browse series"));
|
mBtnSlice->setToolTip(QString("Browse series"));
|
||||||
connect(mBtnSlice, &QToolButton::clicked, this, [&] {
|
connect(mBtnSlice, &QToolButton::clicked, this, [=]() {
|
||||||
emit modeChanged(4);
|
emit modeChanged(4);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -274,27 +276,14 @@ void DefaultToolBar::SetupModeTool() {
|
|||||||
|
|
||||||
void DefaultToolBar::SetupAnnoTool() {
|
void DefaultToolBar::SetupAnnoTool() {
|
||||||
mBtnAnonymize->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
mBtnAnonymize->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||||
|
|
||||||
//主要设置了四角标签的操作逻辑
|
|
||||||
mBtnAnonymize->setToolTip(QString("Toggle annotations"));
|
mBtnAnonymize->setToolTip(QString("Toggle annotations"));
|
||||||
//视窗操作,显隐脚注
|
mBtnAnonymize->setCheckable(true);
|
||||||
|
|
||||||
// connect(mBtnAnonymize, &QToolButton::clicked, this, [=] {
|
|
||||||
// AnnoHelper::toggleAnno();
|
|
||||||
// ui->viewContainer->getViewManager()->updateCornerInfoAll();
|
|
||||||
// });
|
|
||||||
|
|
||||||
//视窗操作,显隐测量
|
//视窗操作,显隐测量
|
||||||
QMenu *m;
|
QMenu *m;
|
||||||
m = new QMenu(this);
|
m = new QMenu(this);
|
||||||
// connect(m, &QMenu::triggered, this, [=] {
|
|
||||||
// //load data
|
|
||||||
// mActionHideMeasure->setChecked(Measure::GetHidden());
|
|
||||||
// });
|
|
||||||
//视窗操作,显隐测量
|
//视窗操作,显隐测量
|
||||||
mActionHideMeasure = m->addAction(tr("Hide all measurements"), this, [=](bool value) {
|
mActionHideMeasure = m->addAction(tr("Hide all measurements"), this, [=](bool value) {
|
||||||
Measure::SetHidden(!mActionHideMeasure->isChecked());
|
Measure::SetHidden(mActionHideMeasure->isChecked());
|
||||||
// ui->viewContainer->getViewManager()->renderAll();
|
|
||||||
});
|
});
|
||||||
mActionHideMeasure->setCheckable(true);
|
mActionHideMeasure->setCheckable(true);
|
||||||
mActionHideMeasure->setChecked(false);
|
mActionHideMeasure->setChecked(false);
|
||||||
@@ -308,13 +297,20 @@ void DefaultToolBar::SetupAnnoTool() {
|
|||||||
} else {
|
} else {
|
||||||
AnnoHelper::PrivacyOff();
|
AnnoHelper::PrivacyOff();
|
||||||
}
|
}
|
||||||
// ui->viewContainer->getViewManager()->updateCornerInfoPrivacy();
|
mBtnAnonymize->setChecked(mActionHidePatData->isChecked());
|
||||||
});
|
});
|
||||||
mActionHidePatData->setCheckable(true);
|
mActionHidePatData->setCheckable(true);
|
||||||
mActionHidePatData->setChecked(false);
|
mActionHidePatData->setChecked(false);
|
||||||
|
|
||||||
m->addAction(tr("Show Dicom tags"), this, &DefaultToolBar::showMeta);
|
m->addAction(tr("Show Dicom tags"), this, &DefaultToolBar::showMeta);
|
||||||
|
|
||||||
|
connect(mBtnAnonymize,&QToolButton::clicked,this,[=]{
|
||||||
|
if (mBtnAnonymize->isChecked()) {
|
||||||
|
AnnoHelper::PrivacyOn();
|
||||||
|
} else {
|
||||||
|
AnnoHelper::PrivacyOff();
|
||||||
|
}
|
||||||
|
mActionHidePatData->setChecked(mBtnAnonymize->isChecked());
|
||||||
|
});
|
||||||
mBtnAnonymize->setPopupMode(QToolButton::MenuButtonPopup);
|
mBtnAnonymize->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
mBtnAnonymize->setMenu(m);
|
mBtnAnonymize->setMenu(m);
|
||||||
}
|
}
|
||||||
@@ -325,18 +321,21 @@ void DefaultToolBar::SetupMeasureTool() {
|
|||||||
mBtnMeasure->setChecked(true);\
|
mBtnMeasure->setChecked(true);\
|
||||||
QPixmap map(std::get<1>(MEASURE_ACTIIONS[index]));\
|
QPixmap map(std::get<1>(MEASURE_ACTIIONS[index]));\
|
||||||
mBtnMeasure->setIcon(QIcon(map));\
|
mBtnMeasure->setIcon(QIcon(map));\
|
||||||
|
MeasureHelper::setMeasureType(std::get<2>(MEASURE_ACTIIONS[index]));\
|
||||||
})
|
})
|
||||||
// MeasureHelper::setMeasureType(std::get<2>(MEASURE_ACTIIONS[index]));\
|
|
||||||
// ui->viewContainer->getViewManager()->activeMeasure();\
|
|
||||||
|
|
||||||
|
|
||||||
#define ADD_DEL_ACTION(text, type, func)\
|
#define ADD_DEL_ACTION(text, type)\
|
||||||
m->addAction(tr(text));
|
m->addAction(tr(text),this,[]{\
|
||||||
|
MeasureHelper::deleteMeasure(type);\
|
||||||
|
});
|
||||||
|
|
||||||
mBtnMeasure->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
mBtnMeasure->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||||
mBtnMeasure->setToolTip(QString("Measurements"));
|
mBtnMeasure->setToolTip(QString("Measurements"));
|
||||||
|
|
||||||
connect(mBtnMeasure, &QToolButton::clicked, this, &DefaultToolBar::activeMeasure);
|
connect(mBtnMeasure, &QToolButton::clicked, [=](){
|
||||||
|
MeasureHelper::setMeasureType(MeasureHelper::getMeasureType());
|
||||||
|
});
|
||||||
|
|
||||||
QMenu *m;
|
QMenu *m;
|
||||||
m = new QMenu(this);
|
m = new QMenu(this);
|
||||||
@@ -345,9 +344,9 @@ void DefaultToolBar::SetupMeasureTool() {
|
|||||||
ADD_MEASURE_ACTION(j);
|
ADD_MEASURE_ACTION(j);
|
||||||
}
|
}
|
||||||
m->addSeparator();
|
m->addSeparator();
|
||||||
ADD_DEL_ACTION("Delete selected", AnnotationActorType::DeleteSelectedAnn, deleteSelectedMeasure);
|
ADD_DEL_ACTION("Delete selected", AnnotationDeleteType::DeleteSelectedAnn);
|
||||||
ADD_DEL_ACTION("Delete all in current slice", AnnotationActorType::DeleteSliceAnn, deleteCurrentSliceMeasure);
|
ADD_DEL_ACTION("Delete all in current slice", AnnotationDeleteType::DeleteSliceAnn);
|
||||||
ADD_DEL_ACTION("Delete all in current series", AnnotationActorType::DeleteSeriesAnn, deleteCurrentSeriesMeasure);
|
ADD_DEL_ACTION("Delete all in current series", AnnotationDeleteType::DeleteSeriesAnn);
|
||||||
mBtnMeasure->setPopupMode(QToolButton::MenuButtonPopup);
|
mBtnMeasure->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
mBtnMeasure->setMenu(m);
|
mBtnMeasure->setMenu(m);
|
||||||
}
|
}
|
||||||
@@ -364,7 +363,7 @@ void DefaultToolBar::SetupFusionTool() {
|
|||||||
});
|
});
|
||||||
mBtnFusion->setPopupMode(QToolButton::MenuButtonPopup);
|
mBtnFusion->setPopupMode(QToolButton::MenuButtonPopup);
|
||||||
mBtnFusion->setMenu(m);
|
mBtnFusion->setMenu(m);
|
||||||
mBtnFusion->setEnabled(false);
|
// mBtnFusion->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultToolBar::SetupCineTool() {
|
void DefaultToolBar::SetupCineTool() {
|
||||||
@@ -403,6 +402,22 @@ void DefaultToolBar::SetupTransformTool() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DefaultToolBar::SetupMPR(){
|
||||||
|
connect(mBtnMPR, &QToolButton::clicked, [=](){
|
||||||
|
SyncHelper::setSyncState(DIS_SYNC);
|
||||||
|
syncStateChanged();
|
||||||
|
emit changeSliceOrientation();
|
||||||
|
});
|
||||||
|
// mBtnMPR->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DefaultToolBar::resetNeedCheckFunctionButtons(){
|
||||||
|
// mBtnMPR->setEnabled(false);
|
||||||
|
mBtnFusion->setEnabled(false);
|
||||||
|
SyncHelper::setSyncState(DIS_SYNC);
|
||||||
|
syncStateChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void DefaultToolBar::SetupScreenTool() {
|
void DefaultToolBar::SetupScreenTool() {
|
||||||
mBtnFullScreen->setToolTip(QString("Full screen"));
|
mBtnFullScreen->setToolTip(QString("Full screen"));
|
||||||
connect(mBtnFullScreen, &QToolButton::clicked, this, [=] {
|
connect(mBtnFullScreen, &QToolButton::clicked, this, [=] {
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ public:
|
|||||||
explicit DefaultToolBar(QWidget *parent = nullptr);
|
explicit DefaultToolBar(QWidget *parent = nullptr);
|
||||||
|
|
||||||
~DefaultToolBar();
|
~DefaultToolBar();
|
||||||
|
|
||||||
|
void resetNeedCheckFunctionButtons();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void openFile();
|
void openFile();
|
||||||
void openFolder();
|
void openFolder();
|
||||||
@@ -27,7 +30,7 @@ signals:
|
|||||||
void negativeWindow();
|
void negativeWindow();
|
||||||
void fusion(bool on = false);
|
void fusion(bool on = false);
|
||||||
void cine(bool on = false);
|
void cine(bool on = false);
|
||||||
void activeMeasure();
|
void changeSliceOrientation();
|
||||||
void clear();
|
void clear();
|
||||||
void parentWindowStateChange(Qt::WindowState state);
|
void parentWindowStateChange(Qt::WindowState state);
|
||||||
void parentWindowClose();
|
void parentWindowClose();
|
||||||
@@ -40,6 +43,7 @@ private:
|
|||||||
|
|
||||||
void initButtons();
|
void initButtons();
|
||||||
void syncStateChanged() const;
|
void syncStateChanged() const;
|
||||||
|
void SetupMPR();
|
||||||
|
|
||||||
void SetupFileTool();
|
void SetupFileTool();
|
||||||
void SetupImportTool();
|
void SetupImportTool();
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "Interaction/ActorDraggableInteractorStyle.h"
|
#include "Interaction/ActorDraggableInteractorStyle.h"
|
||||||
#include "UI/Manager/ImageViewManager.h"
|
#include "UI/Manager/ImageViewManager.h"
|
||||||
#include "UI/Widget/ToolBar/DefaultToolBar.h"
|
|
||||||
#include "UI/Widget/Component/gridpopwidget.h"
|
#include "UI/Widget/Component/gridpopwidget.h"
|
||||||
#include "UI/Widget/cine/pqVCRToolbar.h"
|
#include "UI/Widget/cine/pqVCRToolbar.h"
|
||||||
|
|
||||||
@@ -46,16 +45,7 @@ QDicomViewer::~QDicomViewer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QDicomViewer::Initial() {
|
void QDicomViewer::Initial() {
|
||||||
SetupFileTool();
|
this->SetupConnections();
|
||||||
SetupImportTool();
|
|
||||||
SetupExportTool();
|
|
||||||
SetupGridTool();
|
|
||||||
SetupSyncTool();
|
|
||||||
SetupTransformTool();
|
|
||||||
SetupEmptyTool();
|
|
||||||
SetupScreenTool();
|
|
||||||
// this->createToolButton();
|
|
||||||
// this->SetupConnections();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QDicomViewer::loadStyleSheet(const QString &sheetName) {
|
void QDicomViewer::loadStyleSheet(const QString &sheetName) {
|
||||||
@@ -68,155 +58,38 @@ void QDicomViewer::loadStyleSheet(const QString &sheetName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QDicomViewer::createToolButton() {
|
void QDicomViewer::SetupConnections() {
|
||||||
|
|
||||||
this->SetupFileTool();
|
initGeneralTool();
|
||||||
this->SetupImportTool();
|
initViewOperation();
|
||||||
this->SetupExportTool();
|
initCine();
|
||||||
|
initScreenControl();
|
||||||
|
|
||||||
this->SetupGridTool();
|
connect(ui->viewContainer->getViewManager(),&ImageViewManager::currentViewReload,
|
||||||
this->SetupSyncTool();
|
ui->toolBar, &DefaultToolBar::resetNeedCheckFunctionButtons);
|
||||||
this->SetupAnnoTool();
|
|
||||||
|
|
||||||
this->SetupAdjustTool();
|
|
||||||
this->SetupMeasureTool();
|
|
||||||
this->SetupEmptyTool();
|
|
||||||
|
|
||||||
this->SetupTransformTool();
|
|
||||||
this->SetupFusionTool();
|
|
||||||
this->SetupCineTool();
|
|
||||||
|
|
||||||
|
|
||||||
// connect(btnMPR, &QToolButton::clicked, [=](){
|
|
||||||
// SyncHelper::setSyncState(DIS_SYNC);
|
|
||||||
// syncStateChanged();
|
|
||||||
// ui->viewContainer->getViewManager()->switchSliceOrientation();
|
|
||||||
// });
|
|
||||||
// btnMPR->setEnabled(false);
|
|
||||||
// mprBtn = btnMPR;
|
|
||||||
// fusionBtn = btnfusion;
|
|
||||||
// connect(ui->viewContainer->getViewManager(),
|
|
||||||
// &ImageViewManager::currentViewReload,[=](){
|
|
||||||
// btnfusion->setEnabled(false);
|
|
||||||
// btnMPR->setEnabled(false);
|
|
||||||
// SyncHelper::setSyncState(DIS_SYNC);
|
|
||||||
// syncStateChanged();
|
|
||||||
// });
|
|
||||||
|
|
||||||
worker.setManager(ui->viewContainer->getViewManager());
|
worker.setManager(ui->viewContainer->getViewManager());
|
||||||
connect(ui->viewContainer->getViewManager(),
|
connect(ui->viewContainer->getViewManager(),
|
||||||
&ImageViewManager::currentViewReload,
|
&ImageViewManager::currentViewReload,
|
||||||
&worker,&ImageViewStateCheckWorker::checkImageViewState, Qt::QueuedConnection);
|
&worker,&ImageViewStateCheckWorker::checkImageViewState, Qt::QueuedConnection);
|
||||||
connect(&worker,&ImageViewStateCheckWorker::imageViewStateChanged,
|
// connect(&worker,&ImageViewStateCheckWorker::imageViewStateChanged,
|
||||||
this,&QDicomViewer::resetToolBarButtons, Qt::QueuedConnection);
|
// this,&QDicomViewer::resetToolBarButtons, Qt::QueuedConnection);
|
||||||
workerManager.registerWorker(&worker);
|
workerManager.registerWorker(&worker);
|
||||||
}
|
|
||||||
|
|
||||||
void QDicomViewer::SetupScreenTool() {
|
//通知左侧的缩略图bar ,当前选中series的变换
|
||||||
connect(ui->toolBar,&DefaultToolBar::parentWindowStateChange,this,&QDicomViewer::setWindowState);
|
connect(ui->viewContainer, &ViewContainerWidget::onThumbnailTrigger,
|
||||||
connect(ui->toolBar,&DefaultToolBar::parentWindowClose, this, &QWidget::close);
|
ui->thumbnailBar, &ThumbnailBarWidget::Slot_setCurrentThumbnail);
|
||||||
}
|
|
||||||
|
|
||||||
void QDicomViewer::SetupAnnoTool() {
|
//通知右侧显示区域,当前有series被点击
|
||||||
// connect(annoBtn, &QToolButton::clicked, this, [=] {
|
connect(ui->thumbnailBar, &ThumbnailBarWidget::Signal_ThumbClicked,
|
||||||
// AnnoHelper::toggleAnno();
|
ui->viewContainer->getViewManager(), &ImageViewManager::viewReload);
|
||||||
// ui->viewContainer->getViewManager()->updateCornerInfoAll();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// //视窗操作,显隐测量
|
connect(ui->toolBar, &QToolBar::visibilityChanged,
|
||||||
// m_measure_hidden_action = m->addAction(tr("Hide all measurements"), this, [=](bool value) {
|
this, &QDicomViewer::Slot_ToolbarVisibilityChanged);
|
||||||
// Measure::SetHidden(value);
|
|
||||||
// ui->viewContainer->getViewManager()->renderAll();
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
//视窗操作,匿名化
|
|
||||||
// m_patient_hidden_action = m->addAction(tr("Hide patient data"), this, [=] {
|
|
||||||
// if (m_patient_hidden_action->isChecked()) {
|
|
||||||
// AnnoHelper::PrivacyOn();
|
|
||||||
// } else {
|
|
||||||
// AnnoHelper::PrivacyOff();
|
|
||||||
// }
|
|
||||||
// ui->viewContainer->getViewManager()->updateCornerInfoPrivacy();
|
|
||||||
// });
|
|
||||||
// m_patient_hidden_action->setCheckable(true);
|
|
||||||
// m_patient_hidden_action->setChecked(false);
|
|
||||||
|
|
||||||
connect(ui->toolBar,&DefaultToolBar::showMeta, this, [&] {
|
|
||||||
DicomImageView *curV = ui->viewContainer->getCurrentView();
|
|
||||||
if (curV->hasSeries()) {
|
|
||||||
curV->showMetaData();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//AnnotationActor执行相关
|
|
||||||
void QDicomViewer::SetupMeasureTool() {
|
|
||||||
#define ADD_MEASURE_ACTION(index)\
|
|
||||||
m->addAction(tr(std::get<0>(MEASURE_ACTIIONS[index])), this, [=] {\
|
|
||||||
measureBtn->setChecked(true);\
|
|
||||||
QPixmap map(std::get<1>(MEASURE_ACTIIONS[index]));\
|
|
||||||
measureBtn->setIcon(QIcon(map));\
|
|
||||||
MeasureHelper::setMeasureType(std::get<2>(MEASURE_ACTIIONS[index]));\
|
|
||||||
ui->viewContainer->getViewManager()->activeMeasure();\
|
|
||||||
})
|
|
||||||
|
|
||||||
#define ADD_DEL_ACTION(text, type, func)\
|
|
||||||
m->addAction(tr(text), this, [=] {\
|
|
||||||
measureBtn->setChecked(true);\
|
|
||||||
m_cur_measure = type;\
|
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();\
|
|
||||||
if (curV != nullptr)\
|
|
||||||
{\
|
|
||||||
curV->func();\
|
|
||||||
}\
|
|
||||||
})
|
|
||||||
// measureBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
|
||||||
// measureBtn->setToolTip(QString("Measurements"));
|
|
||||||
//
|
|
||||||
// connect(measureBtn, &QToolButton::clicked, this, &QDicomViewer::executeActiveMeasure);
|
|
||||||
//
|
|
||||||
// QMenu *m;
|
|
||||||
// m = new QMenu(this);
|
|
||||||
//
|
|
||||||
// for (int j = 0; j < ACTION_COUNT; ++j) {
|
|
||||||
// ADD_MEASURE_ACTION(j);
|
|
||||||
// }
|
|
||||||
// m->addSeparator();
|
|
||||||
// ADD_DEL_ACTION("Delete selected", AnnotationActorType::DeleteSelectedAnn, deleteSelectedMeasure);
|
|
||||||
// ADD_DEL_ACTION("Delete all in current slice", AnnotationActorType::DeleteSliceAnn, deleteCurrentSliceMeasure);
|
|
||||||
// ADD_DEL_ACTION("Delete all in current series", AnnotationActorType::DeleteSeriesAnn, deleteCurrentSeriesMeasure);
|
|
||||||
// measureBtn->setPopupMode(QToolButton::MenuButtonPopup);
|
|
||||||
// measureBtn->setMenu(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QDicomViewer::executeActiveMeasure() {
|
|
||||||
ui->viewContainer->getViewManager()->activeMeasure();
|
|
||||||
DicomImageView *curV = ui->viewContainer->getCurrentView();
|
|
||||||
switch (MeasureHelper::getMeasureType()) {
|
|
||||||
case AnnotationActorType::DeleteSelectedAnn:
|
|
||||||
if (curV != nullptr) {
|
|
||||||
curV->deleteSelectedMeasure();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case AnnotationActorType::DeleteSliceAnn:
|
|
||||||
if (curV != nullptr) {
|
|
||||||
curV->deleteCurrentSliceMeasure();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case AnnotationActorType::DeleteSeriesAnn:
|
|
||||||
if (curV != nullptr) {
|
|
||||||
curV->deleteCurrentSeriesMeasure();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ui->viewContainer->getViewManager()->activeMeasure();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//视窗操作,播放相关
|
//视窗操作,播放相关
|
||||||
void QDicomViewer::SetupCineTool() {
|
void QDicomViewer::initCine() {
|
||||||
connect(ui->toolBar, &DefaultToolBar::cine, this, [&] {
|
connect(ui->toolBar, &DefaultToolBar::cine, this, [&] {
|
||||||
DicomImageView *curV = ui->viewContainer->getCurrentView();
|
DicomImageView *curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV->hasSeries()) {
|
if (curV->hasSeries()) {
|
||||||
@@ -241,15 +114,14 @@ void QDicomViewer::createVCRToolbar(DicomImageView *v) {
|
|||||||
v->setVCRToolbar(vcr_toolbar);
|
v->setVCRToolbar(vcr_toolbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
//视窗操作,fusion相关
|
|
||||||
void QDicomViewer::SetupFusionTool() {
|
|
||||||
connect(ui->toolBar, &DefaultToolBar::fusion, ui->viewContainer->getViewManager(), &ImageViewManager::switchFusion);
|
|
||||||
}
|
|
||||||
|
|
||||||
//视窗操作,wwwl
|
//视窗操作,wwwl
|
||||||
void QDicomViewer::SetupAdjustTool() {
|
void QDicomViewer::initViewOperation() {
|
||||||
connect(ui->toolBar, &DefaultToolBar::modeChanged, ui->viewContainer->getViewManager(), &ImageViewManager::setInteractionMode);
|
// operation mode change
|
||||||
|
connect(ui->toolBar, &DefaultToolBar::modeChanged, [=](int mode) {
|
||||||
|
printf("mode:%d\r\n",mode);
|
||||||
|
ui->viewContainer->getViewManager()->setInteractionMode(mode);
|
||||||
|
});
|
||||||
|
// custom window level
|
||||||
connect(ui->toolBar, &DefaultToolBar::customWindow, [=]() {
|
connect(ui->toolBar, &DefaultToolBar::customWindow, [=]() {
|
||||||
if (nullptr == m_customwin) {
|
if (nullptr == m_customwin) {
|
||||||
m_customwin = new Customwindow(this);
|
m_customwin = new Customwindow(this);
|
||||||
@@ -259,24 +131,17 @@ void QDicomViewer::SetupAdjustTool() {
|
|||||||
m_customwin->setModal(true);
|
m_customwin->setModal(true);
|
||||||
m_customwin->exec();
|
m_customwin->exec();
|
||||||
});
|
});
|
||||||
|
// negative window
|
||||||
connect(ui->toolBar, &DefaultToolBar::negativeWindow, [=]() {
|
connect(ui->toolBar, &DefaultToolBar::negativeWindow, [=]() {
|
||||||
DicomImageView *curV = ui->viewContainer->getViewManager()->getCurrentView();
|
DicomImageView *curV = ui->viewContainer->getViewManager()->getCurrentView();
|
||||||
if (curV != nullptr && curV->hasSeries()) {
|
if (curV != nullptr && curV->hasSeries()) {
|
||||||
curV->negativeWindow();
|
curV->negativeWindow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// fusion
|
||||||
}
|
connect(ui->toolBar, &DefaultToolBar::fusion,
|
||||||
|
ui->viewContainer->getViewManager(), &ImageViewManager::switchFusion);
|
||||||
//视窗操作,clear
|
// transform
|
||||||
void QDicomViewer::SetupEmptyTool() {
|
|
||||||
connect(ui->toolBar, &DefaultToolBar::clear,
|
|
||||||
ui->viewContainer->getViewManager(), &ImageViewManager::clearCurrentView);
|
|
||||||
}
|
|
||||||
|
|
||||||
//视窗操作,flip and rotation
|
|
||||||
void QDicomViewer::SetupTransformTool() {
|
|
||||||
connect(ui->toolBar, &DefaultToolBar::transform,[=](TransFormType type){
|
connect(ui->toolBar, &DefaultToolBar::transform,[=](TransFormType type){
|
||||||
DicomImageView *curV = ui->viewContainer->getCurrentView();
|
DicomImageView *curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->hasSeries()) {
|
if (curV != nullptr && curV->hasSeries()) {
|
||||||
@@ -304,50 +169,14 @@ void QDicomViewer::SetupTransformTool() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
// MPR
|
||||||
|
connect(ui->toolBar, &DefaultToolBar::changeSliceOrientation,
|
||||||
//视窗操作,sync mode
|
ui->viewContainer->getViewManager(), &ImageViewManager::switchSliceOrientation);
|
||||||
void QDicomViewer::SetupSyncTool() {
|
|
||||||
connect(EventsCenter::Default(), &EventsCenter::SyncStateChanged, this, &QDicomViewer::syncStateChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QDicomViewer::syncStateChanged() const {
|
|
||||||
if (!syncBtn) return;
|
|
||||||
switch (SyncHelper::getSyncState()) {
|
|
||||||
case AUTO_SYNC:
|
|
||||||
// syncBtn->setIcon(mAutoIcon);
|
|
||||||
m_sync_state_action->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[AUTO_SYNC]));
|
|
||||||
for (int i = 0; i < SYNC_ITEM_NUM; i++) {
|
|
||||||
m_sync_item_action[i]->setDisabled(false);
|
|
||||||
}
|
|
||||||
m_sync_item_action[SLICE_POS]->setChecked(SyncHelper::getSyncItem(SLICE_POS));
|
|
||||||
m_sync_item_action[WIDTH_LEVEL]->setChecked(SyncHelper::getSyncItem(WIDTH_LEVEL));
|
|
||||||
m_sync_item_action[ZOOM_PAN]->setChecked(SyncHelper::getSyncItem(ZOOM_PAN));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MANUAL_SYNC:{
|
|
||||||
// syncBtn->setIcon(mManualIcon);
|
|
||||||
m_sync_state_action->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[MANUAL_SYNC]));
|
|
||||||
m_sync_item_action[SLICE_POS]->setChecked(SyncHelper::getSyncItem(SLICE_POS));
|
|
||||||
m_sync_item_action[WIDTH_LEVEL]->setChecked(SyncHelper::getSyncItem(WIDTH_LEVEL));
|
|
||||||
m_sync_item_action[ZOOM_PAN]->setChecked(SyncHelper::getSyncItem(ZOOM_PAN));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DIS_SYNC:
|
|
||||||
// syncBtn->setIcon(mDisIcon);
|
|
||||||
m_sync_state_action->setText(QString(tr("CUR STATE: %1")).arg(SyncHelper::SyncStateName[DIS_SYNC]));
|
|
||||||
for (int i = 0; i < SYNC_ITEM_NUM; i++) {
|
|
||||||
m_sync_item_action[i]->setChecked(false);
|
|
||||||
m_sync_item_action[i]->setDisabled(true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//视窗操作?,file open相关
|
//视窗操作?,file open相关
|
||||||
void QDicomViewer::SetupFileTool() {
|
void QDicomViewer::initGeneralTool() {
|
||||||
|
// open dir
|
||||||
connect(ui->toolBar,&DefaultToolBar::openFolder, [&] {
|
connect(ui->toolBar,&DefaultToolBar::openFolder, [&] {
|
||||||
QString p = QFileDialog::getExistingDirectory(this, tr("Open dicom directory"),
|
QString p = QFileDialog::getExistingDirectory(this, tr("Open dicom directory"),
|
||||||
m_qs.value("DIR_PATH_ID").toString());
|
m_qs.value("DIR_PATH_ID").toString());
|
||||||
@@ -356,20 +185,15 @@ void QDicomViewer::SetupFileTool() {
|
|||||||
openDICOM(p.toLocal8Bit().toStdString(), DIR_OPEN_MODE);
|
openDICOM(p.toLocal8Bit().toStdString(), DIR_OPEN_MODE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// openfile
|
||||||
connect(ui->toolBar,&DefaultToolBar::openFile, [&] {
|
connect(ui->toolBar,&DefaultToolBar::openFile, [&] {
|
||||||
//QSettings s;
|
|
||||||
//QString p = s.value(FILE_PATH_ID).toString();
|
|
||||||
QString fn = QFileDialog::getOpenFileName(this, tr("Open dicom files"), m_qs.value("FILE_PATH_ID").toString());
|
QString fn = QFileDialog::getOpenFileName(this, tr("Open dicom files"), m_qs.value("FILE_PATH_ID").toString());
|
||||||
if (!fn.isEmpty()) {
|
if (!fn.isEmpty()) {
|
||||||
m_qs.setValue("FILE_PATH_ID", fn);
|
m_qs.setValue("FILE_PATH_ID", fn);
|
||||||
openDICOM(fn.toLocal8Bit().toStdString(), FILE_OPEN_MODE);
|
openDICOM(fn.toLocal8Bit().toStdString(), FILE_OPEN_MODE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
// import
|
||||||
|
|
||||||
void QDicomViewer::SetupImportTool() {
|
|
||||||
|
|
||||||
connect(ui->toolBar, &DefaultToolBar::import, this, [&] {
|
connect(ui->toolBar, &DefaultToolBar::import, this, [&] {
|
||||||
if (nullptr == m_import) {
|
if (nullptr == m_import) {
|
||||||
m_import = new ImportWidget(this);
|
m_import = new ImportWidget(this);
|
||||||
@@ -377,10 +201,7 @@ void QDicomViewer::SetupImportTool() {
|
|||||||
}
|
}
|
||||||
m_import->show();
|
m_import->show();
|
||||||
});
|
});
|
||||||
}
|
// export
|
||||||
|
|
||||||
void QDicomViewer::SetupExportTool() {
|
|
||||||
|
|
||||||
connect(ui->toolBar, &DefaultToolBar::save, this, [=] {
|
connect(ui->toolBar, &DefaultToolBar::save, this, [=] {
|
||||||
if (nullptr == exportDialog) {
|
if (nullptr == exportDialog) {
|
||||||
exportDialog = new ExportDialog(this);
|
exportDialog = new ExportDialog(this);
|
||||||
@@ -389,16 +210,14 @@ void QDicomViewer::SetupExportTool() {
|
|||||||
}
|
}
|
||||||
exportDialog->show();
|
exportDialog->show();
|
||||||
});
|
});
|
||||||
}
|
// open meta dialog
|
||||||
|
connect(ui->toolBar,&DefaultToolBar::showMeta, this, [&] {
|
||||||
void QDicomViewer::displayThumbnailBar(bool value) {
|
DicomImageView *curV = ui->viewContainer->getCurrentView();
|
||||||
// VCRHelper::setThumbnailbar(value);
|
if (curV->hasSeries()) {
|
||||||
// ui->thumbnailBar->setVisible(value);
|
curV->showMetaData();
|
||||||
// m_preview_display_action->setChecked(value);
|
}
|
||||||
}
|
});
|
||||||
|
// layout
|
||||||
void QDicomViewer::SetupGridTool() {
|
|
||||||
// connect
|
|
||||||
connect(ui->toolBar, &DefaultToolBar::showGrid, this, [=](QToolButton* btn) {
|
connect(ui->toolBar, &DefaultToolBar::showGrid, this, [=](QToolButton* btn) {
|
||||||
// auto delete while hidden
|
// auto delete while hidden
|
||||||
GridPopWidget *gpw = new GridPopWidget(btn);
|
GridPopWidget *gpw = new GridPopWidget(btn);
|
||||||
@@ -407,20 +226,19 @@ void QDicomViewer::SetupGridTool() {
|
|||||||
gpw->move(this->geometry().topLeft() + btn->geometry().bottomLeft() + QPoint(5, 5));
|
gpw->move(this->geometry().topLeft() + btn->geometry().bottomLeft() + QPoint(5, 5));
|
||||||
gpw->show();
|
gpw->show();
|
||||||
});
|
});
|
||||||
|
// clear view window
|
||||||
|
connect(ui->toolBar, &DefaultToolBar::clear,
|
||||||
|
ui->viewContainer->getViewManager(), &ImageViewManager::clearCurrentView);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QDicomViewer::SetupConnections() {
|
void QDicomViewer::displayThumbnailBar(bool value) {
|
||||||
//通知左侧的缩略图bar ,当前选中series的变换
|
VCRHelper::setThumbnailbar(value);
|
||||||
connect(ui->viewContainer, &ViewContainerWidget::onThumbnailTrigger,
|
ui->thumbnailBar->setVisible(value);
|
||||||
ui->thumbnailBar, &ThumbnailBarWidget::Slot_setCurrentThumbnail);
|
}
|
||||||
|
|
||||||
//通知右侧显示区域,当前有series被点击
|
|
||||||
connect(ui->thumbnailBar, &ThumbnailBarWidget::Signal_ThumbClicked,
|
|
||||||
ui->viewContainer->getViewManager(), &ImageViewManager::viewReload);
|
|
||||||
|
|
||||||
connect(ui->toolBar, &QToolBar::visibilityChanged,
|
|
||||||
this, &QDicomViewer::Slot_ToolbarVisibilityChanged);
|
|
||||||
|
|
||||||
|
void QDicomViewer::initScreenControl() {
|
||||||
|
connect(ui->toolBar,&DefaultToolBar::parentWindowStateChange,this,&QDicomViewer::setWindowState);
|
||||||
|
connect(ui->toolBar,&DefaultToolBar::parentWindowClose, this, &QWidget::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QDicomViewer::Slot_ToolbarVisibilityChanged(bool visible) {
|
void QDicomViewer::Slot_ToolbarVisibilityChanged(bool visible) {
|
||||||
@@ -455,10 +273,9 @@ void QDicomViewer::openDICOM(const std::string &dicomName, SeriesOpenMode openMo
|
|||||||
|
|
||||||
|
|
||||||
void QDicomViewer::resetToolBarButtons(ViewFunctionState state) {
|
void QDicomViewer::resetToolBarButtons(ViewFunctionState state) {
|
||||||
fusionBtn->setEnabled(state.canFusion);
|
// fusionBtn->setEnabled(state.canFusion);
|
||||||
mprBtn->setEnabled(state.canMPR);
|
// mprBtn->setEnabled(state.canMPR);
|
||||||
SyncHelper::setSyncState(state.canSync?AUTO_SYNC:DIS_SYNC);
|
SyncHelper::setSyncState(state.canSync?AUTO_SYNC:DIS_SYNC);
|
||||||
syncStateChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,30 +41,18 @@ private:
|
|||||||
*/
|
*/
|
||||||
void Initial();
|
void Initial();
|
||||||
|
|
||||||
void createToolButton();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于设置ToolButton相关的属性(文字、图标、槽等)的一组函数
|
* 用于设置ToolButton相关的属性(文字、图标、槽等)的一组函数
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
void SetupFileTool();
|
void initGeneralTool();
|
||||||
void SetupImportTool();
|
|
||||||
void SetupExportTool();
|
|
||||||
|
|
||||||
void SetupGridTool();
|
void initViewOperation();
|
||||||
void SetupSyncTool();
|
|
||||||
void SetupAnnoTool();
|
|
||||||
|
|
||||||
void SetupAdjustTool();
|
void initCine();
|
||||||
void SetupMeasureTool();
|
|
||||||
|
|
||||||
void SetupTransformTool();
|
|
||||||
void SetupFusionTool();
|
|
||||||
void SetupCineTool();
|
|
||||||
void SetupEmptyTool();
|
|
||||||
|
|
||||||
|
|
||||||
void SetupScreenTool();
|
void initScreenControl();
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,11 +74,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
void SetupConnections();
|
void SetupConnections();
|
||||||
|
|
||||||
/**
|
|
||||||
* 按照annType的类型,在Container中执行对应的Measurement操作
|
|
||||||
*/
|
|
||||||
void executeActiveMeasure();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 为对应的DicomImageView构建对应的播放控件
|
* 为对应的DicomImageView构建对应的播放控件
|
||||||
* @param v
|
* @param v
|
||||||
@@ -99,25 +82,13 @@ private:
|
|||||||
|
|
||||||
void resetToolBarButtons(ViewFunctionState state);
|
void resetToolBarButtons(ViewFunctionState state);
|
||||||
|
|
||||||
QToolButton* syncBtn = nullptr;
|
|
||||||
QToolButton* fusionBtn = nullptr;
|
|
||||||
QToolButton* mprBtn = nullptr;
|
|
||||||
QAction *m_sync_item_action[SYNC_ITEM_NUM];
|
|
||||||
QAction* m_sync_state_action;
|
|
||||||
QAction* m_measure_hidden_action;
|
|
||||||
QAction* m_patient_hidden_action;
|
|
||||||
|
|
||||||
|
|
||||||
ExportDialog *exportDialog = nullptr;
|
ExportDialog *exportDialog = nullptr;
|
||||||
ImportWidget *m_import =nullptr;
|
ImportWidget *m_import =nullptr;
|
||||||
QSettings m_qs;
|
QSettings m_qs;
|
||||||
Customwindow *m_customwin =nullptr;
|
Customwindow *m_customwin =nullptr;
|
||||||
|
|
||||||
AnnotationActorType m_cur_measure = AnnotationActorType::RulerAnn;
|
|
||||||
|
|
||||||
WorkerManager workerManager;
|
WorkerManager workerManager;
|
||||||
ImageViewStateCheckWorker worker;
|
ImageViewStateCheckWorker worker;
|
||||||
|
|
||||||
void syncStateChanged() const;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user