Get spatially-connected clusters starting from a 3D map of logical values
Usage
cluster_threshold(map, max_dist = sqrt(3))
Arguments
map
3D map of logical values. TRUE if the voxel it to be clustered (e.g. it is supra-threshold).
max_dist
maximum distance allowed to in the same cluster. By default:
max_dist=sqrt(3) i.e. comprises all the voxels up to the corners souranding the target voxel. A value such as
max_dist=sqrt(2) excludes the corners.
Value
a 3D map (same size of map) with integer values identifying the cluster and 0 elsewhere.