Re: [Freesurfer] Intersection of labels with other labels or volumes

2009-09-09 Thread James Porter
Hi Nick- I've shortened the run time of the script (attached) by comparing the size of the two labels and restricting the search to only those vertices that exist in the smaller label. My logic is that there can't possibly be any more matching vertices than the size of the smaller label, so

Re: [Freesurfer] Intersection of labels with other labels or volumes

2009-08-31 Thread Nick Schmansky
Jim Ok, one more time, attached is another iteration of the labels_intersection and labels_union scripts. These ignore the x,y,z and stats columns, looking only at the vertex numbers. In the case of identical vertices, the x,y,z,stats column data from the first file arg are included in the outpu

Re: [Freesurfer] Intersection of labels with other labels or volumes

2009-08-31 Thread Nick Schmansky
Jim, Thanks for pointing this out. I've attached fixed scripts, where I think the problem was actually in the grep command in use. It still doesnt handle ignoring the 5th (stats) column. Thats something I'll have to think about. Nick On Sun, 2009-08-30 at 19:37 -0500, James Porter wrote: > F

Re: [Freesurfer] Intersection of labels with other labels or volumes

2009-08-30 Thread James Porter
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'

Re: [Freesurfer] Intersection of labels with other labels or volumes

2009-08-28 Thread Nick Schmansky
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 f

[Freesurfer] Intersection of labels with other labels or volumes

2009-08-27 Thread James Porter
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