InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.4k stars 661 forks source link

STYLE: Move `GetSpacing()` calls out of `for` loops #4516

Closed N-Dekker closed 5 months ago

N-Dekker commented 5 months ago

Avoided calling GetSpacing() repetitively in a for loop, by using a local spacing variable.

Cases found by the following regular expressions:

if \(m_UseImageSpacing\).+    for .+->GetSpacing\(\)\[
if \(this->GetUseImageSpacing\(\)\).+    for .+->GetSpacing\(\)\[

Aims to improve code readability.