Hi Kirstie,Thank you very much for the suggestions!I modified my snippet to prevent it from looping the same value and still got the same results?######input=($(cat ./names_68parc.txt))labels=()hemis=()j=0for i in "${input[@]}"; doif [[ $i == lh_* ]]; thenhemis[j]="lh"i=$(echo $i | sed 's/^lh_//g')labels[j]="$i"(( j++ ))elif [[ $i == rh_* ]]; thenhemis[j]="rh"i=$(echo $i | sed 's/^rh_//g')labels[j]="$i"(( j++ ))fidonenlabel=68if [[ ${#labels[@]} != $nlabel ]] && [[ ${#hemi[@]} != $nlabel ]]; thenecho " number of label not match "fifor hemi in lh rh; domri_annotation2label --subject fsaverage --hemi ${hemi} --outdir ./labelsdonefor ((i=0;i<${#labels[@]};i++)); domri_surfcluster --in /usr/local/freesurfer_orig/subjects/fsaverage/surf/${ hemis[i]}.thickness --clabel ./labels/${hemis[i]}.${labels[ i]}.label --sum ./labels/sum.${hemis[i]}.${ labels[i]} --centroid --thmin 0 --hemi ${hemis[i]} --subject fsaverage tail -1 ./labels/sum.${hemis[i]}.${labels[i]} | sed 's/ */ /g' | cut -d' ' -f6-8 >> ./labels/68parc.centroids.txt done######The output message of mri_surfcluster:######thsign = abs, id = 0version $Id: mri_surfcluster.c,v 1.57.2.3 2016/11/17 18:19:42 zkaufman Exp $hemi = rhsrcid = /usr/local/freesurfer_orig/subjects/fsaverage/surf/rh. thickness srcsubjid = fsaveragesrcsurf = whitesrcframe = 0thsign = absthmin = 0thmax = -1fdr = -1minarea = 0xfmfile = talairach.xfmclabelfile = ./labels/rh.lateraloccipital.label clabelinv = 0nth = -1sumfile = ./labels/sum.rh.lateraloccipital subjectsdir = /usr/local/freesurfer_orig/subjects FixMNI = 1Loading clabel ./labels/rh.lateraloccipital.label. Found 5963 points in clabel.------------- XFM matrix (RAS2RAS) ---------------/usr/local/freesurfer_orig/subjects/fsaverage/mri/ transforms/talairach.xfm 1.00000 0.00000 0.00000 0.00000;0.00000 1.00000 0.00000 0.00000;0.00000 0.00000 1.00000 0.00000;0.00000 0.00000 0.00000 1.00000;---------------------------------------------------- Reading source surface /usr/local/freesurfer_orig/subjects/fsaverage/surf/rh. white Done reading source surfaceComputing metric propertiesLoading source valuesnumber of voxels in search space = 5963Done loading source values (nvtxs = 163842)overall max = 3.19752 at vertex 122846overall min = 0 at vertex 0surface nvertices 163842metric props tot surface area 65020.839844group_avg_vtxarea_loaded 1masked surface area 4459.747559NOT Adjusting threshold for 1-tailed testthminadj = 0Searching for Clusters ...thmin=0.000000 (0.000000), thmax=-1.000000 (-1), thsignid=0, minarea=0.000000Found 1 clustersMax cluster size 82167.000000INFO: fixing MNI talairach coordinatesOn Wed, Feb 21, 2018 at 3:15 PM, Kirstie Whitaker <kw401@cam.ac.uk> wrote:Hi Foucault,In the snippet you added you don’t define the labels variable (which you subsequently loop over in for label in ${labels}).There are two possible mistakes that are easy to fix. One may be that you forgot to read in the labels! And the other is that to get all the values in an array you need ${labels[@]}.I don’t think you need greater precision than you have. The regions are pretty far apart in mm terms :)KirstieSent from my iPhone, please excuse any typos or excessive brevityDear Freesurfer experts,Based on this https://mail.nmr.mgh.harvard.edu/pipermail//freesurfer/ , I wrote a short script to extract the centroids from Desikan-Killian2013-September/033337.html y atlas. ######for hemi in lh rh; domri_annotation2label --subject fsaverage --hemi ${hemi} --outdir ./labelsfor label in ${labels}; domri_surfcluster --in /usr/local/freesurfer/subjects/fsaverage/surf/${hemi}. thickness --clabel ./labels/${label}.label --sum ./labels/sum.${label} --centroid --thmin 0 --hemi ${hemi} --subject fsaverage tail -1 ./labels/sum.${label} | sed 's/ */ /g' | cut -d' ' -f6-8 >> ./labels/68parc.centroids.txtdonedone#######However, 1) the value is not precise enough, it is only one digit after decimal point. And 2) I kept getting the same value for each hemisphere.Eg,.29.8 -20.7 18.029.8 -20.7 18.029.8 -20.7 18.029.8 -20.7 18.029.8 -20.7 18.029.8 -20.7 18.029.8 -20.7 18.0I would appreciate if you have any suggestions regarding extracting centroids and the aforementioned issues!Thank you for your time!Best,Foucault_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.