QtDcmManager.h
Go to the documentation of this file.
1 /*
2  QtDcm is a C++ Qt based library for communication and conversion of Dicom images.
3  Copyright (C) 2011 Alexandre Abadie <Alexandre.Abadie@univ-rennes1.fr>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 #ifndef QTDCMMANAGER_H_
21 #define QTDCMMANAGER_H_
22 
23 #include "qtdcmExports.h"
24 #include <QtGui>
25 #include <QtNetwork>
26 
27 class QTreeWidget;
28 class QtDcm;
29 class QtDcmServer;
30 class QtDcmPreferences;
31 class QtDcmFindScuSignalManager;
32 class QtDcmPreviewWidget;
33 class QtDcmImportWidget;
35 
37 
44 class QTDCM_EXPORT QtDcmManager : public QObject
45 {
46  Q_OBJECT
47 
48 public:
50  CUSTOM = 0,
51  DIALOG
52  };
53 
55  ITK = 0,
56  DCM2NII
57  };
58 
59  enum eMoveMode {
60  MEDIA = 0,
61  PACS
62  };
63 
64  static QtDcmManager* instance();
65  static void destroy();
66 
70  void findPatientsScu();
71  void findStudiesScu ( const QString &patientName );
72  void findSeriesScu ( const QString &patientName,
73  const QString &studyUID );
74  void findImagesScu ( const QString &uid );
75  void foundPatient ( const QMap<QString, QString> &infosMap );
76  void foundStudy ( const QMap<QString, QString> &infosMap );
77  void foundSerie ( const QMap<QString, QString> &infosMap );
78 // void foundImage ( QMap<QString, QString> infosMap );
79  void foundImage ( const QString &image, int number );
80  void moveSelectedSeries();
81  void getPreviewFromSelectedSerie ( const QString &uid, int elementCount );
82 // void getPreviewFromSelectedSerie ( int elementIndex );
83 
84  void findPatientsDicomdir();
85  void findStudiesDicomdir ( const QString &patientName );
86  void findSeriesDicomdir ( const QString &patientName,
87  const QString &studyDescription );
88  void findImagesDicomdir ( const QString &serieUID );
89 
90  void setQtDcmWidget ( QtDcm * widget );
91  void setPatientsTreeWidget ( QTreeWidget * widget );
92  void setStudiesTreeWidget ( QTreeWidget * widget );
93  void setSeriesTreeWidget ( QTreeWidget * widget );
94 
95  void setImportWidget ( QtDcmImportWidget * widget );
96  void setPreviewWidget ( QtDcmPreviewWidget * widget );
97  void setSerieInfoWidget ( QtDcmSerieInfoWidget * widget );
98 
99  void setOutputdirMode ( QtDcmManager::eOutputdirMode mode );
100  QtDcmManager::eOutputdirMode getOutputdirMode() const;
101 
102  void clearSerieInfo();
103  void updateSerieInfo ( const QString &eltCount,
104  const QString &institution,
105  const QString &name );
106 
111  void loadDicomdir();
112 
118  void displayErrorMessage ( const QString &message );
119 
125  void displayMessage ( const QString &info );
126 
132  QString dicomdir() const;
133 
139  void setDicomdir ( const QString &dicomdir );
140 
146  QString outputDirectory() const;
147 
153  void setOutputDirectory ( const QString &directory );
154 
155  QtDcmServer currentPacs() const;
156 
157  void setCurrentPacs ( int index );
158 
164  QString patientName() const;
165 
171  void setPatientName ( const QString &patientName );
172 
178  QString patientId() const;
179 
185  void setPatientId ( const QString &patientId );
186 
187  QString patientBirthdate() const;
188 
189  QString patientGender() const;
190 
191  void setPatientGender ( const QString &sex );
192 
198  QString seriesDescription() const;
199 
205  void setSerieDescription ( const QString &serieDescription );
206 
212  QString studyDescription() const;
213 
219  void setStudyDescription ( const QString &studyDescription );
220 
221  QString examDate() const;
222 
228  void setModality ( const QString &modality );
229 
235  QString modality() const;
236 
242  void setStartDate ( const QDate &date );
243 
249  QDate startDate() const;
250 
256  void setEndDate ( const QDate &date );
257 
263  QDate endDate() const;
264 
265  void addSerieToImport ( const QString &uid );
266 
267  void removeSerieToImport ( const QString &uid );
268 
269  void clearSeriesToImport();
270 
271  int seriesToImportSize();
272 
276  void addPatient();
277 
281  eMoveMode mode() const;
282 
283  void setListOfImages ( const QStringList &images );
284 
285  QList<QString> listOfImages() const;
286  void clearListOfImages();
287 
288  void setSerieId ( const QString &id );
289 
290  QString currentSeriesDirectory() const;
291 
292 // void setPreviewImageUID ( QString uid );
293 
294  bool useExternalConverter() const;
295 
296  void setUseExternalConverter ( bool use );
297 
302  void deleteTemporaryDirs();
303 
304 public slots:
305 // void onPatientFound()
306 
307  void updateProgressBar ( int i );
308  void moveSeriesFinished();
309  void clearPreview();
310  void makePreview ( const QString &filename );
311  void onSerieMoved ( const QString &directory, const QString &uid, int number );
312 
313  void importSelectedSeries();
314  void importToDirectory ( const QString &directory );
315 
316 signals:
317  void serieMoved ( const QString &directory );
318  void importFinished();
319  void gettingPreview();
320 
321 private:
326  QtDcmManager(QObject * parent = 0);
327  virtual ~QtDcmManager();
328 
329  void generateCurrentSerieDir();
330 
331  void deleteCurrentSerieDir();
332 
337  void createTemporaryDirs();
338 
339 private:
340  static QtDcmManager * _instance;
342 };
343 
344 #endif /* QTDCMMANAGER_H_ */
This class is in charge of the different process (dcm2nii), pacs query/retrieve (dcm4chee), temporary directory creation and removing, PACS server settings.
Definition: QtDcmManager.h:44
#define QTDCM_EXPORT
Definition: qtdcmExports.h:11
This class is a representation of a Dicom PACS server.
Definition: QtDcmServer.h:30
Class that manages the settings of QtDcm.
This class contains the widget for managing Dicom data.
Definition: QtDcm.h:36