Mercurial > hg > orthanc-wsi
annotate Framework/Inputs/CytomineImage.h @ 328:a57a107b9547
add warning about Leica images
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 18 Oct 2024 08:43:15 +0200 |
parents | 8ad12abde290 |
children |
rev | line source |
---|---|
243
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
312
0683312e21ba
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
309
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
0683312e21ba
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
309
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
309
7020852a8fa9
updated year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
254
diff
changeset
|
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
243
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * This program is free software: you can redistribute it and/or |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * modify it under the terms of the GNU Affero General Public License |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * as published by the Free Software Foundation, either version 3 of |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * the License, or (at your option) any later version. |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * This program is distributed in the hope that it will be useful, but |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * WITHOUT ANY WARRANTY; without even the implied warranty of |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * Affero General Public License for more details. |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * You should have received a copy of the GNU Affero General Public License |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 **/ |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #pragma once |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include "DecodedTiledPyramid.h" |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 #include <HttpClient.h> |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 namespace OrthancWSI |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 { |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 class CytomineImage : public DecodedTiledPyramid |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 { |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 private: |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 Orthanc::WebServiceParameters parameters_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 std::string publicKey_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 std::string privateKey_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 int imageId_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 unsigned int fullWidth_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 unsigned int fullHeight_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 unsigned int tileWidth_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 unsigned int tileHeight_; |
244
4273518c2009
OrthancWSIDicomizer: Support importing of images from Cytomine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
243
diff
changeset
|
43 ImageCompression compression_; |
243
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 bool GetCytomine(std::string& target, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 const std::string& uri, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 Orthanc::MimeType contentType) const; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 protected: |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 virtual void ReadRegion(Orthanc::ImageAccessor& target, |
318
8ad12abde290
sparse re-encoding with OpenSlide (notably for MIRAX format)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
312
diff
changeset
|
51 bool& isEmpty, |
243
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 unsigned int level, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 unsigned int x, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 unsigned int y) ORTHANC_OVERRIDE; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 public: |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 CytomineImage(const Orthanc::WebServiceParameters& parameters, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 const std::string& publicKey, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 const std::string& privateKey, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 int imageId, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 unsigned int tileWidth, |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 unsigned int tileHeight); |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 virtual unsigned int GetTileWidth(unsigned int level) const ORTHANC_OVERRIDE |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 { |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 return tileWidth_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 } |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 virtual unsigned int GetTileHeight(unsigned int level) const ORTHANC_OVERRIDE |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 { |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 return tileHeight_; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 } |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 virtual unsigned int GetLevelCount() const ORTHANC_OVERRIDE |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 { |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 return 1; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 } |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 virtual unsigned int GetLevelWidth(unsigned int level) const ORTHANC_OVERRIDE; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 virtual unsigned int GetLevelHeight(unsigned int level) const ORTHANC_OVERRIDE; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 virtual Orthanc::PixelFormat GetPixelFormat() const ORTHANC_OVERRIDE |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 { |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 return Orthanc::PixelFormat_RGB24; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 } |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 virtual Orthanc::PhotometricInterpretation GetPhotometricInterpretation() const ORTHANC_OVERRIDE |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 { |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 return Orthanc::PhotometricInterpretation_RGB; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 } |
244
4273518c2009
OrthancWSIDicomizer: Support importing of images from Cytomine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
243
diff
changeset
|
92 |
4273518c2009
OrthancWSIDicomizer: Support importing of images from Cytomine
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
243
diff
changeset
|
93 void SetImageCompression(ImageCompression compression); |
243
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 }; |
7d189530d648
added class CytomineImage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 } |