Computing similarity between statistical images

I want to compute the similarity between two (or more) statistical images. I currently use Cosine Similarity for this but I wonder if it might be not that robust against outliers and if there are any other recommendable techniques?

Ahoi hoi @JohannesWiesner,

did you already have a look at nistats’ compare_niimgs function? It uses pearson correlation to compare two or more images. As outputs, you’ll get plots of the pearson correlation and histograms of the image values. However, as you know: pearson correlation is sensitive to outliers, as large ones in either x or y will have different impacts on the numerator or denominator.

HTH a bit, cheers, Peer

P.S.: The nistats-nilearn merger is close to the finish line. Hence, you (and everyone else) should look out for the corresponding functionality within nilearn that will be ready to use later this year, that is nilearn.stats. Great things are happening there!

1 Like

Hi @PeerHerholz, thanks for the hint, I didn’t know of nistats.reporting.compare_niimgs. And thanks for the update, I thought the merge would happen in late 2020?

Ahoi hoi @JohannesWiesner,

oh, you’re right, I was a bit too excited: the code was moved/integrated, but
now further adaptions and tests are happening to integrate it as good
as possible in nilearn’s structure and organization. Hence, folks should look
out for updates but maybe use the latest nistats in the mean time.
I’ll update my answer from above accordingly. Thanks for the catch.

Best, Peer