Reply To: Transform the individual label file to standard space

#118
Anand Joshi
Moderator

I am not sure what can be done by putting lesions into common space? If you want to perform measurements of lesions, such as size etc, then you can do that in the original space itself.

If you really have to transform the lesion labels to a common space, then you can do that using the inverse map stored in SVReg directory (subbasename.svreg.inv.map.nii.gz).

You can use matlab with the utility functions available from

http://neuroimage.usc.edu/neuro/Resources/BST_SVReg_Utilities
assuming your subbasename is name of the subject prefix, including path.

e.g. if your subject file is c:\Users\ajoshi\Downloads\sub01\sub01.nii.gz then subbasename would be c:\Users\ajoshi\Downloads\sub01\sub01

and

atlasbasename=C:\Program Files\BrainSuite15b\svreg\BrainSuiteAtlas1\mri

The following matlab code should do the warping.
vmap=load_nii_z(‘subbasename.svreg.inv.map.nii.gz’);
vw=load_nii_z(‘atlasbasename.label.nii.gz’);
vlab=load_nii_z(‘subbasename.label.nii.gz’)

vw.img=interp3(vlab.img,vmap.img(:,:,:,2),vmap.img(:,:,:,1),vmap.img(:,:,:,3),’nearest’);

save_nii(vlab,’warped_labels.nii.gz’);