Skip to content

Commit

Permalink
BUG: Fix computation of weighted centroid in LabelGeometryImageFilter
Browse files Browse the repository at this point in the history
Intensity values were cast to integers,
thus making the computation imprecise.
  • Loading branch information
dzenanz committed Mar 20, 2024
1 parent 17a221c commit daec066
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ LabelGeometryImageFilter<TLabelImage, TIntensityImage>::GenerateData()
for (unsigned int i = 0; i < ImageDimension; ++i)
{
// FIRST ORDER WEIGHTED RAW MOMENTS
mapIt->second.m_FirstOrderWeightedRawMoments[i] += index[i] * (typename LabelIndexType::IndexValueType)value;
mapIt->second.m_FirstOrderWeightedRawMoments[i] += index[i] * value;
}

++it;
Expand Down

0 comments on commit daec066

Please sign in to comment.