> In the coregistration algorithm spm_coreg, what are the values computed
> in the joint histogram? I thought it was, for example we draw a sample
> of pair of voxels in the fixed image and moved image at the same
> coordinate, and add 1 in the joint histogram at the cell H(i,j) where i
> represents the grey level of the voxel in the fixed image and j the one
> in the moving image. If that was simply it, then the histogram would
> represent the number of occurences of the pairs of grey levels, and this
> would mean there would be only integers not floating point numbers in
> the histogram, as it is when I checked.
The voxels in one image do not correspond to the exact centres of voxels in
the other image - therefore some form of interpolation is needed (see the
rigid registration chapter in Human Brain Function II - Chapter 2 of
http://www.fil.ion.ucl.ac.uk/spm/doc/books/hbf2/).
>
> And this lead to my second question: where is the drawing of the samples
> voxels accomplished, in the source code? Is it in spm_hist2.c?
Yes.
> I had a
> look at that code but I can't really figure out what it does exactly.
Much of the code is so that the samples are taken at slightly dithered points.
I figured including a proper random-number generator may be a bit slow, so I
used a crude set of pre-defined random numbers to do the dithering. The
dithering was to try to reduce the "saw-tooth" effect on the objective
function.
> Same question for the grey value of the moved image: first it has to be
> "moved" to the spatial coordinates of the fixed image (well at least to
> the one found at the current iteration loop during the research for the
> optimal spatial transformation), then the grey value has somehow to be
> interpolated. Where is that done? Is it all in spm_hist2.c? Is this the
> purpose of the function
> float samp(const int d[3], unsigned char f[], float x, float y, float z)
> in this code?
Yes. Although there is also another sort of interpolation when adding values
to the histogram.
Best regards,
-John
|