fast::SegmentationLabelRenderer class

Renders text labels on top of Segmentation data.

Renders text labels (e.g. Blood, Bone, ..) with colors on top of Segmentation data. A text label is rendered in the center of every segmentation region with an area larger than a given threshold.

Base classes

class LabelColorRenderer

Public functions

auto create(LabelNames labelNames, LabelColors labelColors, float areaThreshold) -> std::shared_ptr<SegmentationLabelRenderer>
Create instnace.
void setLabelNames(std::map<uint, std::string> labelNames)
void setLabelName(uint label, std::string name)
void setAreaThreshold(float threshold)
void draw(Matrix4f perspectiveMatrix, Matrix4f viewingMatrix, float zNear, float zFar, bool mode2D) override
void loadAttributes() override

Protected functions

void execute() override

Protected variables

std::unordered_map<uint, uint> mTexturesToRender
std::unordered_map<uint, uint> mVAO
std::unordered_map<uint, uint> mVBO
std::unordered_map<uint, uint> mEBO
std::unordered_map<uint, std::shared_ptr<RegionList>> m_regions
std::unordered_map<uint, std::shared_ptr<Image>> mImageUsed
std::unordered_map<uint, uint64_t> mDataTimestamp
std::unordered_map<uint, float> mScales
std::map<uint, std::string> m_labelNames
uint mFontSize
Vector2f m_worldPosition
Vector2f m_viewPosition
float m_textHeightInMM
bool m_centerPosition
bool m_dynamicSize
float m_areaThreshold

Function documentation

std::shared_ptr<SegmentationLabelRenderer> fast::SegmentationLabelRenderer::create(LabelNames labelNames, LabelColors labelColors, float areaThreshold)

Create instnace.

Parameters
labelNames Map from label id to label name
labelColors Map from label id to color
areaThreshold Any segmentation region smaller than this threshold does not get a label
Returns instance

Variable documentation

std::unordered_map<uint, uint64_t> fast::SegmentationLabelRenderer::mDataTimestamp protected

Timestamp used to generate texture