comparison Core/DicomFormat/DicomIntegerPixelAccessor.h @ 78:10bf2cd24d1d

move
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Sep 2012 13:41:55 +0200
parents OrthancServer/DicomIntegerPixelAccessor.h@a70bb32802ae
children 297bad4e1019
comparison
equal deleted inserted replaced
77:b8dfde8d64e8 78:10bf2cd24d1d
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege,
4 * Belgium
5 *
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * 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 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU 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 "../Core/DicomFormat/DicomMap.h"
24
25 #include <stdint.h>
26
27 namespace Orthanc
28 {
29 class DicomIntegerPixelAccessor
30 {
31 private:
32 unsigned int width_;
33 unsigned int height_;
34 unsigned int samplesPerPixel_;
35 unsigned int numberOfFrames_;
36 const void* pixelData_;
37 size_t size_;
38
39 uint8_t shift_;
40 uint32_t signMask_;
41 uint32_t mask_;
42 size_t bytesPerPixel_;
43 unsigned int frame_;
44
45 size_t frameOffset_;
46 size_t rowOffset_;
47
48 public:
49 DicomIntegerPixelAccessor(const DicomMap& values,
50 const void* pixelData,
51 size_t size);
52
53 unsigned int GetWidth() const
54 {
55 return width_;
56 }
57
58 unsigned int GetHeight() const
59 {
60 return height_;
61 }
62
63 unsigned int GetNumberOfFrames() const
64 {
65 return numberOfFrames_;
66 }
67
68 unsigned int GetCurrentFrame() const
69 {
70 return frame_;
71 }
72
73 void SetCurrentFrame(unsigned int frame);
74
75 void GetExtremeValues(int32_t& min,
76 int32_t& max) const;
77
78 int32_t GetValue(unsigned int x, unsigned int y) const;
79 };
80 }