John, I compiled the routine using: mex spm_hist2.c -O it compiled successfully using the build in lcc in Matlab531 in win2000 but it failed to run at runtime. Maybe I did something wrong? Is that possible to make spm_hist2.dll available? Thanks. Kelvin On Fri, 9 Mar 2001, John Ashburner wrote: > | I am having some problems with the MI coregistration. I have run it > | on several data sets, with no change in the orientation of the data. To > | look into this further, I took an epi data set, and rotated the entire > | volume 15 degrees in the x-y plane, simulating a head tilt. I then > | applied the mutual information coregistration between the original data > | set and the rotated data set. The MI algortithm ran through it's > | various iterations, however, at the end, the output was still in rotated > | space, and there was no difference between the volumes after subtracting > | the two. Any help would be appreciated. > > What happens in the line minimisation plot? Does the function always find > the best solution at exactly zero? If so, then it is probably something > to do with the very rough and problematic error surface that you get with > images with large voxels. > > This is something I have been looking at recently, which I think I have > fixed by simplifying the way that the joint histograms are created. What was > happening was that when a point was sampled between the centres of a group > of 8 voxels, a small amount was added to the bins of the histograms > corresponding to the intensity of the 8 neighbours. The amount added was > related to the distance from the point to the voxel. When sampling an equal > distance from all the points, 1/8 was added to all the relevent bins. When > sampling exactly at the centre of a voxel, then 1 was added to the bin for > that voxel. The effect that this had was that the mutual information cost > function was related to the amount of interpolation done. When all points > were sampled at the voxel centres, the mutual information was higher because > the histograms were more spikey. The whole thing resulted in lots of local > minima at positions where there was less interpolation. It is particularly > bad when the images have relatively large voxels, as in the case of registering > functional images. > > It should work better now. There is a fix in: > ftp://ftp.fil.ion.ucl.ac.uk/spm/spm99_updates/spm_hist2.c > > For Solaris machines, there is a compiled spm_hist2.mexsol that should > make life easier. Otherwise, you need to recompile the mex file with > a command something like: > mex spm_hist2.c -O > > As always, feedback is useful. > > best regards, > -John >