ccraddock / cluster_roi

Python script to perform the spatially constrained parcellation of functional MRI data as described in Craddock et al., Human Brain Mapp., 33 (9) 2012
http://ccraddock.github.io/cluster_roi/
39 stars 26 forks source link

what's the rank function used in make_local_connectivity_scorr.py #8

Open DasDominus opened 3 years ago

DasDominus commented 3 years ago

eg. in def indx_3dto1d(idx, sz): if (rank(idx) == 1): idx1 = idx[0] prod(sz[1:3]) + idx[1] sz[2] + idx[2] else: idx1 = idx[:, 0] prod(sz[1:3]) + idx[:, 1] sz[2] + idx[:, 2] return idx1

what's the rank method used?

DasDominus commented 3 years ago

To anyone who might stumble upon this:

The rank here is calculating the matrix rank, which post python3 & numpy version (can't recall which one) is calculated with:

numpy.linalg.matrix_rank