cosanlab / nltools

Python toolbox for analyzing imaging data
https://nltools.org
MIT License
121 stars 44 forks source link

Speed up to Brain_Data.similarity #308

Closed ejolly closed 1 year ago

ejolly commented 5 years ago

We should swap our current code where we loop over flattened arrays in Brain_Data.similarity() to scipy.spatial.distance.cdist which is 2 orders of magnitude faster.

For example, correlating a 5,000 x 50,000 Brain with a 11 x 50,000 Brain takes ~2:30 min, but with cdist takes about ~ 12 seconds.