ctkDICOMRetrieve.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) 2010 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.commontk.org/LICENSE
  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. // Qt includes
  15. #include <QSqlQuery>
  16. #include <QSqlRecord>
  17. #include <QVariant>
  18. #include <QDate>
  19. #include <QStringList>
  20. #include <QSet>
  21. #include <QFile>
  22. #include <QDirIterator>
  23. #include <QFileInfo>
  24. #include <QDebug>
  25. // ctkDICOM includes
  26. #include "ctkDICOMRetrieve.h"
  27. #include "ctkLogger.h"
  28. // DCMTK includes
  29. #ifndef WIN32
  30. #define HAVE_CONFIG_H
  31. #endif
  32. #include "dcmtk/dcmnet/dimse.h"
  33. #include "dcmtk/dcmnet/diutil.h"
  34. #include <dcmtk/dcmdata/dcfilefo.h>
  35. #include <dcmtk/dcmdata/dcfilefo.h>
  36. #include <dcmtk/dcmdata/dcdeftag.h>
  37. #include <dcmtk/dcmdata/dcdatset.h>
  38. #include <dcmtk/ofstd/ofcond.h>
  39. #include <dcmtk/ofstd/ofstring.h>
  40. #include <dcmtk/ofstd/ofstd.h> /* for class OFStandard */
  41. #include <dcmtk/dcmdata/dcddirif.h> /* for class DicomDirInterface */
  42. #include <dcmtk/dcmnet/scu.h>
  43. static ctkLogger logger ( "org.commontk.dicom.DICOMRetrieve" );
  44. //------------------------------------------------------------------------------
  45. class ctkDICOMRetrievePrivate: public ctkPrivate<ctkDICOMRetrieve>
  46. {
  47. public:
  48. ctkDICOMRetrievePrivate();
  49. ~ctkDICOMRetrievePrivate();
  50. QString CallingAETitle;
  51. QString CalledAETitle;
  52. QString Host;
  53. int CallingPort;
  54. int CalledPort;
  55. DcmSCU SCU;
  56. DcmDataset* query;
  57. };
  58. //------------------------------------------------------------------------------
  59. // ctkDICOMRetrievePrivate methods
  60. //------------------------------------------------------------------------------
  61. ctkDICOMRetrievePrivate::ctkDICOMRetrievePrivate()
  62. {
  63. query = new DcmDataset();
  64. }
  65. //------------------------------------------------------------------------------
  66. ctkDICOMRetrievePrivate::~ctkDICOMRetrievePrivate()
  67. {
  68. delete query;
  69. }
  70. //------------------------------------------------------------------------------
  71. // ctkDICOMRetrieve methods
  72. //------------------------------------------------------------------------------
  73. ctkDICOMRetrieve::ctkDICOMRetrieve()
  74. {
  75. }
  76. //------------------------------------------------------------------------------
  77. ctkDICOMRetrieve::~ctkDICOMRetrieve()
  78. {
  79. }
  80. /// Set methods for connectivity
  81. void ctkDICOMRetrieve::setCallingAETitle ( QString callingAETitle )
  82. {
  83. CTK_D(ctkDICOMRetrieve);
  84. d->CallingAETitle = callingAETitle;
  85. }
  86. const QString& ctkDICOMRetrieve::callingAETitle()
  87. {
  88. CTK_D(ctkDICOMRetrieve);
  89. return d->CallingAETitle;
  90. }
  91. void ctkDICOMRetrieve::setCalledAETitle ( QString calledAETitle )
  92. {
  93. CTK_D(ctkDICOMRetrieve);
  94. d->CalledAETitle = calledAETitle;
  95. }
  96. const QString& ctkDICOMRetrieve::calledAETitle()
  97. {
  98. CTK_D(ctkDICOMRetrieve);
  99. return d->CalledAETitle;
  100. }
  101. void ctkDICOMRetrieve::setHost ( QString host )
  102. {
  103. CTK_D(ctkDICOMRetrieve);
  104. d->Host = host;
  105. }
  106. const QString& ctkDICOMRetrieve::host()
  107. {
  108. CTK_D(ctkDICOMRetrieve);
  109. return d->Host;
  110. }
  111. void ctkDICOMRetrieve::setCallingPort ( int port )
  112. {
  113. CTK_D(ctkDICOMRetrieve);
  114. d->CallingPort = port;
  115. }
  116. int ctkDICOMRetrieve::callingPort()
  117. {
  118. CTK_D(ctkDICOMRetrieve);
  119. return d->CallingPort;
  120. }
  121. void ctkDICOMRetrieve::setCalledPort ( int port )
  122. {
  123. CTK_D(ctkDICOMRetrieve);
  124. d->CalledPort = port;
  125. }
  126. int ctkDICOMRetrieve::calledPort()
  127. {
  128. CTK_D(ctkDICOMRetrieve);
  129. return d->CalledPort;
  130. }
  131. //------------------------------------------------------------------------------
  132. void ctkDICOMRetrieve::retrieveSeries ( QString seriesInstanceUID, QDir directory ) {
  133. }