| 1095 | } |
| 1096 | |
| 1097 | void 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 | |
| 1116 | unsigned int mitk::MultiLabelSegmentation::GetNumberOfLabels(unsigned int group) const |
| 1117 | { |