Hi everyone!
I'm interested in writing the coregistration algorithm
of SPM2 in C as a "standalone" application.
Looking at spm_coreg.m I see the 2 functions
"loaduint8" and "smoothuint8". Why is it that we fit
the pixel values between 0..255? Especially when, in
example, spm_convol.c seems to deal with any data type
(if dtype=SPM_DOUBLE, SPM_FLOAT, etc..). Does it not
result in a loss during conversion?
Another question: in spm_conv_vol.c, what is the role
of the parameters double *oVol and mxArray
*wplane_args[3]?
Since I'm not using MatLab API I have to get rid of
all the mxFunctions, and I'd like to be sure I'm
getting it right. oVol seems to represent a pointer to
the second parameter of the function(prhs[1]), that is
to say, when you call it from smooth_uint8 in
spm_coregister.m, "V.uint8", which sould be, if I'm
right, a pointer to the pixel data from 0 to 255. It
seemed natural to use unsigned char for those data,
but then oVol is a pointer to double... As far as
wplane_args is concerned, I have no clue about what it
is for.
My final question is how is the data managed in
memory?
I mean, for example, in the MAPTYPE structure, how are
the pixel data sorted? Looking at spm_mapping.c I see
that the field maps.data is an array of pointers, more
precisely an array of maps.dim[2] pointers which
should represent the number of slices in a 3D volume.
Does this mean that the data is represented as one big
array, with pixel values sorted rows by rows and slice
by slice? Or is it more tricky than that?
Thanks in advance for any help!
Remi.
___________________________________________________________________________
Faites de Yahoo! votre page d'accueil sur le web pour retrouver directement vos services préférés : vérifiez vos nouveaux mails, lancez vos recherches et suivez l'actualité en temps réel.
Rendez-vous sur http://fr.yahoo.com/set
|