Hi,

I'm also using R to look at some FreeSurfer data, mostly to play with significance values. To do this, I convert them to ascii (mris_convert) and load them into R with the read.table function. When I am done, I write a new ascii file, mris_convert it back to a *.w or *.sig, and load it into tksurfer. The function to write the file is trivial, but here it is for completeness:

## more FreeSurfer specific stuff.
## the modified significance values in a text file called "fdr.txt"
## posindex is a global variable tracking which pvalues were
##        positive in the original sig file
##        (recall that FS stores sig values as log10(sig), with the
##        sign indicating direction of effect)
## vindex is a global variable tracking the vertex number
##        associated with a given sig value
write.fs.output <- function(){
  fdr <- dget('fdr.txt')     
  fdr <- log10(fdr)
  fdr[posindex] <- fdr[posindex] * -1
  cat("0.000\n", length(fdr), "\n", file="AA-TT_cmfdr.ascii")
  for (i in 1:length(fdr)){
    cat(vindex[i], fdr[i], "\n", sep="\t",
        file="AA-TT_fdr.ascii", append=TRUE)
  }
}


-- 
--------------------------------------
 I'm only in it for the glory .

+   Glenn Lawyer                    +
+   +352 661 967 244                +
+   Instituttgruppe for psykiatri   +
+   Seksjon Vinderen                +
+   PB 85 Vinderen                  +
+   0319 Oslo                       + 
+   http://folk.uio.no/davidgl      +
+++++++++++++++++++++++++++++++++++:)