-
Notifications
You must be signed in to change notification settings - Fork 141
Description
I want to solicit opinions about the ideal output dimensions for brainiak.isc.isfc; just had a conversation with @manojneuro offline about this. Currently, if we input an array with shape (n_TRs, n_voxels, n_subjects), the vanilla isc function returns an (n_subjects, n_voxels) (or (n_pairs, n_voxels)) array of ISC values—this makes sense to me based on our discussions about standardizing dimension order in BrainIAK, because these ISC values are now our samples of interest per voxel. The downstream statistical tests for ISCs are expecting this n_subjects by n_voxels structure—typically your test will return a single statistic that collapse over the first dimension, leaving you with a single value (e.g., a p-value) per voxel. In contrast, if we supply the same array to isfc, we get an output array of ISFCs with shape (n_voxels, n_voxels, n_subjects). This sort of makes sense in a vacuum, but doesn't really match the logic of the isc function, and also won't play nicely with statistical tests without some manual re-structuring. I think my favorite option here would be to use squareform to vectorize the n_voxels by n_voxels matrices per subject into something like n_connections and put this vector in the second dimension, so the output would be shaped (n_subjects, n_connections). With 20 subjects and 1000 voxels, this will yield an isfc output shaped (20, 499500) (where 1000 * (1000 - 1) / 2 = 499500). This would play nicely with the compute_summary_statistic, bootstrap_isc, and permutation_isc tests without any external reshaping by the user, yielding an output vector with 499500 values (e.g., mean ISFCs, p-values, etc), which can then be supplied to squareform to recover the (1000, 1000) shape. This might be a little less intuitive at first, but seems more internally consistent and efficient. Any thoughts on this? @qihongl @mihaic