How to use Object files

Object Files at the BIC are usually represented with the .obj suffix.

What is the format of these .obj files?

A 10 page pdf document by Robert D. Vincent, describing the mni .obj format can be found at http://www.bic.mni.mcgill.ca/users/mishkin/mni_obj_format.pdf

The .obj format is a simple format David MacDonald devised to store polygons, lines, and text. It has both an ascii and binary format. The ascii format for the polygon and lines objects are described in the links below. The polygon object format seems to be the default way to go at the BIC as far as I have seen.

polygon format (http://www.bic.mni.mcgill.ca/users/david/FAQ/polygons_format.txt)

The .obj file of polygon format has the following:

Vertex header 
Vertex coordinates 
Vertex normals 
Polygon header 
Vertex/triangle colours 
Polygon indices (defines the start of each polygon in the vertex indices below) Vertex indices (defines each polygon)

lines format (http://www.bic.mni.mcgill.ca/users/david/FAQ/lines_format.txt)

How to I convert .obj to ascii/binary?

The following commands will convert a file to ascii, binary, or change to the opposite, respectively:

ascii_binary input.obj output.obj ascii  
ascii_binary input.obj output.obj binary 
ascii_binary input.obj output.obj

Freesurfer surfaces and the mni .obj format

The freesurfer ascii format only provides the vertex coordinates and the vertex indices so to construct a .obj file, the rest must be generated. If you are working with triangles only (as the surface output of freesurfer), you may use a conversion program (parse.bin) created by Simon Fristed Eskildsen located at http://www.hst.aau.dk/~~se/software/parse.bin or 64bit (http://www.hst.aau.dk/~~se/software/parse.bin64). Using the freesurfer mris_convert program and the the freesurfer surface files, this should work:

mris_convert lh.white lh.white.asc 
parse.bin lh.white.asc lh.white.obj