comparison Framework/Radiography/RadiographyAlphaLayer.h @ 1200:54cbffabdc45 broker

integration mainline->broker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 29 Nov 2019 11:03:41 +0100
parents b537002f83a9 a5f2a6b04a31
children 68579a31eeb4
comparison
equal deleted inserted replaced
1198:4cc997207d8a 1200:54cbffabdc45
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(const RadiographyScene& scene) : 40 RadiographyAlphaLayer(const RadiographyScene& scene) :
42 RadiographyLayer(scene), 41 RadiographyLayer(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