PERF: Use the faster TransformPhysicalPointToContinuousIndex overload#2901
Conversation
Replaced `image->TransformPhysicalPointToContinuousIndex(point, index)` calls by `image->TransformPhysicalPointToContinuousIndex<T>(point)`, which is slightly faster, as it does not figure out whether or not the point is inside the image. Declared variables that are initialized by `image->TransformPhysicalPointToContinuousIndex<T>(point)` `const`, when possible. Follow-up to pull request InsightSoftwareConsortium#2873 commit eb6ac88 "PERF: Use the faster TransformPhysicalPointToIndex overload in filter"
ebcad0a to
a17ba41
Compare
|
The previous method returned a |
Thanks for asking, @blowekamp This pull request should not cause any change in behavior, because it only replaced calls to the old For example here (in ITK v5.3rc02): Adjusted the Right? |
|
@N-Dekker Yes. I think we are in agreement here. I just wanted to check. Perhaps a comment in the commit message indicated that the is inside check was not used would have short circuited the necessity of this discussion. PR LGTM. |
Follow-up to ITK pull request InsightSoftwareConsortium/ITK#2901 commit InsightSoftwareConsortium/ITK@6a8569e "PERF: Use the faster `TransformPhysicalPointToContinuousIndex` overload"
Follow-up to ITK pull request InsightSoftwareConsortium/ITK#2901 commit InsightSoftwareConsortium/ITK@6a8569e (merged on 27 November 2021).
Follow-up to ITK pull request InsightSoftwareConsortium/ITK#2901 commit InsightSoftwareConsortium/ITK@6a8569e (merged on 27 November 2021).
Follow-up to ITK pull request InsightSoftwareConsortium/ITK#2901 commit InsightSoftwareConsortium/ITK@6a8569e (merged on 27 November 2021).
Replaced a call to `TransformPhysicalPointToContinuousIndex` with its faster overload, within `SLICImageFilter::BeforeThreadedGenerateData()`. Follow-up to pull request InsightSoftwareConsortium#2901 commit 6a8569e "PERF: Use the faster `TransformPhysicalPointToContinuousIndex` overload"
Fixed warnings like: > warning C4834: discarding return value of function with [[nodiscard]] attribute `TransformPhysicalPointToContinuousIndex(fixedPoint)` is faster than `TransformPhysicalPointToContinuousIndex(fixedPoint, voxelCoord)`, see also ITK pull request InsightSoftwareConsortium/ITK#2901 "PERF: Use the faster `TransformPhysicalPointToContinuousIndex` overload"
Replaced a call to `TransformPhysicalPointToContinuousIndex` with its faster overload, within `SLICImageFilter::BeforeThreadedGenerateData()`. Follow-up to pull request InsightSoftwareConsortium#2901 commit 9d67c47 "PERF: Use the faster `TransformPhysicalPointToContinuousIndex` overload"
Replaced
image->TransformPhysicalPointToContinuousIndex(point, index)calls by
image->TransformPhysicalPointToContinuousIndex<T>(point),which is slightly faster, as it does not figure out whether or not the
point is inside the image.
Declared variables that are initialized by
image->TransformPhysicalPointToContinuousIndex<T>(point)const, whenpossible.
Follow-up to pull request #2873
commit eb6ac88
"PERF: Use the faster TransformPhysicalPointToIndex overload in filter"