Skip to content

Commit

Permalink
Remove pixelwise update correctly for squiggliness
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Jul 6, 2015
1 parent 0536bb2 commit 1275a1f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gala/features/squiggliness.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@ def update_edge_cache(self, g, e1, e2, dst, src):
(dst[np.newaxis,self.ndim:], src[np.newaxis,self.ndim:]),
axis=0).max(axis=0)

def compute_edge_features(self, g, n1, n2, cache=None):
if cache is None:
cache = g[n1][n2][self.default_cache]
m, M = cache[:self.ndim], cache[self.ndim:]
plane_surface = np.sort(M-m)[1:].prod() * (3.0-g.pad_thickness)
return np.array([len(g[n1][n2]['boundary']) / plane_surface])

0 comments on commit 1275a1f

Please sign in to comment.