Hi Riccardo,
if you want to create a mask image of the size of your EPI data you can
do the following:
Vepi=spm_vol(spm_select); % select one your EPI data files
mask_data=zeros(Vepi.dim); % create new data volume for mask
% calculate voxel coordinates
ROIpos=round(Vepi.mat\[roi.xY.XYZmm; ones(1,size(roi.xY.XYZmm,2))]);
% set mask voxels
for p=1:size(ROIpos,2)
mask_data(ROIpos(1,p),ROIpos(2,p),ROIpos(3,p))=1;
end
% create nii file
Vmask=Vepi;
Vmask.fname='VOI_rV6_sum-LH.nii';
Vmask=spm_write_vol(Vmask,mask_data);
(it works for 3x3x3 voxels)
Michael
Am 22.02.2013 16:24, schrieb Riccardo Navarra:
> Thank you for answer... By loading .mat files I get as below:
>
> roi=load('VOI_rV6_sum-LH.mat');
>>> roi.xY
> ans =
>
> def: 'cluster'
> xyz: [3x1 double]
> spec: [4x4 double]
> XYZmm: [3x4608 double]
> w: [1x4608 uint8]
> name: 'sum_V6_LH'
>
> ...I'll be looking for spm_vol and others.
>
> Riccardo
>
--
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Dr. Michael Erb
Department of Biomedical Magnetic Resonance
University of Tübingen
Hoppe-Seyler-Str. 3
72076 Tübingen, Germany
Tel.: +49(0)7071/2987753 priv. +49(0)7071/61559
Fax.: +49(0)7071/294371
e-mail: <[log in to unmask]>
www:
http://www.medizin.uni-tuebingen.de/Forschung/Kliniken/Radiologie/Biomedizinische+Magnetresonanz.html
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|