Mercurial > hg > orthanc
annotate OrthancServer/DicomIntegerPixelAccessor.h @ 60:77aec9be0a51 orthanc-renaming
renaming of cppclient
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 16 Sep 2012 09:29:54 +0200 |
parents | 4bc019d2f969 |
children | a70bb32802ae |
rev | line source |
---|---|
0 | 1 /** |
50 | 2 * Palanthir - A Lightweight, RESTful DICOM Store |
0 | 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 | |
50 | 27 namespace Palanthir |
0 | 28 { |
29 class DicomIntegerPixelAccessor | |
30 { | |
31 private: | |
32 unsigned int width_; | |
33 unsigned int height_; | |
34 unsigned int samplesPerPixel_; | |
53
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
35 unsigned int numberOfFrames_; |
0 | 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_; | |
53
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
43 unsigned int frame_; |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
44 |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
45 size_t frameOffset_; |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
46 size_t rowOffset_; |
0 | 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 | |
53
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
63 unsigned int GetNumberOfFrames() const |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
64 { |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
65 return numberOfFrames_; |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
66 } |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
67 |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
68 unsigned int GetCurrentFrame() const |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
69 { |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
70 return frame_; |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
71 } |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
72 |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
73 void SetCurrentFrame(unsigned int frame); |
293038baf8f1
access to multi-frame images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
50
diff
changeset
|
74 |
0 | 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 } |