| 134 | } |
| 135 | |
| 136 | void QmitkSimpleLabelSetListWidget::ResetList() |
| 137 | { |
| 138 | m_LabelList->clear(); |
| 139 | |
| 140 | auto activeLayerID = m_LabelSetImage->GetActiveLayer(); |
| 141 | auto labels = m_LabelSetImage->GetConstLabelsByValue(m_LabelSetImage->GetLabelValuesByGroup(activeLayerID)); |
| 142 | |
| 143 | for (auto& label : labels) |
| 144 | { |
| 145 | auto color = label->GetColor(); |
| 146 | QPixmap pixmap(10, 10); |
| 147 | pixmap.fill(QColor(color[0] * 255, color[1] * 255, color[2] * 255)); |
| 148 | QIcon icon(pixmap); |
| 149 | |
| 150 | QListWidgetItem* item = new QListWidgetItem(icon, QString::fromStdString(label->GetName())); |
| 151 | item->setData(Qt::UserRole, QVariant(label->GetValue())); |
| 152 | m_LabelList->addItem(item); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | void QmitkSimpleLabelSetListWidget::SetSelectedLabels(const LabelVectorType& selectedLabels) |
| 157 | { |
no test coverage detected