Hi Nick,
You are correct, 1D is no good for header info preservation. To preserve header information, NIML is the way to go. But unfortunately there is no matlab API for it. Parsing a niml element is relatively simple, look at function afni_nel_parse.m for an example. Also, one could as you suggest relatively easily write ASCII NIML format but it would be a hack and if the library changes your matlab version might break. The best way would be to write a MATLAB API that uses AFNI's minl C-library directly. But I am not sure how much work that would be.
The advantage of a NIML API is that you can use it to communicate with AFNI and SUMA. That is why afni_nel_parse was written; to communicate with SUMA. But if all you want is I/O, then perhaps you should use GIFTI ( [
www.nitrc.org] ). THe surface-based NIFTI equivalent. GIFTI will be supported by a decent number of surface-based software (Caret, BrainVoyager, FreeSurfer, BrainVisa, AFNI/SUMA etc.).
Guillaume Flandin has generously written a matlab API for I/O of geometry (surfaces) files. Perhaps your effort would be most fruitful in expanding it to deal with data on the surfaces. This expansion should be relatively simple, as the mechanisms for parsing and encoding are already there. I suspect this route would be best for everyone.
[
www.artefact.tk]
As you probably know, I will be at Princeton Jan. 27 until Jan. 29. If you like we can discuss this at length there.
cheers,
ziad