ctkDICOMQuery.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 __ctkDICOMQuery_h
  15. #define __ctkDICOMQuery_h
  16. // Qt includes
  17. #include <QObject>
  18. #include <QMap>
  19. #include <QString>
  20. #include <QSqlDatabase>
  21. // CTK includes
  22. #include <ctkPimpl.h>
  23. #include "ctkDICOMCoreExport.h"
  24. #include "ctkDICOMDatabase.h"
  25. class ctkDICOMQueryPrivate;
  26. class CTK_DICOM_CORE_EXPORT ctkDICOMQuery : public QObject
  27. {
  28. Q_OBJECT
  29. Q_PROPERTY(QString callingAETitle READ callingAETitle WRITE setCallingAETitle);
  30. Q_PROPERTY(QString calledAETitle READ calledAETitle WRITE setCallingAETitle);
  31. Q_PROPERTY(QString host READ host WRITE setHost);
  32. Q_PROPERTY(int port READ port WRITE setPort);
  33. public:
  34. explicit ctkDICOMQuery(QObject* parent = 0);
  35. virtual ~ctkDICOMQuery();
  36. /// Set methods for connectivity
  37. /// Empty by default
  38. void setCallingAETitle ( const QString& callingAETitle );
  39. QString callingAETitle()const;
  40. /// Empty by default
  41. void setCalledAETitle ( const QString& calledAETitle );
  42. QString calledAETitle()const;
  43. /// Empty by default
  44. void setHost ( const QString& host );
  45. QString host()const;
  46. /// Specify a port for the packet headers.
  47. /// \a port ranges from 0 to 65535.
  48. /// 0 by default.
  49. void setPort ( int port );
  50. int port()const;
  51. /// Query a remote DICOM Image Store SCP
  52. /// You must at least set the host and port before calling query()
  53. bool query(ctkDICOMDatabase& database);
  54. /// Access the list of study instance UIDs from the last query
  55. QStringList studyInstanceUIDQueried()const;
  56. ///
  57. /// Filters are keyword/value pairs as generated by
  58. /// the ctkDICOMWidgets in a human readable (and editable)
  59. /// format. The Query is responsible for converting these
  60. /// into the appropriate dicom syntax for the C-Find
  61. /// Currently supports the keys: Name, Study, Series, ID, Modalities,
  62. /// StartDate and EndDate
  63. /// Key DICOM Tag Type Example
  64. /// -----------------------------------------------------------
  65. /// Name DCM_PatientName QString JOHNDOE
  66. /// Study DCM_StudyDescription QString
  67. /// Series DCM_SeriesDescription QString
  68. /// ID DCM_PatientID QString
  69. /// Modalities DCM_ModalitiesInStudy QStringList CT, MR, MN
  70. /// StartDate DCM_StudyDate QString 20090101
  71. /// EndDate DCM_StudyDate QString 20091231
  72. /// No filter (empty) by default.
  73. void setFilters(const QMap<QString,QVariant>&);
  74. QMap<QString,QVariant> filters()const;
  75. signals:
  76. /// Signal is emitted inside the query() 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 query() function. It sends the different step
  80. /// the function is at.
  81. void progress(const QString& message);
  82. protected:
  83. QScopedPointer<ctkDICOMQueryPrivate> d_ptr;
  84. private:
  85. Q_DECLARE_PRIVATE(ctkDICOMQuery);
  86. Q_DISABLE_COPY(ctkDICOMQuery);
  87. };
  88. #endif