AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
December 08, 2009 11:31AM
Hi Ziad,

ziad wrote:

> 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.

I had a look at afni_nel_parse.m and ToyTalk.m (pretty cool btw), but these also seem to require ASCII NIML format. You say that's a hack, i.e. the ASCII format is not official and may change in the future?

In any case, I could not find anything about encoding in [1]; is there more documentation available?

> 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.

A lot of work for me, probably, as I'm quite good in reading C but not very good in writing it. So writing something entirely in matlab may be easier for me.

> 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.

Had a look at the specification, nice work. Seems like a pretty cool format spec to me.

For future work, I have two different aims.

1) easier visualization and better organized data storage of surface analysis results. Currently I have tables with z and t scores hanging on the wall of my office which is not exactly using all of the potential computational power under my desk. Furthermore with a large number of result columns (frames) it becomes easy to confuse different analyses. So for this reason I'm looking for a better way of data storage than 'dumb' than .1D files

2) development of a matlab toolbox for surface analyses that preferably supports a general data format. I'm collaborating with a few people who use SPM / caret, and currently the toolbox supports suma ascii surface and .1D data files well, while nifti and caret require some dirty hacks. We would like to write something that is more general than that.

It seems that for (1), a niml I/O would be best. For (2), gifti seems more appropriate. Does that make sense?

In addition, what does NIML mean for using AFNI/SUMA programs? A lot of the 3d* programs support .1D but not NIML, right? In other words, what do I lose in terms of AFNI application support if I would store data in NIML?

> GIFTI will be supported by a decent number of
> surface-based software (Caret, BrainVoyager, FreeSurfer,
> BrainVisa, AFNI/SUMA etc.).

"*will* be supported" - what's the current status? As far as I know AFNI/SUMA do not support gifti, is that correct? Are there any plans for, say, gifti - niml conversion support?

> 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]

Yes, that looks like fine code to me, and as far as I understand the gifti format from the specification, adding support for data files would require adding support for certain headers right?

With respect to the previous goals, do you think it would be hard to write a gifti to niml conversion tool? Then I could do analyses with gifti files but view the results in niml.

Well, I have to remind myself that my PhD is in cognitive neuroscience and not in computer science.... seems there is still a lot to implement.

> As you probably know, I will be at Princeton Jan. 27 until Jan.
> 29. If you like we can discuss this at length there.

Thanks, but unfortunately I don't work in princeton anymore; I've started a PhD in Bangor in north Wales (UK), you know, where it rains so much. Yes, I would like to discuss a few things, but I'm afraid it will have to be over the internet. In any case, I hope you have a good time during your princeton visit.

Thanks a lot for your comments, and I look forward to hearing your thoughts.

best,
Nick

[1] [afni.nimh.nih.gov]
Subject Author Posted

Reading and writing niml files in matlab?

Nick December 07, 2009 02:06PM

Re: Reading and writing niml files in matlab?

ziad December 07, 2009 04:29PM

Re: Reading and writing niml files in matlab?

Nick December 08, 2009 11:31AM

Re: Reading and writing niml files in matlab?

ziad December 09, 2009 05:33PM

Re: Reading and writing niml files in matlab?

Nick December 10, 2009 07:48PM

Re: Reading and writing niml files in matlab?

ziad December 11, 2009 08:50AM

Re: Reading and writing niml files in matlab?

Nick December 11, 2009 09:56AM

experimental support for reading and writing niml files

Nick December 14, 2009 05:14PM

experimental support for reading and writing niml files in matlab toolbox

Nick January 05, 2010 11:13AM