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

Method ResetList

Modules/SegmentationUI/src/QmitkSimpleLabelSetListWidget.cpp:136–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void 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
156void QmitkSimpleLabelSetListWidget::SetSelectedLabels(const LabelVectorType& selectedLabels)
157{

Callers 3

SetLabelSetImageMethod · 0.95
OnLayerChangedMethod · 0.95
OnLabelChangedMethod · 0.95

Calls 8

GetActiveLayerMethod · 0.80
GetConstLabelsByValueMethod · 0.80
GetLabelValuesByGroupMethod · 0.80
clearMethod · 0.45
GetColorMethod · 0.45
GetNameMethod · 0.45
setDataMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected