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.