FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
SegmentationRenderer.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 #include "FAST/Data/Color.hpp"
6 #include "FAST/Utility.hpp"
7 #include <unordered_map>
8 #include <mutex>
9 
10 namespace fast {
11 
12 class FAST_EXPORT SegmentationRenderer : public ImageRenderer {
14  public:
15  void setColor(Segmentation::LabelType, Color);
16  void setColor(int label, Color);
17  void setFillArea(Segmentation::LabelType, bool);
18  void setFillArea(bool fillArea);
19  void setBorderRadius(int radius);
20  void setOpacity(float opacity);
21  void setInterpolation(bool useInterpolation);
22  void loadAttributes() override;
23  private:
25  void draw(Matrix4f perspectiveMatrix, Matrix4f viewingMatrix, float zNear, float zFar, bool mode2D) override;
26 
27  bool mColorsModified;
28  bool mFillAreaModified;
29 
30  std::unordered_map<int, Color> mLabelColors;
31  std::unordered_map<int, bool> mLabelFillArea;
32  bool mFillArea;
33  bool mUseInterpolation = true;
34  int mBorderRadius = 1;
35  float mOpacity = 1;
36  cl::Buffer mColorBuffer, mFillAreaBuffer;
37 };
38 
39 } // end namespace fast
40 
fast
Definition: AffineTransformation.hpp:7
ImageRenderer.hpp
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::SegmentationRenderer
Definition: SegmentationRenderer.hpp:12
Segmentation.hpp
Utility.hpp
fast::Segmentation::LabelType
LabelType
Definition: Segmentation.hpp:16
Color.hpp
fast::Color
Definition: Color.hpp:8
fast::ImageRenderer
Definition: ImageRenderer.hpp:8