FYI, Nick-

It may be something to do with the 'comm' program on Mac OS X (assuming 
that you wrote the scripts on a UNIX machine), but the labels_intersect 
file doesn't quite work properly. However, I do get correct intersection 
results from the labels_union script by simply switching 'uniq -u' to 
'uniq -d' and leaving everything else the same. Below you can see that 
there are identical lines in the two files, 'comm' doesn't find them, 
and 'uniq -d' does find them.


$ grep 42796 TEST.zero.label
42796  -22.144  -40.241  27.868 0.000000
142796  -4.945  52.116  -14.802 0.000000

$ grep 42796 aparc_labels/lh.postcentral.label
42796  -22.144  -40.241  27.868 0.00000

$ labels_intersect TEST.zero.label lh.postcentral.label Int.label

$ head Int.label
#!ascii label  , from subject 17682 vox2ras=TkReg
0

$ labels_intersect_jim TEST.zero.label lh.postcentral.label JimInt.label

$ head JimInt.label
#!ascii label  , from subject 17682 vox2ras=TkReg
1175
42796  -22.144  -40.241  27.868 0.000000
43946  -22.166  -39.570  28.120 0.000000
43953  -22.313  -39.961  27.481 0.000000
45154  -21.927  -37.868  29.306 0.000000
45167  -22.067  -38.462  27.645 0.000000
45168  -22.290  -38.809  28.096 0.000000
45173  -21.669  -38.528  26.871 0.000000
45174  -22.199  -39.236  27.196 0.000000

Also of note, if the 5th stats column in the label files are different, 
no union or intersection is correctly found. The labels generated by 
mri_surfcluster have the cluster pval from the monte carlo simulations 
in the 5th column, but the labels generated by mri_annotation2label just 
have zeros. It's easy enough to fix with sed, though.

Thanks for the help!

---------
Jim Porter
Graduate Student
Clinical Science & Psychopathology Research
University of Minnesota

Nick Schmansky wrote:
> Jim,
> 
> Attached are two scripts for getting the union or intersect of two label
> files.
> 
> Nick
> 
> On Thu, 2009-08-27 at 20:32 -0500, James Porter wrote:
>> Hello-
>>
>> Is there a simple way to obtain the intersection of two labels, output
>> into a third label? Or the intersection of a label and an .mgh file 
>> output by mri_surfcluster?
>>
>> For instance, I have a cluster defined by mri_glmfit/mri_surfcluster 
>> that spans multiple anatomical regions, and I want to investigate the
>> values from subsections of the cluster. That is to say, I want to run 
>> mris_anatomical_stats on only the section of my cluster that covers, 
>> say, precentral cortex but not caudal middle frontal or pars opercularis.
>>
>> I've tried several strategies without success. The most promising seemed 
>> to be just having mri_surfcluster output an aparc file, and then pass 
>> that aparc file into mris_anatomical_stats. However, that aparc just 
>> puts the very first region definition to every vertex. The same happens 
>> if I run mri_label2aparc on the labels output by mri_surfcluster. This 
>> happens no matter which LUT or ctab I use, i.e., with aparc.annot.ctab 
>> the whole volume gets labeled "bankssts" and with FreeSurferColorLUT.txt 
>> every vertex in the cluster volume gets labeled "Left-Cerebral-Exterior."
>>
>> I guess there are a few issues in this email, but the most important one 
>> to me is being able to run mris_anatomical_stats on the union of a 
>> cluster file and the individual regions from the standard aparc atlas.
>>
>> Any suggestions?
>>
>> Thanks in advance,
>> ---------
>> Jim Porter
>> Graduate Student
>> Clinical Science & Psychopathology Research
>> University of Minnesota
>>
>> _______________________________________________
>> Freesurfer mailing list
>> Freesurfer@nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>>
>>
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Reply via email to