Hi Donna,
the script is quite helpful, thanks! There's one glitch though: caret_command's averaging of the two .coord's doesn't work, even though they are both text. The command completes without an error message, but the contents of the MIDTHICKNESS output file are illegible, the usual Caret header is missing. Consequently, segmentation volumes are not generated. I can average the surfaces in Caret, convert them to text and then create a segmentation volume (although it looks pretty ugly, see attached). So it seems the problem is with caret_command - maybe trying (and failing) to write out a binary file, even though the input is text?

Johannes

Donna Hanlon schrieb:
Hi caret-users,

This script may be helpful to those who import Freesurfer surfaces into Caret for various purposes.
http://brainmap.wustl.edu/pub/donna/SCRIPTS/FREESURFER/freesurfer2caret.sh
login pub
password download

It does the following:

* calls mris_convert to convert the Freesurfer binary surfaces to ASCII
* converts the Freesurfer ASCII surfaces to Caret coord/topo files
* averages the pial and smoothwm surfaces to generate a midthickness coord
* creates a spec file with the hem_flag as left or right
* generates the sulcal depth and geography paint file from the midthickness surface

Run this script in a 'subjects' directory where there is a subdirectory for each case/subject. This script assumes there is a surf subdirectory under each case subdirectory, e.g.:

./ED/surf
./EF/surf
./EG/surf
./FH/surf
./FK/surf
./FL/surf
./FM/surf
./FN/surf

Then, change this line in the script to reflect your actual case/subject subdirectory names:

CASES="ED EF EG FH FK FL FM FN"

If you have additional layers between the case subdirectory and your Freesurfer surf subdirectory, then you'll need to tweak these lines accordingly:

 cd $CASE/surf
 ...
 cd ../..

Disclaimers:

1. The origin setting in the caret_command -volume-create step reflects my best current understanding of where the Freesurfer origin actually is. Help in clarifying this issue is most welcome. The bottom line is that the depth measures will be accurate regardless of the actual origin input here, because the segmentation and derivative hull volume will be generated from the same origin, so the resulting distance between the fiducial and hull surfaces will not be affected by the actual origin setting; however, someone might try to align these derivative volumes with an actual anatomical generated from the COR-* slices and midthickness fiducial surface. There may be slight offset issues, although the alignment looks good to me. More importantly, it would be nice to add a Freesurfer atlas space for the -volume-create and paint/metric-to-volume features.

2. I confess I haven't tested it as thoroughly as I'd like to.

Apologies: Sorry I didn't get this up sooner; my daughter was sick yesterday.

Donna
_______________________________________________
caret-users mailing list
caret-users@brainvis.wustl.edu
http://pulvinar.wustl.edu/mailman/listinfo/caret-users


<<inline: segvol.png>>

Reply via email to