This post is mostly intended as a historical marker, although discussion is welcome.
The Brain Imaging Data Structure (BIDS; https://bids-specification.readthedocs.i...) has at least implied support for GIFTI in its derivatives for some time, although specific validatable filenames have been limited to `.label.gii` files until the upcoming 1.11.2 release, which uses `.func.gii` for generic data sampled to the surface. This extension was selected for maximum compatibility with different toolchains.
As BIDS begins supporting more surface data, there is the potential to add language around GIFTI (or, more broadly, other standards) that can conflict with existing implementations and published data, and we would like to avoid this. This upcoming release will include language that describes a consensus subset of GIFTI that will ensure maximum compatibility with existing tools. This is intended to provide guidance for developers of new tools, contributors to the BIDS specification, and in particular developers of tools that write BIDS Derivatives datasets. This is not intended to call for existing toolchains to make their own parsing/emitting more strict or lax.
There was a discussion in https://github.com/bids-standard/bids-specification/issues/2449, and I ran the language we're going to include by representatives of several neuroimaging software pipelines that have taken different approaches to GIFTI support.
The updated text follows, and will be visible at https://bids-specification.readthedocs.io/en/stable/derivatives/introduction.html#gifti-surface-data-format at the next release.
The GIFTI format is an XML-based structure containing one or more data arrays, and is well-suited to describing surface geometry and parcellations.
The following table is derived from Sections 9.0 and 13.0 of the GIFTI specification, mapping two-part extension codes onto the expected data arrays contained within a GIFTI file:
| Extension | # Arrays | NIFTI_TYPE_ |
NIFTI_INTENT_ |
|---|---|---|---|
.surf.gii |
2 | FLOAT32, INT32 |
POINTSET, TRIANGLE |
.label.gii |
≥ 1 | INT32 |
LABEL |
.func.gii |
≥ 1 | FLOAT32 |
NONE or statistical |
.shape.gii |
≥ 1 | FLOAT32 |
SHAPE |
Intent code
enforcement Intent codes for .func.gii and
.shape.gii files are restricted by the GIFTI
specification, but this restriction is widely violated in practice
and any intent code is accepted for these file types.
This table is limited to a widely-implemented subset of GIFTI
file types. Some tools require extensions to match the data types,
as well as the intents for geometry and label files, and do not
permit the unrestricted bare .gii extension. Because
Section 13.2 admits NIFTI_INTENT_NONE ("data intent
not specified") into a functional file, .func.gii
serves as a catch-all extension for floating point data sampled to
a surface. Its use does not imply that the data in the file relate
to functional MRI.
Unless otherwise stated, bare .gii extensions
SHOULD NOT be used for GIFTI files. The remaining Section 9.0
extensions are outside the scope of this specification.
