Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyAlphaLayer.h @ 1196:a5f2a6b04a31
RadiographyScene: windowing is now only applied to the Dicom layer
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 27 Nov 2019 17:51:33 +0100 |
parents | 77e0eb83ff63 |
children | 54cbffabdc45 1c7ae79c426d |
comparison
equal
deleted
inserted
replaced
1191:c6a36ecd641d | 1196:a5f2a6b04a31 |
---|---|
31 // The color of the "mask" is either defined by a ForegroundValue or by the center value of the | 31 // The color of the "mask" is either defined by a ForegroundValue or by the center value of the |
32 // windowing from the scene. | 32 // windowing from the scene. |
33 class RadiographyAlphaLayer : public RadiographyLayer | 33 class RadiographyAlphaLayer : public RadiographyLayer |
34 { | 34 { |
35 private: | 35 private: |
36 std::auto_ptr<Orthanc::ImageAccessor> alpha_; // Grayscale8 | 36 std::auto_ptr<Orthanc::ImageAccessor> alpha_; // Grayscale8 in the range [0, 255] 0 = transparent, 255 = opaque -> the foreground value will be displayed |
37 bool useWindowing_; | 37 float foreground_; // in the range [0.0, 65535.0] |
38 float foreground_; | |
39 | 38 |
40 public: | 39 public: |
41 RadiographyAlphaLayer(MessageBroker& broker, const RadiographyScene& scene) : | 40 RadiographyAlphaLayer(MessageBroker& broker, const RadiographyScene& scene) : |
42 RadiographyLayer(broker, scene), | 41 RadiographyLayer(broker, scene), |
43 useWindowing_(true), | |
44 foreground_(0) | 42 foreground_(0) |
45 { | 43 { |
46 } | 44 } |
47 | 45 |
48 | 46 |
49 void SetForegroundValue(float foreground) | 47 void SetForegroundValue(float foreground) |
50 { | 48 { |
51 useWindowing_ = false; | |
52 foreground_ = foreground; | 49 foreground_ = foreground; |
53 } | 50 } |
54 | 51 |
55 float GetForegroundValue() const | 52 float GetForegroundValue() const |
56 { | 53 { |
57 return foreground_; | 54 return foreground_; |
58 } | |
59 | |
60 bool IsUsingWindowing() const | |
61 { | |
62 return useWindowing_; | |
63 } | 55 } |
64 | 56 |
65 void SetAlpha(Orthanc::ImageAccessor* image); | 57 void SetAlpha(Orthanc::ImageAccessor* image); |
66 | 58 |
67 virtual bool GetDefaultWindowing(float& center, | 59 virtual bool GetDefaultWindowing(float& center, |
71 } | 63 } |
72 | 64 |
73 | 65 |
74 virtual void Render(Orthanc::ImageAccessor& buffer, | 66 virtual void Render(Orthanc::ImageAccessor& buffer, |
75 const AffineTransform2D& viewTransform, | 67 const AffineTransform2D& viewTransform, |
76 ImageInterpolation interpolation) const; | 68 ImageInterpolation interpolation, |
69 float windowCenter, | |
70 float windowWidth, | |
71 bool applyWindowing) const; | |
77 | 72 |
78 virtual bool GetRange(float& minValue, | 73 virtual bool GetRange(float& minValue, |
79 float& maxValue) const; | 74 float& maxValue) const; |
80 | 75 |
81 const Orthanc::ImageAccessor& GetAlpha() const | 76 const Orthanc::ImageAccessor& GetAlpha() const |