ctkDICOMRetrieve.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 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. signals:
  76. //TODO: the signature of these signals will change
  77. //from string to a more specific format when we decide
  78. //what information to send
  79. /// emitted when a move response has been received from dcmtk
  80. void moveResponseHandled( const QString message );
  81. /// emitted when a dataset is incoming from a CGET
  82. void storeRequested( const QString message );
  83. /// emitted when remote server sends us CGET responses
  84. void retrieveStatusChanged( const QString message );
  85. protected:
  86. QScopedPointer<ctkDICOMRetrievePrivate> d_ptr;
  87. private:
  88. Q_DECLARE_PRIVATE(ctkDICOMRetrieve);
  89. Q_DISABLE_COPY(ctkDICOMRetrieve);
  90. friend class ctkDICOMRetrieveSCUPrivate; // for access to status signals
  91. };
  92. #endif