Hello!
I'm in the process of comparing 6 parameter registrations between SPM's spm_coreg and FSL's flirt -dof 6. It occurred to me that it might be useful to get values for various cost functions of the final aligned-source and target images.
I did this about a week ago, so I might be slightly wrong about the details but: I tried to use the spm_coreg>optfun function to get NCC and NMI values. Since I was using the subfunction out of context of the program, and I just wanted accurate cost function values, I set
H = spm_hist2(VG.uint8,VF.uint8, eye(4) ,[1 1 1])
and commented the next 3 lines which smooth this histogram. I thought this would essentially find the cost function for the two input images unchanged and sampled "approximately" (spm_hist2) fully. Since my registration test involved misregistering and then registering a b0 diffusion volume to itself, I was using very similar source and target images.
My NCC values ended up looking correct, but I kept getting NMI values above 1 -- I got about NMI=1.17 for identical source and target images. If I remember correctly, I think I ended up trying spm_coreg IN context using debug mode, and NMI values were above 1 in this situation as well.
Why am I getting NMI values above 1? I'm certainly not an expert on cost functions, but figured the
sh = sum(H(:));
H = H/sh;
lines and
sum(sum(H.*log2(H)))
denominator of
nmi = (sum(s1.*log2(s1))+sum(s2.*log2(s2)))/sum(sum(H.*log2(H)));
would ensure the range of NMI was [0,1].
While I'm sure proper "normalization" of MI isn't critical for spm_coreg to function well, it would still be nice to have some hints as to why this happened, as I was planning on sharing my results with colleagues. The only guesses I have are that it's related to the sampling in spm_hist2 or the handling of H(i,j)=0 in the code.
Thanks for reading!
-Andrew
[log in to unmask]
|