NorMIT-nav  18.04
An IGT application
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  QList<QAction*> getAdvancedActions() const;
90 
91 public Q_SLOTS:
92  void setDatabaseDirectory(const QString& directory);
93  void onSelectionChanged(const QItemSelection&, const QItemSelection&);
94 
95  void openQueryDialog();
96  void onRemoveAction();
97 
98 // void suspendModel();
99  void resumeModel();
100  void resetModel();
101 
105  void onImportDirectory(QString directory);
106 
107  void onCurrentChanged(const QModelIndex&, const QModelIndex&);
108 
109 Q_SIGNALS:
110  void databaseDirectoryChanged(const QString&);
111  void queryRetrieveFinished();
112  void directoryImported();
113 
114 protected:
115  QScopedPointer<DICOMAppWidgetPrivate> d_ptr;
116 protected Q_SLOTS:
117  void onModelSelected(const QModelIndex& index);
118  void onQueryRetrieveFinished();
119  void onTreeCollapsed(const QModelIndex& index);
120  void onTreeExpanded(const QModelIndex& index);
121  void onThumbnailWidthSliderValueChanged(int val);
122 
123 
124 
125 
126 private Q_SLOTS:
127 
128  void schemaUpdateStarted(int);
129  void schemaUpdateProgress(QString);
130  void schemaUpdateProgress(int);
131  void schemaUpdated();
132 
133 private:
134  Q_DECLARE_PRIVATE(DICOMAppWidget);
135  Q_DISABLE_COPY(DICOMAppWidget);
136 
137 };
138 
139 } // namespace cx
140 
141 
142 #endif
QScopedPointer< DICOMAppWidgetPrivate > d_ptr
Namespace for all CustusX production code.