CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkDICOMIndexer.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 __ctkDICOMIndexer_h
22 #define __ctkDICOMIndexer_h
23 
24 // Qt includes
25 #include <QObject>
26 #include <QSqlDatabase>
27 
28 #include "ctkDICOMCoreExport.h"
29 #include "ctkDICOMDatabase.h"
30 
31 class ctkDICOMIndexerPrivate;
32 
37 class CTK_DICOM_CORE_EXPORT ctkDICOMIndexer : public QObject
38 {
39  Q_OBJECT
40 public:
41  explicit ctkDICOMIndexer(QObject *parent = 0);
42  virtual ~ctkDICOMIndexer();
43 
51  Q_INVOKABLE void addDirectory(ctkDICOMDatabase& database, const QString& directoryName,
52  const QString& destinationDirectoryName = "");
53 
61  Q_INVOKABLE bool addDicomdir(ctkDICOMDatabase& database, const QString& directoryName,
62  const QString& destinationDirectoryName = "");
63 
71  Q_INVOKABLE void addListOfFiles(ctkDICOMDatabase& database, const QStringList& listOfFiles,
72  const QString& destinationDirectoryName = "");
73 
81  Q_INVOKABLE void addFile(ctkDICOMDatabase& database, const QString filePath,
82  const QString& destinationDirectoryName = "");
83 
84  Q_INVOKABLE void refreshDatabase(ctkDICOMDatabase& database, const QString& directoryName);
85 
92  Q_INVOKABLE void waitForImportFinished();
93 
94 Q_SIGNALS:
95  void foundFilesToIndex(int);
96  void indexingFileNumber(int);
97  void indexingFilePath(QString);
98  void progress(int);
99  void indexingComplete();
100 
101 public Q_SLOTS:
102  void cancel();
103 
104 protected:
105  QScopedPointer<ctkDICOMIndexerPrivate> d_ptr;
106 
107 private:
108  Q_DECLARE_PRIVATE(ctkDICOMIndexer);
109  Q_DISABLE_COPY(ctkDICOMIndexer);
110 
111 };
112 
113 #endif
Indexes DICOM images located in local directory into an Sql database.
QScopedPointer< ctkDICOMIndexerPrivate > d_ptr