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

Method CreateHTMLLabelDetails

Modules/Multilabel/src/mitkLabelSetImageHelper.cpp:428–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426}
427
428std::string mitk::LabelSetImageHelper::CreateHTMLLabelDetails(const mitk::Label* label, const mitk::MultiLabelSegmentation* segmentation)
429{
430 std::stringstream stream;
431 stream << "<font class=\"normal\"> ";
432
433 stream << "<b>Pixel value:</b> " << label->GetValue();
434 if (nullptr != segmentation && segmentation->GetNumberOfGroups() > 1 && segmentation->ExistLabel(label->GetValue()))
435 {
436 stream << "<br/><b>Group:</b> " << CreateDisplayGroupName(segmentation, segmentation->GetGroupIndexOfLabel(label->GetValue()));
437 }
438 if (!label->GetTrackingID().empty())
439 {
440 stream <<"<br/><b>Tracking ID:</b> "<< label->GetTrackingID();
441 }
442 if (label->GetAnatomicRegionCount() > 0)
443 {
444 auto code = label->GetAnatomicRegion(0);
445 stream <<"<br/><b>Anatomic region:</b> " << code.GetMeaning();
446 }
447 if (label->GetPrimaryAnatomicStructureCount() > 0)
448 {
449 auto code = label->GetPrimaryAnatomicStructure(0);
450 stream << "<br/><b>Primary anatomic structure:</b> " << code.GetMeaning();
451 if (code.GetModifierCount() > 0)
452 {
453 stream << " (" <<code.GetModifier(0).GetMeaning()<<")";
454 }
455 }
456 if (auto code = label->GetSegmentedPropertyCategory(); code.has_value())
457 {
458 stream <<"<br/><b>Type category:</b> " << code->GetMeaning();
459 }
460 if (auto code = label->GetSegmentedPropertyType(); code.has_value())
461 {
462 stream << "<br/><b>Type:</b> " << code->GetMeaning();
463 if (code->GetModifierCount() > 0)
464 {
465 stream << " (" << code->GetModifier(0).GetMeaning() << ")";
466 }
467 }
468 if (!label->GetDescription().empty())
469 {
470 stream <<"<br/><b>Description:</b> " << label->GetDescription();
471 }
472
473 stream << "</font>";
474 return stream.str();
475}

Callers

nothing calls this directly

Calls 14

GetNumberOfGroupsMethod · 0.80
ExistLabelMethod · 0.80
GetGroupIndexOfLabelMethod · 0.80
GetTrackingIDMethod · 0.80
GetAnatomicRegionMethod · 0.80
GetModifierCountMethod · 0.80
GetValueMethod · 0.45

Tested by

no test coverage detected