Hi Marko,
I think this is possible with spm_conv. What you need to do is something
like
V=spm_vol(spm_get);
v=spm_read_vols(V);
v2=spm_conv(v,2);
Mind you, this convolves with a kernel of 2 voxels, not mm. If your
voxel size is [2 3 4] and you want to smooth with 5 mm^3, then you
should put
v2=spm_conv(v,[5/2 5/3 5/4]);
Hope that does the trick,
Alle Meije
Marko Wilke wrote:
> Dear All,
> I would like to run some analyses for which it would be very handy to
> smooth image volumes in memory. In other words, I do not want to smooth
> the images and load them but load them and smooth them without writing
> them to disk. I have looked into spm_smooth_ui but it calls spm_conv_vol
> which is a compiled function.
>
> Has anyone done this before and could guide me into the right direction?
> I know matlab comes with convn but I am not sure how to specify the
> Gaussian filter I would be interested in...
>
> Thanks,
> Marko
|