| 1059 | } |
| 1060 | |
| 1061 | bool 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 | |
| 1083 | bool mitk::MultiLabelSegmentation::IsEmpty(const Label* label, TimeStepType t) const |
| 1084 | { |
no test coverage detected