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  

|
July 03, 2013 10:00AM
Hi Ziad,

I understand you're away - so will be waiting for a reply patiently.
In the meantime:

nick Wrote:
-------------------------------------------------------
> SUMA surfaces in ASCII format take quite a lot of
> disc space, yet at the same time are very easy to
> read and write.

As an alternative I've now tried to use GIFTI files that are considerably smaller.

Generally this works well: the nibabel.gifti python package does a fine job to go from .asc to .gii. Updating the .spec files to read "SurfaceFormat = GIFTI" and "SurfaceType = GIFTI" means that SUMA reads the surfaces happily as well.

Unfortunately the thing that does not work right now is mapping the surface back into the volume. That is, starting afni with '-niml' and then letting suma and afni talk to each other flips the surface in the afni viewer window along the x and y axis. In other words there seems some issue with LPI <-> RAI coordinate conversion. At the same time the coordinates in SUMA are displayed properly - in LPI convention.

[edit: According to the GIFTI specification the coordinates should be in LPI]

I tried a work-around by changing the affine transformation matrix associated with the node coordinates from the identity matrix to a matrix with -1 at positions (0,0) and (1,1). This gave a correct surface overlay in AFNI, however in SUMA the center of gravity is seriously distorted, meaning that rotating the surfaces seems weird and unnatural.

Setting either SurfaceFormat and/or SurfaceType to "FreeSurfer" in the spec file either has no effects or lets SUMA crash.

In SUMA_Voldata.c around line 917 there is a switch statement where coordinates are swapped based on the file type. For Freesurfer, it says:

'case SUMA_FREE_SURFER:
case SUMA_FREE_SURFER_PATCH:
/* For free surfer, all you need to do is
go from LPI to RAI (DICOM)*/'

and then it swaps the x and y coordinates. For GIFTI it says

'case SUMA_GIFTI: /* have to apply coord xform */'

and does nothing there. As above, applying the xform introduces strange changes in the center of gravity.

So my question is: what is the best way to deal with these GIFTI files so that the surface overlay in AFNI works properly and the surface's center of gravity in the SUMA viewer is not messed up?

cheers,
Nick



Edited 1 time(s). Last edit at 07/03/2013 10:08AM by nick.
Subject Author Posted

Feature request: compressed .asc SUMA surface files?

nick July 01, 2013 01:20PM

Re: Feature request: compressed .asc SUMA surface files?

Bob Cox July 01, 2013 09:08PM

Re: Feature request: compressed .asc SUMA surface files?

nick July 03, 2013 10:00AM

Re: Feature request: compressed .asc SUMA surface files?

nick July 26, 2013 11:50AM

Re: Feature request: compressed .asc SUMA surface files?

ziad July 26, 2013 12:42PM

Re: Feature request: compressed .asc SUMA surface files?

nick July 28, 2013 09:02AM

Re: Feature request: compressed .asc SUMA surface files?

ziad July 29, 2013 12:06PM

Re: Feature request: compressed .asc SUMA surface files?

nick July 29, 2013 02:04PM

Re: Feature request: compressed .asc SUMA surface files?

ziad July 30, 2013 04:39PM

Re: Feature request: compressed .asc SUMA surface files?

nick July 31, 2013 08:26AM

Re: Feature request: compressed .asc SUMA surface files?

ziad July 31, 2013 05:38PM

Re:GIFTI surfaces and LPI / RAI coordinates [was: Feature request: compressed .asc SUMA surface files?]

nick August 01, 2013 05:45AM

Re: GIFTI surfaces and LPI / RAI coordinates [resolved]

nick August 07, 2013 08:39AM