comparison Framework/Inputs/CytomineImage.h @ 243:7d189530d648

added class CytomineImage
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Dec 2021 16:15:10 +0100
parents
children 4273518c2009
comparison
equal deleted inserted replaced
242:49f647ed1b4c 243:7d189530d648
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
6 * Copyright (C) 2021-2021 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Affero General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 **/
21
22
23 #pragma once
24
25 #include "DecodedTiledPyramid.h"
26
27 #include <HttpClient.h>
28
29 namespace OrthancWSI
30 {
31 class CytomineImage : public DecodedTiledPyramid
32 {
33 private:
34 Orthanc::WebServiceParameters parameters_;
35 std::string publicKey_;
36 std::string privateKey_;
37 int imageId_;
38 unsigned int fullWidth_;
39 unsigned int fullHeight_;
40 unsigned int tileWidth_;
41 unsigned int tileHeight_;
42
43 bool GetCytomine(std::string& target,
44 const std::string& uri,
45 Orthanc::MimeType contentType) const;
46
47 protected:
48 virtual void ReadRegion(Orthanc::ImageAccessor& target,
49 unsigned int level,
50 unsigned int x,
51 unsigned int y) ORTHANC_OVERRIDE;
52
53 public:
54 CytomineImage(const Orthanc::WebServiceParameters& parameters,
55 const std::string& publicKey,
56 const std::string& privateKey,
57 int imageId,
58 unsigned int tileWidth,
59 unsigned int tileHeight);
60
61 virtual unsigned int GetTileWidth(unsigned int level) const ORTHANC_OVERRIDE
62 {
63 return tileWidth_;
64 }
65
66 virtual unsigned int GetTileHeight(unsigned int level) const ORTHANC_OVERRIDE
67 {
68 return tileHeight_;
69 }
70
71 virtual unsigned int GetLevelCount() const ORTHANC_OVERRIDE
72 {
73 return 1;
74 }
75
76 virtual unsigned int GetLevelWidth(unsigned int level) const ORTHANC_OVERRIDE;
77
78 virtual unsigned int GetLevelHeight(unsigned int level) const ORTHANC_OVERRIDE;
79
80 virtual Orthanc::PixelFormat GetPixelFormat() const ORTHANC_OVERRIDE
81 {
82 return Orthanc::PixelFormat_RGB24;
83 }
84
85 virtual Orthanc::PhotometricInterpretation GetPhotometricInterpretation() const ORTHANC_OVERRIDE
86 {
87 return Orthanc::PhotometricInterpretation_RGB;
88 }
89 };
90 }