run_nparcels

Import in python using from mcutils.scripts.surface.watershed import run_nparcels

mcutils.scripts.surface.watershed.run_nparcels(surface: mcutils.surface.cortical_mesh.CorticalMesh, depth, nparcels, min_size=0, fill_ridge=False)[source]

Returns a parcellation with requested number of parcels based on watershed algorithm

min_depth of the parcels in the watershed algorithm is determined to match the number of samples

Parameters
  • surface – mesh representing cortical surface

  • depth – (N, ) array where N is number of vertices

  • nparcels – number of parcels in the output (not counting edges)

  • min_size – minimal size of each segment in mm^2

  • fill_ridge – if True, fills the ridge with the value of the smaller of the neighbouring parcels

Returns

(N, ) array with segmentation (-1 on edges, 1-nparcels within segments)