MCPcopy Create free account
hub / github.com/MITK/MITK / UpdateLookupTable

Method UpdateLookupTable

Modules/Multilabel/src/mitkLabelSetImage.cpp:1097–1114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1095}
1096
1097void mitk::MultiLabelSegmentation::UpdateLookupTable(LabelValueType pixelValue)
1098{
1099 auto label = this->GetLabel(pixelValue);
1100 if (label.IsNull()) mitkThrow() << "Cannot update lookup table. Unknown label value provided. Unknown label value:" << pixelValue;
1101
1102 const mitk::Color& color = label->GetColor();
1103
1104 double rgba[4];
1105 m_LookupTable->GetTableValue(static_cast<int>(pixelValue), rgba);
1106 rgba[0] = color.GetRed();
1107 rgba[1] = color.GetGreen();
1108 rgba[2] = color.GetBlue();
1109 if (label->GetVisible())
1110 rgba[3] = label->GetOpacity();
1111 else
1112 rgba[3] = 0.0;
1113 m_LookupTable->SetTableValue(static_cast<int>(pixelValue), rgba);
1114}
1115
1116unsigned int mitk::MultiLabelSegmentation::GetNumberOfLabels(unsigned int group) const
1117{

Callers 14

RenameLabelMethod · 0.95
UpdateLabelMethod · 0.95
SetAllLabelsVisibleMethod · 0.95
LoadNewJSONPresetFunction · 0.45
setDataMethod · 0.45
CreateOpacityActionMethod · 0.45
OnRenameLabelMethod · 0.45

Calls 7

GetLabelMethod · 0.95
IsNullMethod · 0.45
GetColorMethod · 0.45
GetTableValueMethod · 0.45
GetVisibleMethod · 0.45
GetOpacityMethod · 0.45
SetTableValueMethod · 0.45

Tested by 4

CreateOpacityActionMethod · 0.36
OnRenameLabelMethod · 0.36