Codebase list ciftilib / debian/1.5.1-1 USAGE
debian/1.5.1-1

Tree @debian/1.5.1-1 (Download .tar.gz)

USAGE @debian/1.5.1-1raw · history · blame

The main object for dealing with Cifti is CiftiFile.  To set up a new CiftiFile,
make a CiftiXML object with the mappings you want, and call setCiftiXML on the CiftiFile object.

The XML tells you things about the mappings, and lets you set new mappings or modify existing ones:

int64_t rowLength = myXML.getDimensionLength(CiftiXML::ALONG_ROW);
CiftiMappingType::MappingType rowType = myXML.getMappingType(CiftiXML::ALONG_ROW);
if (rowType == CiftiMappingType::SCALARS)
{
    CiftiScalarsMap& myScalarMap = myXML.getScalarsMap(CiftiXML::ALONG_ROW);
    QString firstMapName = myScalarMap.getMapName(0);
    ...
    myScalarMap.setLength(1);
}

See the rewrite example for how to read and write data to CiftiFile.

CiftiFile internally uses NiftiIO, which is a NIfTI reader for both NIfTI-1 and NIfTI-2 single-file (.nii),
including reading .nii.gz files if zlib is found (NOTE: .nii.gz should not be used for CIFTI files,
as seeking is slow, and seeking backwards is impossible).

Our nifti1.h and nifti2.h are slightly modified, replacing the #defines of standard values for header fields
with constant integers.  We also declare CIFTI-specific intent codes and the extension code in nifti2.h,
and have some macros for determining header version.