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

Method SetPreviewLabel

Modules/PythonSegmentation/src/mitknnInteractiveTool.cpp:508–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508void mitk::nnInteractiveTool::SetPreviewLabel(MultiLabelSegmentation::LabelValueType value, const Color& color)
509{
510 auto image = this->GetPreviewSegmentation();
511
512 if (image == nullptr)
513 return;
514
515 auto label = image->GetLabel(value);
516
517 if (label.IsNull())
518 {
519 label = Label::New(value, "preview");
520 image->AddLabel(label, 0, false, false);
521 }
522
523 image->GetLabel(value)->SetColor(color);
524 image->UpdateLabel(value, label);
525
526 image->SetActiveLabel(value);
527 this->SetSelectedLabels({value});
528}
529
530void mitk::nnInteractiveTool::DoUpdatePreview(const Image* inputAtTimeStep, const Image* /*oldSegAtTimeStep*/, MultiLabelSegmentation* previewImage, TimeStepType timeStep)
531{

Callers 1

DoUpdatePreviewMethod · 0.95

Calls 9

AddLabelMethod · 0.80
SetActiveLabelMethod · 0.80
NewFunction · 0.50
GetLabelMethod · 0.45
IsNullMethod · 0.45
SetColorMethod · 0.45
UpdateLabelMethod · 0.45
SetSelectedLabelsMethod · 0.45

Tested by

no test coverage detected