Sorry to all. I had clearly misnamed the extended options in the GUI.
I only implemented it so I could use nearest neighbour, so didn't really
examine the other options too closely.
The attached is the corrected version, stating polynomial as the higher
order interpolation options. As John says they are probably not a good
idea, I guess people won't want them, but at least they'll know they
don't want them!
Cheers,
mark
Ashburner John (PSYCHOLOGY) wrote:
> B-spline interpolation is quite different from the polynomial
> interpolation. In fact, I would not recommend polynomial interpolation
> with a degree greater than 1 (trilinear) as the gradients will not be
> continuous.
>
> B-spline interpolation is a generalized interpolation method. For
> degrees greater than 1, it begins by generating an image of coefficients
> (a deconvolution procedure done by spm_bsplinc). These can be thought
> of as basis function coefficients, where there is a local basis function
> centered on each voxel. These coefficients are then used, along with
> the amplitudes of the basis functions at the new points, to resample the
> image (via spm_bsplins).
>
> B-splines are the recommended interpolation approach.
>
> Best regards,
> -John
>
> -----Original Message-----
> From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]]
> On Behalf Of Ged Ridgway
> Sent: Wednesday, September 27, 2006 5:06 PM
> To: [log in to unmask]
> Subject: Re: [SPM] write deformations
>
> Hi Mark,
>
> Looks a useful hack! Do you by any chance know the answer to my
> earlier confusion:
> "spm_sample_vol seems to offer sinc or polynomial, but not b-spline"
>
> I see in your help you refer to nth order B-spline interpolation, but
> I think the help for spm_sample_vol refers instead to Lagrange
> polynomial interpolation; I didn't think these were the same, but
> maybe I'm wrong about that... I guess B-splines are piecewise
> polynomials... Do you (and/or any other readers) think they are
> different names for the same thing? (I haven't looked through the C
> code to see what's actually done!)
>
> Best,
> Ged.
>
> Mark Daglish wrote:
>
>> Hi Siawoosh,
>>
>> I hacked the attached version of spm_applydef_ui.m to allow me to
>>
> choose
>
>> the resampling option when applying a deformation field to an image.
>>
> I
>
>> wanted nearest neighbour so I could resample object maps. It offers a
>> choice of the interpolation options offered by SPM2.
>>
>> I _haven't_ tried it with SPM5.
>>
>> Hope it is useful.
>>
>> Mark
>>
>> Ged Ridgway wrote:
>>
>>> Hi Siawoosh,
>>>
>>> Good question... there are no options for it, but if you change line
>>> 242 of spm_defs.m:
>>> dat = spm_sample_vol(V,d{:},1);
>>> to have a number other than 1 at the end, you can get different
>>> interpolation schemes. See the help for spm_sample_vol.
>>>
>>> Confusingly, spm_sample_vol seems to offer sinc or polynomial, but
>>>
> not
>
>>> b-spline -- I'm afraid I can't help there; maybe John will explain
>>>
> that.
>
>>> Now I've just noticed you said spm2, and I'm looking at spm5, sorry!
>>> Line 47 of Deformations/spm_applydef_ui.m looks equivalent...
>>> img = spm_sample_vol(VI(i),y1,y2,y3,1);
>>> and the same goes for spm_sample_vol as above.
>>>
>>> Best,
>>> Ged.
>>>
>>>
>>> Siawoosh Mohammadi wrote:
>>>
>>>> hello world,
>>>>
>>>> a question about SPM2:
>>>> within the deformation-toolbox there is the possibility to apply the
>>>> deformation-field.
>>>> is it also possible to write the resulting image with
>>>> bspline-interpolation?
>>>>
>>>> thanks and bye bye
>>>> siawoosh
>>>>
>>>> --
>>>> Siawoosh Mohammadi
>>>>
>>>> Dept. of Neurology
>>>> University of Muenster Phone: +49-251-8352061
>>>> Albert-Schweitzer-Strasse 33 Fax: +49-251-8348181
>>>> 48129 Muenster, Germany E-mail:
>>>>
|