CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkDICOMQuery.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 __ctkDICOMQuery_h
22 #define __ctkDICOMQuery_h
23 
24 // Qt includes
25 #include <QObject>
26 #include <QMap>
27 #include <QString>
28 #include <QSqlDatabase>
29 
30 // CTK includes
31 #include <ctkPimpl.h>
32 
33 #include "ctkDICOMCoreExport.h"
34 #include "ctkDICOMDatabase.h"
35 
36 class ctkDICOMQueryPrivate;
37 
39 class CTK_DICOM_CORE_EXPORT ctkDICOMQuery : public QObject
40 {
41  Q_OBJECT
42  Q_PROPERTY(QString callingAETitle READ callingAETitle WRITE setCallingAETitle);
43  Q_PROPERTY(QString calledAETitle READ calledAETitle WRITE setCallingAETitle);
44  Q_PROPERTY(QString host READ host WRITE setHost);
45  Q_PROPERTY(int port READ port WRITE setPort);
46  Q_PROPERTY(bool preferCGET READ preferCGET WRITE setPreferCGET);
47 
48 public:
49  explicit ctkDICOMQuery(QObject* parent = 0);
50  virtual ~ctkDICOMQuery();
51 
54  void setCallingAETitle ( const QString& callingAETitle );
55  QString callingAETitle()const;
57  void setCalledAETitle ( const QString& calledAETitle );
58  QString calledAETitle()const;
60  void setHost ( const QString& host );
61  QString host()const;
65  void setPort ( int port );
66  int port()const;
69  void setPreferCGET ( bool preferCGET );
70  bool preferCGET()const;
71 
74  bool query(ctkDICOMDatabase& database);
75 
77  QStringList studyInstanceUIDQueried()const;
78 
96  void setFilters(const QMap<QString,QVariant>&);
97  QMap<QString,QVariant> filters()const;
98 
99 Q_SIGNALS:
102  void progress(int progress);
105  void progress(const QString& message);
108  void debug(const QString& message);
110  void error(const QString& message);
113  void done(const bool& error);
114 
115 public Q_SLOTS:
116  void cancel();
117 
118 protected:
119  QScopedPointer<ctkDICOMQueryPrivate> d_ptr;
120 
121 private:
122  Q_DECLARE_PRIVATE(ctkDICOMQuery);
123  Q_DISABLE_COPY(ctkDICOMQuery);
124 
125  friend class ctkDICOMQuerySCUPrivate; // for access to queryResponseHandled
126 };
127 
128 #endif
void setPreferCGET(bool preferCGET)
bool preferCGET() const
void progress(int progress)
QString callingAETitle() const
void setFilters(const QMap< QString, QVariant > &)
QString host() const
QString calledAETitle() const
void setHost(const QString &host)
Empty by default.
void setPort(int port)
void error(const QString &message)
Signal is emitted inside the query() function. It send any error messages.
QStringList studyInstanceUIDQueried() const
Access the list of study instance UIDs from the last query.
void setCallingAETitle(const QString &callingAETitle)
virtual ~ctkDICOMQuery()
void debug(const QString &message)
QMap< QString, QVariant > filters() const
void setCalledAETitle(const QString &calledAETitle)
Empty by default.
void done(const bool &error)
void progress(const QString &message)
int port() const
bool query(ctkDICOMDatabase &database)
QScopedPointer< ctkDICOMQueryPrivate > d_ptr
ctkDICOMQuery(QObject *parent=0)