@@ -107,7 +107,8 @@ def normalize_thresholds(mesh, voronoi, thresh_dist=20.0,
107107 fielder = differential_geometry .mesh_laplacian_eigenvectors (mesh , 1 )
108108 imin = fielder .argmin ()
109109 imax = fielder .argmax ()
110- min_mesh_fiedler_length = geodesics .compute_gdist (mesh , imin , imax )[0 ] # extract single element out of array
110+ # extract single element out of array
111+ min_mesh_fiedler_length = geodesics .compute_gdist (mesh , imin , imax )[0 ]
111112 mesh_area = np .sum (voronoi )
112113
113114 # Set group average values
@@ -144,7 +145,8 @@ def watershed(mesh, voronoi, dpf, thresh_dist, thresh_ridge,
144145 ----------
145146 mesh : white matter triangular mesh of subject (trimesh object)
146147 voronoi : voronoi area for each vertex (numpy array)
147- dpf : depth measure for each vertex. Deepest points should have smaller values (numpy array)
148+ dpf : depth measure for each vertex. Deepest points should have
149+ smaller values (numpy array)
148150 thresh_dist : threshold on the distance between pits (unit: mm)
149151 thresh_ridge : threshold on the ridge height (unit: mm)
150152 thresh_area : threshold on the basin area (unit: mm²)
@@ -163,8 +165,10 @@ def watershed(mesh, voronoi, dpf, thresh_dist, thresh_ridge,
163165 ridges[(i,j)] = {}
164166 'ridge_index': vertex index of the ridge point
165167 'ridge_depth': depth of the ridge point
166- 'ridge_height': depth difference between ridge point and shallowest pit
167- 'ridge_length': number of vertices along the frontier between basins
168+ 'ridge_height': depth difference between ridge point and
169+ shallowest pit
170+ 'ridge_length': number of vertices along the frontier
171+ between basins
168172 adjacency : adjacency matrix of the basins
169173 adjacency[i,j] = 1 if basin i and j are adjacent, 0 otherwise
170174 """
@@ -434,8 +438,10 @@ def watershed(mesh, voronoi, dpf, thresh_dist, thresh_ridge,
434438 ridges [(i , j )]['ridge_index' ] = (
435439 ridges_vertices )[np .argmin (vert_depth [ridges_vertices ])]
436440 ridges [(i , j )]['ridge_depth' ] = np .min (vert_depth [ridges_vertices ])
437- ridges [(i , j )]['ridge_height' ] = abs (basins [j ]['pit_depth' ] - ridges [(i , j )]['ridge_depth' ]) # depth
438- # difference between ridge point and highest pit which should correspond to index j (> index i)
441+ # 'ridge_height'] = depth difference between ridge point and highest
442+ # pit which should correspond to index j (> index i)
443+ ridges [(i , j )]['ridge_height' ] = (
444+ abs (basins [j ]['pit_depth' ] - ridges [(i , j )]['ridge_depth' ]))
439445 ridges [(i , j )]['ridge_length' ] = len (ridges_vertices )
440446
441447 return basins , ridges , adjacency
0 commit comments