Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

GIfTI - a MATLAB GIfTI Library (v1.8)

This MATLAB class allows to handle GIfTI Geometry file format from the Neuroimaging Informatics Technology Initiative.

It relies on external libraries:

Note that these tools are already included in the GIfTI library provided here, so you don't need to install them separately.

This library is also part of SPM:


MATLAB 7.1 (R14SP3) or above is required to use most of the features of this toolbox.

This library takes advantage of MATLAB Object-Oriented facilities and all the code is embedded in a @gifti class. To install it, all you need is to make sure that the directory containing @gifti is in MATLAB path:

  addpath /home/login/Documents/MATLAB/gifti

The handling of gzipped data requires a C-MEX file to be compiled, see @gifti/private/zstream.c. A Java alternative will be used otherwise, in which case MATLAB should not be started with the '-nojvm' option


In the following, we use the files contained in BV_GIFTI.tar.gz (BrainVISA examples), available from the NITRC website:

   % Read the GIfTI surface file
   g = gifti('')
   % Read the GIfTI shape file
   gg = gifti('sujet01_Lwhite.shape.gii')
   % Display mesh
   figure; plot(g);
   % Display mesh with curvature
   figure; plot(g,gg);

In a similar way, a gifti object can be created from scratch and save to a file:

  load mri
  D = squeeze(D);
  Ds = smooth3(D);
  g = gifti(isosurface(Ds,5))
  h = plot(g);
  daspect([1,1,.4]); view(45,30); axis tight

MATLAB is a Registered Trademark of The Mathworks, Inc.

Copyright (C) 2008-2018 Guillaume Flandin