Hello to everybody,
I made a script to extract some structures from a T1 image. The code extract precentral and paracentral gyrus, putamen, nucleus caudate and accumbens.
First of all convert from annotation to label, after that I used tkregister (maybe this can be the focus of the problem) to get the coordenates of my T1, finally extract areas with mri_label2vol, mri_convert and fslmaths.
I paste the script below:
mri_annotation2label --subject ${suje} --hemi lh --outdir $FREESURFER_HOME/subjects/${suje}/annot_labels/ mri_annotation2label --subject ${suje} --hemi rh --outdir $FREESURFER_HOME/subjects/${suje}/annot_labels/
#despues tenemos q calcular la matriz para pasar de freesurfer a espacio .nii tkregister2 --mov ${pathT1}${t1} --noedit --s ${suje} --regheader --reg ${path}register.dat
cd ${path}
#extraemos aqui precentral i paracentral
mri_label2vol --label $FREESURFER_HOME/subjects/${suje}/annot_labels/lh.precentral.label --reg ${path}register.dat --temp ${pathT1}${t1} --subject ${suje} --hemi lh --o l_precent.nii --proj frac 0 1 .1 --fillthresh 0
mri_label2vol --label $FREESURFER_HOME/subjects/${suje}/annot_labels/rh.precentral.label --reg ${path}register.dat --temp ${pathT1}${t1} --subject ${suje} --hemi rh --o r_precent.nii --proj frac 0 1 .1 --fillthresh 0
mri_label2vol --label $FREESURFER_HOME/subjects/${suje}/annot_labels/lh.paracentral.label --reg ${path}register.dat --temp ${pathT1}${t1} --subject ${suje} --hemi lh --o l_paracent.nii --proj frac 0 1 .1 --fillthresh 0
mri_label2vol --label $FREESURFER_HOME/subjects/${suje}/annot_labels/rh.paracentral.label --reg ${path}register.dat --temp ${pathT1}${t1} --subject ${suje} --hemi rh --o r_paracent.nii --proj frac 0 1 .1 --fillthresh 0
mri_convert -rl $FREESURFER_HOME/subjects/${suje}/mri/rawavg.mgz -rt nearest $FREESURFER_HOME/subjects/${suje}/mri/aseg.mgz ${path}aseg.nii
#we need to know the codes, caudate is 11 y 50;
fslmaths aseg.nii -uthr 11 -thr 11 l_caud.nii fslmaths aseg.nii -uthr 50 -thr 50 r_caud.nii
Thanks Vic