Skip to content

Commit

Permalink
PERF: Use the faster TransformPhysicalPointToIndex overload in filter
Browse files Browse the repository at this point in the history
Replaced `image->TransformPhysicalPointToIndex(point, index)` call by
`image->TransformPhysicalPointToIndex(point)`, which is slightly faster,
as it does not figure out whether or not the point is inside the image.

Follow-up to pull request #993
commit 0703516
"STYLE: Use image->TransformPhysicalPointToIndex(point), returning index"
  • Loading branch information
N-Dekker authored and dzenanz committed Nov 16, 2021
1 parent af32a77 commit eb6ac88
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class ITK_TEMPLATE_EXPORT ShapePositionLabelMapFilter : public InPlaceLabelMapFi
point[i] = static_cast<OffsetValueType>(position[i]); // FIXME: use next line instead.
// point[i] = static_cast<CoordinateType>( position[i] );
}
this->GetOutput()->TransformPhysicalPointToIndex(point, idx);
idx = this->GetOutput()->TransformPhysicalPointToIndex(point);
}
else
{
Expand Down

0 comments on commit eb6ac88

Please sign in to comment.