-
Notifications
You must be signed in to change notification settings - Fork 0
/
QtDcmManager.h
336 lines (267 loc) · 7.92 KB
/
QtDcmManager.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
/*
QtDcm is a C++ Qt based library for communication and conversion of Dicom images.
Copyright (C) 2011 Alexandre Abadie <Alexandre.Abadie@univ-rennes1.fr>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef QTDCMMANAGER_H_
#define QTDCMMANAGER_H_
#include "qtdcmExports.h"
#include <QtGui>
#include <QtNetwork>
#include <QTreeWidget>
class QtDcm;
class QtDcmServer;
class QtDcmPreferences;
class QtDcmFindScuSignalManager;
class QtDcmPreviewWidget;
class QtDcmImportWidget;
class QtDcmSerieInfoWidget;
class QtDcmManagerPrivate;
/**
* This class is in charge of the different process (dcm2nii), pacs query/retrieve (dcm4chee),
* temporary directory creation and removing, PACS server settings.
*
*/
class QtDcmManager : public QObject
{
Q_OBJECT
private:
void generateCurrentSerieDir();
void deleteCurrentSerieDir();
/**
* Create the temporary directory (/tmp/qtdcm on Unix) and the logging directory.
* (/tmp/qtdcm/logs)
*/
void createTemporaryDirs();
public:
enum outputdirmode
{
CUSTOM, DIALOG
};
enum convertiontool
{
ITK, DCM2NII
};
static QtDcmManager*
instance();
/**
* Default constructor. Instantiate the internal pointers and create the temporary directory.
*/
QtDcmManager();
/**
* The default destructor
*/
virtual ~QtDcmManager();
/**
* Find SCU with Dcmtk code
*/
void findPatientsScu();
void findStudiesScu ( QString patientName );
void findSeriesScu ( QString patientName, QString studyUID );
void findImagesScu ( QString uid );
void foundPatient ( QMap<QString, QString> infosMap );
void foundStudy ( QMap<QString, QString> infosMap );
void foundSerie ( QMap<QString, QString> infosMap );
// void foundImage ( QMap<QString, QString> infosMap );
void foundImage ( QString image, int number );
void moveSelectedSeries();
void getPreviewFromSelectedSerie ( QString uid, int elementCount );
// void getPreviewFromSelectedSerie ( int elementIndex );
void findPatientsDicomdir();
void findStudiesDicomdir ( QString patientName );
void findSeriesDicomdir ( QString patientName, QString studyDescription );
void findImagesDicomdir ( QString serieUID );
void setQtDcmWidget ( QtDcm * widget );
void setPatientsTreeWidget ( QTreeWidget * widget );
void setStudiesTreeWidget ( QTreeWidget * widget );
void setSeriesTreeWidget ( QTreeWidget * widget );
void setImportWidget ( QtDcmImportWidget * widget );
void setPreviewWidget ( QtDcmPreviewWidget * widget );
void setSerieInfoWidget ( QtDcmSerieInfoWidget * widget );
void setOutputdirMode ( QtDcmManager::outputdirmode mode );
QtDcmManager::outputdirmode getOutputdirMode();
void clearSerieInfo();
void updateSerieInfo ( QString eltCount, QString institution, QString name );
/**
* This method read the dicomdir file and populate the patient treewidget
*
*/
void loadDicomdir();
/**
* Convenience method that display error message in a QMessageBox window.
*
* @param message the error message to display
*/
void displayErrorMessage ( QString message );
/**
* Convenience method that display information message in a QMessageBox window.
*
* @param info the information message to display
*/
void displayMessage ( QString info );
/**
* Return the dicomdir absolute path name
*
* @return _dicomdir the dicomdir file name.
*/
QString getDicomdir() const;
/**
* Set the dicomdir file name
*
* @param dicomdir the dicomdir file name
*/
void setDicomdir ( QString dicomdir );
/**
* Return the output directory where the current serie will be reconstructed
*
* @return _outputdir the output directory path
*/
QString getOutputDirectory() const;
/**
* Set the output directory
*
* @param directory the output directory
*/
void setOutputDirectory ( QString directory );
QtDcmServer * getCurrentPacs();
void setCurrentPacs ( int index );
/**
* Patient name getter
*
* @return _patientName as a QString
*/
QString getPatientName();
/**
* Patient name setter
*
* @param patientName as a QString
*/
void setPatientName ( QString patientName );
/**
* Patient id getter
*
* @return _patientId as a QString
*/
QString getPatientId();
/**
* Patient id setter
*
* @param patientId as a QString
*/
void setPatientId ( QString patientId );
QString getPatientBirthDate();
QString getPatientSex();
void setPatientSex ( QString sex );
/**
* Serie description getter
*
* @return _serieDescription as a QString
*/
QString getSerieDescription();
/**
* Serie description setter
*
* @param serieDescription as a QString
*/
void setSerieDescription ( QString serieDescription );
/**
* Study description getter
*
* @return _studyDescription as a QString
*/
QString getStudyDescription();
/**
* Study description setter
*
* @param studyDescription as a QString
*/
void setStudyDescription ( QString studyDescription );
QString getExamDate();
/**
* Study modality setter
*
* @param modality as a QString
*/
void setModality ( QString modality );
/**
* Study modality getter
*
* @return _modality as a QString
*/
QString getModality();
/**
* Study date setter
*
* @param date as a QString
*/
void setDate1 ( QString date );
/**
* Study date getter
*
* @return _date as a QString
*/
QString getDate1();
/**
* Study date setter
*
* @param date as a QString
*/
void setDate2 ( QString date );
/**
* Study date getter
*
* @return _date as a QString
*/
QString getDate2();
void addSerieToImport ( QString uid );
void removeSerieToImport ( QString uid );
void clearSeriesToImport();
int seriesToImportSize();
/**
* add patient in the list
*/
void addPatient();
/**
* Mode getter
*/
QString getMode();
void setImagesList ( QList<QString> images );
QList<QString> getListImages();
void clearListImages();
void setSerieId ( QString id );
QString getCurrentSerieDirectory();
// void setPreviewImageUID ( QString uid );
bool useConverter();
void useConverter ( bool use );
/**
* This method try to delete the temporary directory when closing the QtDcm widget
* (Doesn't work for the moment)
*/
void deleteTemporaryDirs();
public slots:
void updateProgressBar ( int i );
void moveSeriesFinished();
void clearPreview();
void makePreview ( QString filename );
void onSerieMoved ( QString directory, QString uid, int number );
void importSelectedSeries();
void importToDirectory ( QString directory );
signals:
void serieMoved ( QString directory );
void importFinished();
void gettingPreview();
private:
static QtDcmManager * _instance;
QtDcmManagerPrivate *d;
};
#endif /* QTDCMMANAGER_H_ */