Dear Aser,
you can use the script below:
%% image space definition
% either with an image
imgref = 'beta_0001.nii';
V = spm_vol(imgref);
DIM = V.dim;
M = V.mat;
% or with relevant information
DIM = [53 63 46];
M = [-3 0 0 81;0 3 0 -115;0 0 3 -53;0 0 0 1];
xY.def = 'sphere';
xY.xyz = [-33 -19 55]';
xY.spec = 8;
V = struct(...
'fname', 'ROI_sphere.nii',...
'dim', DIM,...
'dt', [spm_type('uint8') spm_platform('bigend')],...
'mat', M,...
'pinfo', [1 0 0]',...
'descrip', 'ROI');
V = spm_create_vol(V);
ROI = false(DIM);
[~,~,k] = spm_ROI(xY,V);
ROI(k) = true;
V = spm_write_vol(V,ROI);
Best regards,
Guillaume.
On 24/04/15 15:03, fMRI wrote:
> Hi all,
>
> Using SPM, how can a create a ROI with sphere of 8 or 16 mm using a defined coordinate, say -33 -19 55?
>
> Thanks
>
>
> Aser
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|