-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimageseriesselectionwidget.cpp
More file actions
142 lines (109 loc) · 4.07 KB
/
imageseriesselectionwidget.cpp
File metadata and controls
142 lines (109 loc) · 4.07 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#include "imageseriesselectionwidget.h"
#include "separator.h"
ImageSeriesSelectionWidget::ImageSeriesSelectionWidget(QList<Patient*>* patients, QWidget *parent) :
QWidget(parent)
,m_Layout(NULL)
,m_LabelSelectPatient(NULL)
,m_NodeComboBoxSelectPatient(NULL)
,m_StudiesTable(NULL)
{
m_PatientsPtr = patients;
this->InitializeWidget();
}
ImageSeriesSelectionWidget::~ImageSeriesSelectionWidget()
{
}
void ImageSeriesSelectionWidget::LockPatientSelection(bool lock)
{
this->GetNodeComboBoxSelectPatient()->setDisabled(lock);
if(lock)
this->GetNodeComboBoxSelectPatient()->setToolTip("Patient selection has been disabled since there already has been created a finding for the current Patient.\n\nIn order to change the Patient please create a new Report or remove all Findings for the current Patient!");
else
this->GetNodeComboBoxSelectPatient()->setToolTip("");
}
void ImageSeriesSelectionWidget::InitializeWidget()
{
static bool initialized = false;
if(initialized == false)
{
this->GetLayout()->addWidget(this->GetLabelSelectPatient(),0,0);
this->GetLayout()->addWidget(this->GetNodeComboBoxSelectPatient(),1,0);
this->GetLayout()->addWidget(new Separator(this),2,0);
this->GetLayout()->addWidget(this->GetStudiesTable(),3,0);
this->setLayout(this->GetLayout());
initialized = true;
}
}
void ImageSeriesSelectionWidget::UndoTableRowCheck(int row)
{
this->GetStudiesTable()->CheckTableRow(row);
}
void ImageSeriesSelectionWidget::UpdateStudiesTable(QList<Study*>* allPatientStudies, const QList<Study*>& selectedPatientStudies)
{
this->GetStudiesTable()->ClearTableContents();
if(allPatientStudies == NULL)
return;
for(int i=0; i < allPatientStudies->size(); ++i)
{
Study* tempStudy = allPatientStudies->value(i);
bool selected = selectedPatientStudies.contains(tempStudy);
this->GetStudiesTable()->InsertTableRow(selected,tempStudy->GetDateStr(),tempStudy->GetTimeStr(),tempStudy->GetModalityStr());
}
}
QGridLayout* ImageSeriesSelectionWidget::GetLayout()
{
if(m_Layout == NULL)
{
m_Layout = new QGridLayout(this);
}
return m_Layout;
}
QLabel* ImageSeriesSelectionWidget::GetLabelSelectPatient()
{
if(m_LabelSelectPatient == NULL)
{
m_LabelSelectPatient = new QLabel("Select a Patient from the DICOM Database", this);
}
return m_LabelSelectPatient;
}
NodeComboBox* ImageSeriesSelectionWidget::GetNodeComboBoxSelectPatient()
{
if(m_NodeComboBoxSelectPatient == NULL)
{
m_NodeComboBoxSelectPatient = new NodeComboBox("Patient",this->UpdatePatientNamesList(),this);
m_NodeComboBoxSelectPatient->HideOperator(NodeComboBox::DELETE);
m_NodeComboBoxSelectPatient->HideOperator(NodeComboBox::CREATE);
m_NodeComboBoxSelectPatient->HideOperator(NodeComboBox::RENAME);
m_NodeComboBoxSelectPatient->HideOperator(NodeComboBox::SEPPARATOR);
m_NodeComboBoxSelectPatient->Update();
connect(m_NodeComboBoxSelectPatient, SIGNAL(SignalSelected(QString)), this, SIGNAL(SignalPatientChanged(QString)) );
}
return m_NodeComboBoxSelectPatient;
}
QList<QString>* ImageSeriesSelectionWidget::UpdatePatientNamesList()
{
m_ListPatientNames.clear();
for(int i=0; i < m_PatientsPtr->size(); ++i)
{
Patient* tempPat = m_PatientsPtr->at(i);
m_ListPatientNames.append(tempPat->GetName());
}
return &m_ListPatientNames;
}
void ImageSeriesSelectionWidget::UpdatePatientsNamesListNodeComboBox(Patient* currentPatient)
{
this->UpdatePatientNamesList();
if(currentPatient)
this->GetNodeComboBoxSelectPatient()->Update(currentPatient->GetName());
else
this->GetNodeComboBoxSelectPatient()->Update();
}
StudiesTable* ImageSeriesSelectionWidget::GetStudiesTable()
{
if(m_StudiesTable == NULL)
{
m_StudiesTable = new StudiesTable(this);
connect(m_StudiesTable, SIGNAL(SignalStudySelected(int,bool)), this, SIGNAL(SignalStudySelected(int,bool)) );
}
return m_StudiesTable;
}