-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainWindow.cpp
62 lines (55 loc) · 1.54 KB
/
mainWindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "mainWindow.h"
#include "ui_mainWindow.h"
#include <QtWidgets>
#include "MultiImageView.h"
#include "BasicVtkDefine.h"
#include <QSpinBox>
#include "MultiImageView2.h"
#include "vtkDICOMImageReader.h"
mianWindow *mianWindow::self = nullptr;
mianWindow::mianWindow(QWidget *parent) : QMainWindow(parent), ui_(new Ui::MainWindow_ui)
{
//setStyleSheet(dtcp::QHelper::getStyleQss("mianWindow"));
ui_->setupUi(this);
self = this;
connect(ui_->switch_btn, &QPushButton::clicked, this, &mianWindow::OnSwitchLayout);
//connect(ui_->toolButtonHelp, SIGNAL(clicked()), this, SLOT(OnHelp()));
}
mianWindow::~mianWindow()
{
self = nullptr;
}
void mianWindow::initiate()
{
//read dicom seriers
vtkNew<vtkDICOMImageReader> reader;
reader->SetDirectoryName("D:\\ct_data\\mri\\PA1\\ST0\\SE4");
reader->Update();
reader->GetImageOrientationPatient();
bool show_one_window = true;
if (show_one_window)
{
m_views = new MultiImageView2(ui_->main_widget);
m_views->initiate(reader->GetOutput());
}
else
{
MultiImageView* views = new MultiImageView(ui_->main_widget);
views->initiate(reader->GetOutput());
views->showCrossViews();
}
//// Picker to pick pixels
//vtkSmartPointer<vtkPointPicker> propPicker = vtkSmartPointer<vtkPointPicker>::New();
////propPicker->PickFromListOn();
}
void mianWindow::OnClose()
{
QCoreApplication::quit();
}
void mianWindow::OnSwitchLayout()
{
if (m_views->get_cur_layout() == LAYOUT_TCSV)
m_views->SwitchToTCS();
else if(m_views->get_cur_layout() == LAYOUT_TCS)
m_views->SwitchToTCSV();
}