DiedrichsenLab / cerebellar_atlases

27 stars 11 forks source link

How can i use the DN from this template to serve as a ROI in Fsl #4

Closed Zhongyuke closed 3 years ago

Zhongyuke commented 3 years ago

hello ,dear professor: I use SUIT toolbox to transform the cerebellar atlas into individual T1 image, but a problem is I changed the orientation of the t1 image thus cause The T1 image is not coordinate with the DTI image, and if I transform the orientation of the DTI image, the .bvecs of which will incoordinate. is there a way to solve this problem. i saw the lobules can be normalized into MNI space and there is no that if deep nuclei ? I'm a rookie, i'm sorry if my statement is confusing truely thanks !

i change the orientation of the T1 image use this: function auto_reorient(p) if ~nargin [p,sts] = spm_select(Inf,'image'); if ~sts, return; end end p = cellstr(p); vg = spm_vol(fullfile(spm('Dir'),'canonical','avg152T1.nii')); tmp = [tempname '.nii']; for i=1:numel(p) spm_smooth(p{i},tmp,[12 12 12]); vf = spm_vol(tmp); M = spm_affreg(vg,vf,struct('regtype','rigid')); [u,s,v] = svd(M(1:3,1:3)); M(1:3,1:3) = uv'; N = nifti(p{i}); N.mat = MN.mat; create(N); end spm_unlink(tmp); voxsiz = [1 1 1]; % new voxel size {mm} V = spm_select([1 Inf],'image'); V = spm_vol(V); for i=1:numel(V) bb = spm_get_bbox(V(i)); VV(1:2) = V(i); VV(1).mat = spm_matrix([bb(1,:) 0 0 0 voxsiz])*spm_matrix([-1 -1 -1]); VV(1).dim = ceil(VV(1).mat \ [bb(2,:) 1]' - 0.1)'; VV(1).dim = VV(1).dim(1:3); spm_reslice(VV,struct('mean',false,'which',1,'interp',0)); % 1 for linear end this is from :https://en.wikibooks.org/wiki/SPM/Howto#How_to_automatically_reorient_images?)

truely thanks again

jdiedrichsen commented 3 years ago

Once you have aligned (not resliced) your DTI image to the individual T1,
you should be able to use spm_reslice very simply to reslice from your T1 into DTI space. VV(1) = spm_vol('dti_image.nii') VV(2) = spm_vol() spm_reslice(VV)

If you still have problems, have a careful look at the SPM help archive: https://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=spm;9196f5f5.1006 and post further questions there.