CustusX  16.5.0-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxDICOMAppWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __cxDICOMAppWidget_h
22 #define __cxDICOMAppWidget_h
23 
24 #include "org_custusx_dicom_Export.h"
25 
26 // Qt includes
27 #include <QWidget>
28 
29 class ctkThumbnailLabel;
30 class QModelIndex;
31 class ctkDICOMDatabase;
32 class QItemSelection;
33 
34 namespace cx
35 {
36 class DICOMAppWidgetPrivate;
37 
38 
47 class org_custusx_dicom_EXPORT DICOMAppWidget : public QWidget
48 {
49  Q_OBJECT
50 
51 public:
52  typedef QWidget Superclass;
53  explicit DICOMAppWidget(QWidget* parent=0);
54  virtual ~DICOMAppWidget();
55 
57  QString databaseDirectory() const;
58 
63  void setTagsToPrecache(const QStringList tags);
64  const QStringList tagsToPrecache();
65 
69  void updateDatabaseSchemaIfNeeded();
70 
71  QStringList getSelectedPatients();
72  QStringList getSelectedStudies();
73  QStringList getSelectedSeries();
74 
75  ctkDICOMDatabase* database();
76 
80  void setDisplayImportSummary(bool);
81  bool displayImportSummary();
83  int patientsAddedDuringImport();
84  int studiesAddedDuringImport();
85  int seriesAddedDuringImport();
86  int instancesAddedDuringImport();
87  void addActionToToolbar(QAction* action);
88 
89 public Q_SLOTS:
90  void setDatabaseDirectory(const QString& directory);
91  void onSelectionChanged(const QItemSelection&, const QItemSelection&);
92 
93  void openQueryDialog();
94  void onRemoveAction();
95 
96 // void suspendModel();
97  void resumeModel();
98  void resetModel();
99 
103  void onImportDirectory(QString directory);
104 
105  void onCurrentChanged(const QModelIndex&, const QModelIndex&);
106 
107 Q_SIGNALS:
108  void databaseDirectoryChanged(const QString&);
109  void queryRetrieveFinished();
110  void directoryImported();
111 
112 protected:
113  QScopedPointer<DICOMAppWidgetPrivate> d_ptr;
114 protected Q_SLOTS:
115  void onModelSelected(const QModelIndex& index);
116  void onQueryRetrieveFinished();
117  void onTreeCollapsed(const QModelIndex& index);
118  void onTreeExpanded(const QModelIndex& index);
119  void onThumbnailWidthSliderValueChanged(int val);
120 
121 
122 
123 
124 private Q_SLOTS:
125 
126  void schemaUpdateStarted(int);
127  void schemaUpdateProgress(QString);
128  void schemaUpdateProgress(int);
129  void schemaUpdated();
130 
131 private:
132  Q_DECLARE_PRIVATE(DICOMAppWidget);
133  Q_DISABLE_COPY(DICOMAppWidget);
134 
135 };
136 
137 } // namespace cx
138 
139 
140 #endif
QScopedPointer< DICOMAppWidgetPrivate > d_ptr