Commit 424152d5 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

ENH : Code review 1

No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
...@@ -62,12 +62,12 @@ PersistentLabelImageSmallRegionMergingFilter< TInputLabelImage > ...@@ -62,12 +62,12 @@ PersistentLabelImageSmallRegionMergingFilter< TInputLabelImage >
// For each label of the label map, find the "closest" connected label, according // For each label of the label map, find the "closest" connected label, according
// to the euclidian distance between the corresponding m_labelStatistic elements. // to the euclidian distance between the corresponding m_labelStatistic elements.
for (auto neighbours : neighboursMap) for (auto const & neighbours : neighboursMap)
{ {
double proximity = std::numeric_limits<double>::max(); double proximity = std::numeric_limits<double>::max();
InputLabelType label = neighbours.first; InputLabelType label = neighbours.first;
InputLabelType closestNeighbour = label; InputLabelType closestNeighbour = label;
for (auto neighbour : neighbours.second) for (auto const & neighbour : neighbours.second)
{ {
auto statsLabel = m_LabelStatistic[ label ]; auto statsLabel = m_LabelStatistic[ label ];
auto statsNeighbour = m_LabelStatistic[ neighbour ]; auto statsNeighbour = m_LabelStatistic[ neighbour ];
...@@ -75,7 +75,7 @@ PersistentLabelImageSmallRegionMergingFilter< TInputLabelImage > ...@@ -75,7 +75,7 @@ PersistentLabelImageSmallRegionMergingFilter< TInputLabelImage >
double distance = 0; double distance = 0;
for (unsigned int i = 0 ; i < statsLabel.Size(); i++) for (unsigned int i = 0 ; i < statsLabel.Size(); i++)
{ {
distance += pow( statsLabel[i] - statsNeighbour[i] , 2); distance += (statsLabel[i] - statsNeighbour[i]) * (statsLabel[i] - statsNeighbour[i]);
} }
if (distance < proximity) if (distance < proximity)
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment