Mercurial > hg > orthanc-stone
comparison Framework/Volumes/ImageBuffer3D.h @ 119:ba83e38cf3ff wasm
rendering of rt-dose
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Oct 2017 22:01:41 +0200 |
parents | 2eca030792aa |
children | e2fe9352f240 |
comparison
equal
deleted
inserted
replaced
118:a4d0b6c82b29 | 119:ba83e38cf3ff |
---|---|
20 | 20 |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include "../Enumerations.h" | 24 #include "../Enumerations.h" |
25 #include "../Layers/RenderStyle.h" | |
25 #include "../Toolbox/CoordinateSystem3D.h" | 26 #include "../Toolbox/CoordinateSystem3D.h" |
27 #include "../Toolbox/DicomFrameConverter.h" | |
26 #include "../Toolbox/ParallelSlices.h" | 28 #include "../Toolbox/ParallelSlices.h" |
27 | 29 |
28 #include <Core/Images/Image.h> | 30 #include <Core/Images/Image.h> |
29 | 31 |
30 namespace OrthancStone | 32 namespace OrthancStone |
37 Orthanc::Image image_; | 39 Orthanc::Image image_; |
38 Orthanc::PixelFormat format_; | 40 Orthanc::PixelFormat format_; |
39 unsigned int width_; | 41 unsigned int width_; |
40 unsigned int height_; | 42 unsigned int height_; |
41 unsigned int depth_; | 43 unsigned int depth_; |
44 bool computeRange_; | |
45 bool hasRange_; | |
46 float minValue_; | |
47 float maxValue_; | |
48 | |
49 void ExtendImageRange(const Orthanc::ImageAccessor& slice); | |
42 | 50 |
43 Orthanc::ImageAccessor GetAxialSliceAccessor(unsigned int slice, | 51 Orthanc::ImageAccessor GetAxialSliceAccessor(unsigned int slice, |
44 bool readOnly); | 52 bool readOnly); |
45 | 53 |
46 Orthanc::ImageAccessor GetCoronalSliceAccessor(unsigned int slice, | 54 Orthanc::ImageAccessor GetCoronalSliceAccessor(unsigned int slice, |
50 | 58 |
51 public: | 59 public: |
52 ImageBuffer3D(Orthanc::PixelFormat format, | 60 ImageBuffer3D(Orthanc::PixelFormat format, |
53 unsigned int width, | 61 unsigned int width, |
54 unsigned int height, | 62 unsigned int height, |
55 unsigned int depth); | 63 unsigned int depth, |
64 bool computeRange); | |
56 | 65 |
57 void Clear(); | 66 void Clear(); |
58 | 67 |
59 // Set the geometry of the first axial slice (i.e. the one whose | 68 // Set the geometry of the first axial slice (i.e. the one whose |
60 // depth == 0) | 69 // depth == 0) |
92 | 101 |
93 ParallelSlices* GetGeometry(VolumeProjection projection); | 102 ParallelSlices* GetGeometry(VolumeProjection projection); |
94 | 103 |
95 uint64_t GetEstimatedMemorySize() const; | 104 uint64_t GetEstimatedMemorySize() const; |
96 | 105 |
106 bool GetRange(float& minValue, | |
107 float& maxValue) const; | |
108 | |
109 bool FitWindowingToRange(RenderStyle& style, | |
110 const DicomFrameConverter& converter) const; | |
111 | |
97 | 112 |
98 class SliceReader : public boost::noncopyable | 113 class SliceReader : public boost::noncopyable |
99 { | 114 { |
100 private: | 115 private: |
101 Orthanc::ImageAccessor accessor_; | 116 Orthanc::ImageAccessor accessor_; |
114 | 129 |
115 | 130 |
116 class SliceWriter : public boost::noncopyable | 131 class SliceWriter : public boost::noncopyable |
117 { | 132 { |
118 private: | 133 private: |
134 ImageBuffer3D& that_; | |
119 bool modified_; | 135 bool modified_; |
120 Orthanc::ImageAccessor accessor_; | 136 Orthanc::ImageAccessor accessor_; |
121 std::auto_ptr<Orthanc::Image> sagittal_; // Unused for axial and coronal | 137 std::auto_ptr<Orthanc::Image> sagittal_; // Unused for axial and coronal |
122 | 138 |
123 void Flush(); | 139 void Flush(); |