-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathctkDICOMAppWidget2.h
157 lines (124 loc) · 5.29 KB
/
ctkDICOMAppWidget2.h
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*=========================================================================
Library: CTK
Copyright (c) Kitware Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#ifndef __ctkDICOMAppWidget2_h
#define __ctkDICOMAppWidget2_h
// me
#include "ctkdicomappwidget2_export.h"
// Qt includes
#include <QWidget>
class ctkDICOMAppWidget2Private;
class ctkThumbnailLabel;
class QModelIndex;
class ctkDICOMDatabase;
/// \ingroup DICOM_Widgets
class CTKDICOMAPPWIDGET2_EXPORT ctkDICOMAppWidget2 : public QWidget
{
Q_OBJECT
Q_PROPERTY(ctkDICOMDatabase* database READ database)
Q_PROPERTY(QString databaseDirectory READ databaseDirectory WRITE setDatabaseDirectory)
Q_PROPERTY(QStringList tagsToPrecache READ tagsToPrecache WRITE setTagsToPrecache)
Q_PROPERTY(bool displayImportSummary READ displayImportSummary WRITE setDisplayImportSummary)
public:
typedef QWidget Superclass;
explicit ctkDICOMAppWidget2(QWidget* parent=0);
virtual ~ctkDICOMAppWidget2();
/// Directory being used to store the dicom database
QString databaseDirectory() const;
/// See ctkDICOMDatabase for description - these accessors
/// delegate to the corresponding routines of the internal
/// instance of the database.
/// @see ctkDICOMDatabase
void setTagsToPrecache(const QStringList tags);
const QStringList tagsToPrecache();
/// Updates schema of loaded database to match the one
/// coded by the current version of ctkDICOMDatabase.
/// Also provides a dialog box for progress
void updateDatabaseSchemaIfNeeded();
ctkDICOMDatabase* database();
/// Option to show or not import summary dialog.
/// Since the summary dialog is modal, we give the option
/// of disabling it for batch modes or testing.
void setDisplayImportSummary(bool);
bool displayImportSummary();
/// Accessors to status of last directory import operation
int patientsAddedDuringImport();
int studiesAddedDuringImport();
int seriesAddedDuringImport();
int instancesAddedDuringImport();
public Q_SLOTS:
void setDatabaseDirectory(const QString& directory);
void onFileIndexed(const QString& filePath);
void on_ActionImport_triggered();
void on_ActionExport_triggered();
void on_ActionQuery_triggered();
void on_ActionClear_triggered();
void on_ActionSend_triggered();
void on_ActionRemove_triggered();
void suspendModel();
void resumeModel();
void resetModel();
/// Import a directory - this is used when the user selects a directory
/// from the Import Dialog, but can also be used externally to trigger
/// an import (i.e. for testing or to support drag-and-drop)
void onImportDirectory(QString directory);
/// slots to capture status updates from the database during an
/// import operation
void onPatientAdded(int, QString, QString, QString);
void onStudyAdded(QString);
void onSeriesAdded(QString);
void onInstanceAdded(QString);
Q_SIGNALS:
// /// Emited when directory is changed
// void databaseDirectoryChanged(const QString&);
// /// Emited when query/retrieve operation has happened
// void queryRetrieveFinished();
// /// Emited when the directory import operation has completed
// void directoryImported();
void imageFilesSent(QStringList imageFiles);
protected:
QScopedPointer<ctkDICOMAppWidget2Private> d_ptr;
protected Q_SLOTS:
void onModelSelected(const QModelIndex& index);
/// To be called when a thumbnail in thumbnail list widget is selected
void onThumbnailSelected(const ctkThumbnailLabel& widget);
/// To be called when a thumbnail in thumbnail list widget is double-clicked
void onThumbnailDoubleClicked(const ctkThumbnailLabel& widget);
/// To be called when previous and next buttons are clicked
void onNextImage();
void onPreviousImage();
void onNextSeries();
void onPreviousSeries();
void onNextStudy();
void onPreviousStudy();
/// To be called when dialog finishes
void onQueryRetrieveFinished();
/// To be called when an entry of the tree list is collapsed
void onTreeCollapsed(const QModelIndex& index);
/// To be called when an entry of the tree list is expanded
void onTreeExpanded(const QModelIndex& index);
/// To be called when auto-play checkbox state changed
void onAutoPlayCheckboxStateChanged(int state);
/// Called by timer for auto-play functionality
void onAutoPlayTimer();
/// To be called when the value of thumbnail size slider bar is changed
void onThumbnailWidthSliderValueChanged(int val);
/// To be called when search parameters in query widget changed
void onSearchParameterChanged();
/// To be called after image preview displayed an image
void onImagePreviewDisplayed(int imageID, int count);
private:
Q_DECLARE_PRIVATE(ctkDICOMAppWidget2);
Q_DISABLE_COPY(ctkDICOMAppWidget2);
};
#endif