CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkDICOMRetrieve.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 __ctkDICOMRetrieve_h
22 #define __ctkDICOMRetrieve_h
23 
24 
25 // Qt includes
26 #include <QObject>
27 #include <QDir>
28 #include <QSharedPointer>
29 
30 #include "ctkDICOMCoreExport.h"
31 
32 // CTK Core includes
33 #include "ctkDICOMDatabase.h"
34 
35 class ctkDICOMRetrievePrivate;
36 
38 class CTK_DICOM_CORE_EXPORT ctkDICOMRetrieve : public QObject
39 {
40  Q_OBJECT
41  Q_PROPERTY(QString callingAETitle READ callingAETitle WRITE setCallingAETitle);
42  Q_PROPERTY(QString calledAETitle READ calledAETitle WRITE setCallingAETitle);
43  Q_PROPERTY(QString host READ host WRITE setHost);
44  Q_PROPERTY(int port READ port WRITE setPort);
45  Q_PROPERTY(QString moveDestinationAETitle READ moveDestinationAETitle WRITE setMoveDestinationAETitle);
46  Q_PROPERTY(bool keepAssociationOpen READ keepAssociationOpen WRITE setKeepAssociationOpen);
47  Q_PROPERTY(bool wasCanceled READ wasCanceled WRITE setWasCanceled);
48 
49 public:
50  explicit ctkDICOMRetrieve(QObject* parent = 0);
51  virtual ~ctkDICOMRetrieve();
52 
56  Q_INVOKABLE void setCallingAETitle( const QString& callingAETitle );
57  Q_INVOKABLE QString callingAETitle() const;
60  Q_INVOKABLE void setCalledAETitle( const QString& calledAETitle );
61  Q_INVOKABLE QString calledAETitle() const;
63  Q_INVOKABLE void setHost( const QString& host );
64  Q_INVOKABLE QString host() const;
66  Q_INVOKABLE void setPort( int port );
67  Q_INVOKABLE int port() const;
71  Q_INVOKABLE void setMoveDestinationAETitle( const QString& moveDestinationAETitle );
72  Q_INVOKABLE QString moveDestinationAETitle() const;
75  Q_INVOKABLE void setKeepAssociationOpen(const bool keepOpen);
76  Q_INVOKABLE bool keepAssociationOpen();
79  Q_INVOKABLE void setWasCanceled(const bool wasCanceled);
80  Q_INVOKABLE bool wasCanceled();
83  Q_INVOKABLE void setDatabase(ctkDICOMDatabase& dicomDatabase);
84  void setDatabase(QSharedPointer<ctkDICOMDatabase> dicomDatabase);
85  Q_INVOKABLE QSharedPointer<ctkDICOMDatabase> database()const;
86 
87 public Q_SLOTS:
89  Q_INVOKABLE bool moveSeries( const QString& studyInstanceUID,
90  const QString& seriesInstanceUID );
92  Q_INVOKABLE bool moveStudy( const QString& studyInstanceUID );
94  Q_INVOKABLE bool getSeries( const QString& studyInstanceUID,
95  const QString& seriesInstanceUID );
97  Q_INVOKABLE bool getStudy( const QString& studyInstanceUID );
99  Q_INVOKABLE void cancel();
100 
101 Q_SIGNALS:
104  void progress(int progress);
107  void progress(const QString& message);
110  void debug(const QString& message);
112  void error(const QString& message);
115  void done(const bool& error);
116 
117 protected:
118  QScopedPointer<ctkDICOMRetrievePrivate> d_ptr;
119 
120 private:
121  Q_DECLARE_PRIVATE(ctkDICOMRetrieve);
122  Q_DISABLE_COPY(ctkDICOMRetrieve);
123 
124  friend class ctkDICOMRetrieveSCUPrivate; // for access to status signals
125 };
126 
127 
128 #endif
ctkDICOMRetrieve::host
Q_INVOKABLE QString host() const
ctkDICOMRetrieve::setDatabase
void setDatabase(QSharedPointer< ctkDICOMDatabase > dicomDatabase)
ctkDICOMRetrieve::setHost
Q_INVOKABLE void setHost(const QString &host)
peer hostname being connected to
ctkDICOMRetrieve::cancel
Q_INVOKABLE void cancel()
Cancel the current operation.
ctkDICOMDatabase
Definition: ctkDICOMDatabase.h:53
ctkDICOMRetrieve::~ctkDICOMRetrieve
virtual ~ctkDICOMRetrieve()
ctkDICOMRetrieve::callingAETitle
Q_INVOKABLE QString callingAETitle() const
ctkDICOMRetrieve::wasCanceled
Q_INVOKABLE bool wasCanceled()
ctkDICOMRetrieve::port
Q_INVOKABLE int port() const
ctkDICOMRetrieve::done
void done(const bool &error)
ctkDICOMRetrieve::calledAETitle
Q_INVOKABLE QString calledAETitle() const
ctkDICOMRetrieve::moveDestinationAETitle
Q_INVOKABLE QString moveDestinationAETitle() const
ctkDICOMRetrieve::setPort
Q_INVOKABLE void setPort(int port)
[0, 65365] port on peer host - e.g. 11112
ctkDICOMRetrieve
Definition: ctkDICOMRetrieve.h:39
ctkDICOMRetrieve::setCalledAETitle
Q_INVOKABLE void setCalledAETitle(const QString &calledAETitle)
ctkDICOMRetrieve::progress
void progress(const QString &message)
ctkDICOMRetrieve::debug
void debug(const QString &message)
ctkDICOMDatabase.h
ctkDICOMRetrieve::ctkDICOMRetrieve
ctkDICOMRetrieve(QObject *parent=0)
ctkDICOMRetrieve::getStudy
Q_INVOKABLE bool getStudy(const QString &studyInstanceUID)
Use CGET to ask peer host to store data to us.
ctkDICOMRetrieve::setWasCanceled
Q_INVOKABLE void setWasCanceled(const bool wasCanceled)
ctkDICOMRetrieve::error
void error(const QString &message)
Signal is emitted inside the retrieve() function. It send any error messages.
ctkDICOMRetrieve::setCallingAETitle
Q_INVOKABLE void setCallingAETitle(const QString &callingAETitle)
ctkDICOMRetrieve::keepAssociationOpen
Q_INVOKABLE bool keepAssociationOpen()
ctkDICOMRetrieve::moveStudy
Q_INVOKABLE bool moveStudy(const QString &studyInstanceUID)
Use CMOVE to ask peer host to store data to move destination.
ctkDICOMRetrieve::setDatabase
Q_INVOKABLE void setDatabase(ctkDICOMDatabase &dicomDatabase)
ctkDICOMRetrieve::d_ptr
QScopedPointer< ctkDICOMRetrievePrivate > d_ptr
Definition: ctkDICOMRetrieve.h:118
ctkDICOMRetrieve::setMoveDestinationAETitle
Q_INVOKABLE void setMoveDestinationAETitle(const QString &moveDestinationAETitle)
ctkDICOMRetrieve::moveSeries
Q_INVOKABLE bool moveSeries(const QString &studyInstanceUID, const QString &seriesInstanceUID)
Use CMOVE to ask peer host to store data to move destination.
ctkDICOMRetrieve::getSeries
Q_INVOKABLE bool getSeries(const QString &studyInstanceUID, const QString &seriesInstanceUID)
Use CGET to ask peer host to store data to us.
ctkDICOMRetrieve::setKeepAssociationOpen
Q_INVOKABLE void setKeepAssociationOpen(const bool keepOpen)
ctkDICOMRetrieve::database
Q_INVOKABLE QSharedPointer< ctkDICOMDatabase > database() const
ctkDICOMRetrieve::progress
void progress(int progress)