Happy new year to all of you!
Another update for those interested: Ziad had a look at the functions I implemented earlier and they seem to work on the datasets he tested it on. Ziad has kindly incorporated the functions in the afni matlab toolbox.
The new functions are:
- afni_niml_read: reads a niml file. Also some support for non-niml files (gifti, 1D) by calling ConvertDset from matlab.
- afni_niml_parse: the parsing function that converts a niml string to a struct.
- afni_niml_print: the opposite of afni_niml_parse; converts a struct into a niml string
- afni_niml_write: saves a niml struct to a file
Limitations:
- functions are still experimental.
- there are few checks for data consistency. For example, it is entirely possibly to create a struct with data that will be saved without errors to niml format, but for which suma will complain.
- there are no easy accessor functions for quick access to certain data elements. The structs that represent the niml data consist of a tree with structs, and finding a certain data set (e.g. a time course) in the niml file requires walking through the tree.
Time allowing I will try to work further on this, and maybe have a go at implementing gifti support directly (i.e. without ConvertDset).
Please contact me if you have any comments, questions, or suggestions, or if you find bugs.
best,
Nick