ctkXnatConnection.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*=============================================================================
  2. Plugin: org.commontk.xnat
  3. Copyright (c) University College London,
  4. Centre for Medical Image Computing
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef ctkXnatConnection_h
  16. #define ctkXnatConnection_h
  17. #include "ctkXNATCoreExport.h"
  18. #include <QScopedPointer>
  19. #include <QString>
  20. #include <QObject>
  21. #include <QVariantMap>
  22. #include <QUuid>
  23. class ctkXnatConnectionPrivate;
  24. class ctkXnatExperiment;
  25. class ctkXnatFile;
  26. class ctkXnatObject;
  27. class ctkXnatProject;
  28. class ctkXnatReconstruction;
  29. class ctkXnatReconstructionFolder;
  30. class ctkXnatReconstructionResource;
  31. class ctkXnatRoot;
  32. class ctkXnatScan;
  33. class ctkXnatScanFolder;
  34. class ctkXnatScanResource;
  35. class ctkXnatServer;
  36. class ctkXnatSubject;
  37. class CTK_XNAT_CORE_EXPORT ctkXnatConnection
  38. {
  39. public:
  40. ctkXnatConnection();
  41. ~ctkXnatConnection();
  42. void createConnections();
  43. QString profileName() const;
  44. void setProfileName(const QString& profileName);
  45. QString url() const;
  46. void setUrl(const QString& url);
  47. QString userName() const;
  48. void setUserName(const QString& userName);
  49. QString password() const;
  50. void setPassword(const QString& password);
  51. ctkXnatServer* server() const;
  52. void fetch(ctkXnatServer* server);
  53. void fetch(ctkXnatProject* project);
  54. void fetch(ctkXnatSubject* subject);
  55. void fetch(ctkXnatExperiment* experiment);
  56. void fetch(ctkXnatScanFolder* scanFolder);
  57. void fetch(ctkXnatScan* scan);
  58. void fetch(ctkXnatScanResource* scanResource);
  59. void fetch(ctkXnatReconstructionFolder* reconstructionFolder);
  60. void fetch(ctkXnatReconstruction* reconstruction);
  61. void fetch(ctkXnatReconstructionResource* reconstructionResource);
  62. bool exists(ctkXnatObject* object);
  63. void create(ctkXnatObject* object);
  64. void remove(ctkXnatObject* object);
  65. void download(ctkXnatFile* file, const QString& fileName);
  66. // void downloadScanFiles(ctkXnatExperiment* experiment, const QString& zipFileName);
  67. // void downloadReconstructionFiles(ctkXnatExperiment* experiment, const QString& zipFileName);
  68. // void download(ctkXnatScan* scan, const QString& zipFileName);
  69. void download(ctkXnatScanResource* scanResource, const QString& zipFileName);
  70. void download(ctkXnatReconstructionResource* reconstructionResource, const QString& zipFileName);
  71. // void downloadReconstruction(ctkXnatReconstruction* reconstruction, const QString& zipFilename);
  72. // void downloadReconstructionResourceFiles(ctkXnatReconstructionResource* reconstructionResource, const QString& zipFilename);
  73. // void download(ctkXnatReconstructionResourceFile* reconstructionResourceFile, const QString& zipFileName);
  74. public slots:
  75. void processResult(QUuid queryId, QList<QVariantMap> parameters);
  76. void progress(QUuid queryId, double progress);
  77. protected:
  78. QScopedPointer<ctkXnatConnectionPrivate> d_ptr;
  79. private:
  80. Q_DECLARE_PRIVATE(ctkXnatConnection)
  81. Q_DISABLE_COPY(ctkXnatConnection)
  82. };
  83. #endif