Print

Print


Hi everyone,

I have a rather simple question I would like to get help with. I have a
spherical ROI in nii format. First, I get the coordinates for all the
voxels within the ROI:

Y = spm_read_vols(spm_vol(roi),1);
indx = find(Y>0);
[x,y,z] = ind2sub(size(Y),indx);
roi_coord=[x y z]';

Let's say here the roi_coord ends up being 3x20 double, meaning there are
20 voxels

I then use spm_get_data to get the intensity value for each voxel at each
time point. After that I identify outlier voxels based on some arbitrary
criteria and remove these voxels from the roi_coord. The new set of
coordinates new_roi_coord is 3x15 double (assuming that 5 voxels have been
removed). Could anyone tell me how to transform this set of coordinates
back into a mask/ROI?

Many thanks!

Thang Le