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

Method UpdateCenterOfMass

Modules/Multilabel/src/mitkLabelSetImage.cpp:1042–1059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1040}
1041
1042void mitk::MultiLabelSegmentation::UpdateCenterOfMass(LabelValueType pixelValue)
1043{
1044 auto label = this->GetLabel(pixelValue);
1045 if (label.IsNull())
1046 return;
1047
1048 if (label->GetCenterOfMassMTime()<this->GetGroupImage(this->GetGroupIndexOfLabel(pixelValue))->GetMTime())
1049 { //the mtime of the center of mass prop is smaller then the group image -> recalculate to be on the safe side.
1050 if (4 == this->GetDimension())
1051 {
1052 AccessFixedDimensionByItk_1(this->GetGroupImage(this->GetGroupIndexOfLabel(pixelValue)), CalculateCenterOfMassProcessing, 4, pixelValue);
1053 }
1054 else
1055 {
1056 AccessByItk_1(this->GetGroupImage(this->GetGroupIndexOfLabel(pixelValue)), CalculateCenterOfMassProcessing, pixelValue);
1057 }
1058 }
1059}
1060
1061bool mitk::MultiLabelSegmentation::IsEmpty(LabelValueType pixelValue, TimeStepType t) const
1062{

Callers 1

Calls 7

GetLabelMethod · 0.95
GetGroupImageMethod · 0.95
GetGroupIndexOfLabelMethod · 0.95
GetDimensionMethod · 0.95
GetCenterOfMassMTimeMethod · 0.80
IsNullMethod · 0.45
GetMTimeMethod · 0.45

Tested by

no test coverage detected