We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ffdc090 commit 4115597Copy full SHA for 4115597
kimimaro/utility.py
@@ -154,7 +154,11 @@ def cross_sectional_area(
154
155
normals = (path[1:] - path[:-1]).astype(np.float32)
156
normals = np.concatenate([ normals, [normals[-1]] ])
157
+
158
+ # Running the filter in the forward and then backwards
159
+ # direction eliminates phase shift.
160
normals = moving_average(normals, smoothing_window)
161
+ normals = moving_average(normals[::-1], smoothing_window)[::-1]
162
163
for i in range(len(normals)):
164
normal = normals[i,:]
0 commit comments