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

Method EraseLabel

Modules/Multilabel/src/mitkLabelSetImage.cpp:891–917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

889}
890
891void mitk::MultiLabelSegmentation::EraseLabel(LabelValueType pixelValue)
892{
893 try
894 {
895 auto groupID = this->GetGroupIndexOfLabel(pixelValue);
896
897 mitk::Image* groupImage = this->GetGroupImage(groupID);
898
899 if (4 == this->GetDimension())
900 {
901 AccessFixedDimensionByItk_1(groupImage, EraseLabelProcessing, 4, pixelValue);
902 }
903 else
904 {
905 AccessByItk_1(groupImage, EraseLabelProcessing, pixelValue);
906 }
907 groupImage->Modified();
908 }
909 catch (const itk::ExceptionObject& e)
910 {
911 mitkThrow() << e.GetDescription();
912 }
913
914 this->InvokeEvent(LabelModifiedEvent(pixelValue));
915 this->InvokeEvent(LabelsChangedEvent({ pixelValue }));
916 Modified();
917}
918
919void mitk::MultiLabelSegmentation::EraseLabels(const LabelValueVectorType& labelValues)
920{

Callers 5

RemoveLabelMethod · 0.95
EraseLabelsMethod · 0.95
TestEraseLabelsMethod · 0.80
OnClearLabelMethod · 0.80

Calls 6

GetGroupIndexOfLabelMethod · 0.95
GetGroupImageMethod · 0.95
GetDimensionMethod · 0.95
ModifiedFunction · 0.85
ModifiedMethod · 0.45
GetDescriptionMethod · 0.45

Tested by 2

TestEraseLabelsMethod · 0.64
OnClearLabelMethod · 0.64