comparison Framework/Inputs/DicomPyramidLevel.h @ 0:4a7a53257c7d

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 22 Oct 2016 21:48:33 +0200
parents
children b6432a00b103
comparison
equal deleted inserted replaced
-1:000000000000 0:4a7a53257c7d
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 *
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public License
8 * as published by the Free Software Foundation, either version 3 of
9 * the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 **/
19
20
21 #pragma once
22
23 #include "DicomPyramidInstance.h"
24
25 #include <list>
26
27 namespace OrthancWSI
28 {
29 class DicomPyramidLevel : public boost::noncopyable
30 {
31 private:
32 typedef std::pair<unsigned int, unsigned int> TileLocation;
33 typedef std::pair<const DicomPyramidInstance*, unsigned int> TileContent;
34 typedef std::map<TileLocation, TileContent> Tiles;
35 typedef std::list<const DicomPyramidInstance*> Instances;
36
37 unsigned int totalWidth_;
38 unsigned int totalHeight_;
39 unsigned int tileWidth_;
40 unsigned int tileHeight_;
41 Instances instances_;
42 Tiles tiles_;
43
44 void RegisterFrame(const DicomPyramidInstance& instance,
45 unsigned int frame);
46
47 bool LookupTile(TileContent& tile,
48 unsigned int tileX,
49 unsigned int tileY) const;
50
51 public:
52 DicomPyramidLevel(const DicomPyramidInstance& instance);
53
54 void AddInstance(const DicomPyramidInstance& instance);
55
56 unsigned int GetTotalWidth() const
57 {
58 return totalWidth_;
59 }
60
61 unsigned int GetTotalHeight() const
62 {
63 return totalHeight_;
64 }
65
66 unsigned int GetTileWidth() const
67 {
68 return tileWidth_;
69 }
70
71 unsigned int GetTileHeight() const
72 {
73 return tileHeight_;
74 }
75
76 bool DownloadRawTile(ImageCompression& compression /* out */,
77 Orthanc::PixelFormat& format /* out */,
78 std::string& raw /* out */,
79 IOrthancConnection& orthanc,
80 unsigned int tileX,
81 unsigned int tileY) const;
82 };
83 }