How to get the coordinates of centre of mass for each ROI

Dear all,

I downloaded the Harvard-Oxford atlas (ho_labels.csv and ho_roi_atlas.nii). These two files can be downloaded from http://preprocessed-connectomes-project.org/abide/Pipelines.html, where youu can find "The subcortical and cortical ROIs were combined and then fractionated into functional resolution using nearest-neighbor interpolation. [Atlas][Labels]". Through load_nii('ho_mask_pad.nii'), I can get the index of voxel in each ROI. Fox example, I use the following code to get the index of the ROI labeled 10

load_nii('ho_mask_pad.nii');

tmpt=ans.img;

idx = find(tmpt ==10);

[x,y,z] = ind2sub([65,77,63],idx);

X=mean(x)

Y=mean(y)

Z=mean(z)

The result is (X,Y,Z)=(29.7, 38.5, 27.6). But in the ho_labels.csv, ROI 10 is “Left Thalamus”. The position of (29.7, 38.5, 27.6) does not correspond to “Left Thalamus”.

Would you please give me some suggestions? Thank you.

Best

Erick

AttachmentSize
Binary Data ho_roi_atlas.nii.gz12.27 KB