ctkDICOMRetrieve.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkDICOMRetrieve_h
  15. #define __ctkDICOMRetrieve_h
  16. // Qt includes
  17. #include <QObject>
  18. #include <QDir>
  19. #include <QSharedPointer>
  20. #include "ctkDICOMCoreExport.h"
  21. // CTK Core includes
  22. #include "ctkDICOMDatabase.h"
  23. class ctkDICOMRetrievePrivate;
  24. class CTK_DICOM_CORE_EXPORT ctkDICOMRetrieve : public QObject
  25. {
  26. Q_OBJECT
  27. Q_PROPERTY(QString callingAETitle READ callingAETitle WRITE setCallingAETitle);
  28. Q_PROPERTY(QString calledAETitle READ calledAETitle WRITE setCallingAETitle);
  29. Q_PROPERTY(QString host READ host WRITE setHost);
  30. Q_PROPERTY(int port READ port WRITE setPort);
  31. Q_PROPERTY(QString moveDestinationAETitle READ moveDestinationAETitle WRITE setMoveDestinationAETitle)
  32. Q_PROPERTY(bool keepAssociationOpen READ keepAssociationOpen WRITE setKeepAssociationOpen)
  33. public:
  34. explicit ctkDICOMRetrieve();
  35. virtual ~ctkDICOMRetrieve();
  36. /// Set methods for connectivity
  37. /// CTK_AE - the AE string by which the peer host might
  38. /// recognize your request
  39. void setCallingAETitle( const QString& callingAETitle );
  40. QString callingAETitle() const;
  41. /// CTK_AE - the AE of the serice of peer host that you are calling
  42. /// which tells the host what you are requesting
  43. void setCalledAETitle( const QString& calledAETitle );
  44. QString calledAETitle() const;
  45. /// peer hostname being connected to
  46. void setHost( const QString& host );
  47. QString host() const;
  48. /// [0, 65365] port on peer host - e.g. 11112
  49. void setPort( int port );
  50. int port() const;
  51. /// Typically CTK_STORE or similar - needs to be something that the
  52. /// peer host knows about and is able to move data into
  53. /// Only used when calling moveSeries or moveStudy
  54. void setMoveDestinationAETitle( const QString& moveDestinationAETitle );
  55. QString moveDestinationAETitle() const;
  56. /// prefer to keep using the existing association to peer host when doing
  57. /// multiple requests (default true)
  58. void setKeepAssociationOpen(const bool keepOpen);
  59. bool keepAssociationOpen();
  60. /// where to insert new data sets obtained via get (must be set for
  61. /// get to succeed
  62. Q_INVOKABLE void setDatabase(QSharedPointer<ctkDICOMDatabase> dicomDatabase);
  63. Q_INVOKABLE QSharedPointer<ctkDICOMDatabase> database()const;
  64. public Q_SLOTS:
  65. /// Use CMOVE to ask peer host to store data to move destination
  66. bool moveSeries( const QString& studyInstanceUID,
  67. const QString& seriesInstanceUID );
  68. /// Use CMOVE to ask peer host to store data to move destination
  69. bool moveStudy( const QString& studyInstanceUID );
  70. /// Use CGET to ask peer host to store data to us
  71. bool getSeries( const QString& studyInstanceUID,
  72. const QString& seriesInstanceUID );
  73. /// Use CGET to ask peer host to store data to us
  74. bool getStudy( const QString& studyInstanceUID );
  75. Q_SIGNALS:
  76. /// Signal is emitted inside the retrieve() function. It ranges from 0 to 100.
  77. /// In case of an error, you are assured that the progress value 100 is fired
  78. void progress(int progress);
  79. /// Signal is emitted inside the retrieve() function. It sends the different step
  80. /// the function is at.
  81. void progress(const QString& message);
  82. /// Signal is emitted inside the retrieve() function. It sends
  83. /// detailed feedback for debugging
  84. void debug(const QString& message);
  85. /// Signal is emitted inside the retrieve() function. It send any error messages
  86. void error(const QString& message);
  87. /// Signal is emitted inside the retrieve() function when finished with value
  88. /// true for success or false for error
  89. void done(const bool& error);
  90. protected:
  91. QScopedPointer<ctkDICOMRetrievePrivate> d_ptr;
  92. private:
  93. Q_DECLARE_PRIVATE(ctkDICOMRetrieve);
  94. Q_DISABLE_COPY(ctkDICOMRetrieve);
  95. friend class ctkDICOMRetrieveSCUPrivate; // for access to status signals
  96. };
  97. #endif