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

Method IsEmpty

Modules/Multilabel/src/mitkLabelSetImage.cpp:1061–1081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1059}
1060
1061bool mitk::MultiLabelSegmentation::IsEmpty(LabelValueType pixelValue, TimeStepType t) const
1062{
1063 Image::ConstPointer image = this->GetGroupImage(this->GetGroupIndexOfLabel(pixelValue));
1064 image = SelectImageByTimeStep(image, t);
1065
1066 size_t numPixels = 1;
1067
1068 for (int i = 0; i < 3; ++i)
1069 numPixels *= static_cast<size_t>(image->GetDimension(i));
1070
1071 ImagePixelReadAccessor<LabelValueType, 3> accessor(image);
1072 auto pixels = accessor.GetData();
1073
1074 for (size_t i = 0; i < numPixels; ++i)
1075 {
1076 if (pixels[i] == pixelValue)
1077 return false;
1078 }
1079
1080 return true;
1081}
1082
1083bool mitk::MultiLabelSegmentation::IsEmpty(const Label* label, TimeStepType t) const
1084{

Calls 5

GetGroupImageMethod · 0.95
GetGroupIndexOfLabelMethod · 0.95
GetDimensionMethod · 0.45
GetDataMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected