Brain Innovation

support portal

Navigation

BrainVoyager Automation & Development File Formats The format of GLM files (v1-3)

The format of GLM files (v1-3)

A GLM file contains the result of a multiple regression analysis, either performed on a single or across multiple runs (of multiple subjects). In the most simple case, a GLM is based on the functional data (time course data) of one experimental run in slice space (FMR project), transformed 3D space (VMR/VTC project), or from a mesh (SRF/MTC). The binary file contains a variable-length header followed by the actual stack of 3D mapped data.

For version 4, please see Developer Guide - The Format Of GLM Files (v4).

Fileformat (version 1-3)

 C-style header
 fieldname

Datatype Bytes Sample/default value Description
versionNr short int 2 0x0003 File version (1, 2, or 3)
projectType unsigned char 1 0x0001 Project type, 0x0: FMR-GLM, 0x1: VTC-GLM, 0x2: MTC-GLM
projectTypeRFX unsigned char 1 0x0001 Is GLM a RFX-GLM (only present for Fileversion > 2)
nrOfSubjects long int 4 0x0000000a Number of subjects (only present if projectTypeRFX > 0)
nrOfSubjectPredictors long int 4 0x00000004 Number of predictors per subject (only present if projectTypeRFX > 0)
nrOfTimePoints long int 4 0x000000fa Number of time points (overall number, all runs)
nrOfPredictors long int 4 0x00000004 Number of predictors (one map per predictor is stored)
nrOfStudies long int 4 0x00000001 Number of studies (overall number of analyzed runs)
sepFlag unsigned char 1 0x00 Separate predictors for 0x0: none, 0x1: each study, 0x2: each subject
zFlag unsigned char 1 0x00 Time course z-Transform flag, 0x0: untransformed, 0x1: z-transformed, 0x3: percent-transformed
resolution short int 2 0x0003 Voxel resolution in mm
From here, the file format differs for versions!
Fields in File version 1:    
XStart short int 2 0x0039 XStart position
XEnd short int 2 0x00e7 XEnd position
YStart short int 2 0x0034 YStart position
YEnd short int 2 0x00ac YEnd position
ZStart short int 2 0x003b ZStart position
ZEnd short int 2 0x00c5 ZEnd position
Fields in File version 2/3:    
sercorFlag unsigned char 1 0x0000 Serial correlation flag, 0x0: not performed, 0x1: performed
meanAR1Pre float 4 0xc0000000 Mean auto regression lag1 without correction (-2.0, not used)
meanAR1Post float 4 0xc0000000 Mean auto regression lag1 after correction (-2.0, not used)
From here, the file format differs for Project type (File version 2/3)!
Fields in files for FMR-GLM (Type 0):  
NrOfColumns short int 2 0x0040 X resolution, number of columns
NrOfRows short int 2 0x0040 Y resolution, number of rows
NrOfSlices short int 2 0x001b Z resolution, number of slices
Fields in files for File version 2/3, VTC-GLM (Type 1):
XStart short int 2 0x0039 XStart position
XEnd short int 2 0x00e7 XEnd position
YStart short int 2 0x0034 YStart position
YEnd short int 2 0x00ac YEnd position
ZStart short int 2 0x003b ZStart position
ZEnd short int 2 0x00c5 ZEnd position
Fields in files for File version 2/3, MTC-GLM (Type 2):
nrVertices long int 4 0x0000a002 Number of vertices in mesh (40962 for standard spheres)
Further fields for File version 2/3, all Types:
cbsFlag unsigned char 1 0x00 Cortex based statistics used, 0x0: no, 0x1: yes
nrOfVoxelsBonfCorr long int 4 0xffffffff Number of voxels for Bonferroni correction (-1: disabled)
cortexBasedFile char[] 1+N '\0' Name of cortex based stastics mask file (default: empty)
Remaining fields for all File versions again:
Begin of loop 1:Number of studies  
nrOfTimePoints long int 4 0x000000fa Number of time points for this MTC
analyzedFilename char[] 1+N '\0' Filename of file analyzed
ssmFilename char[] 1+N '\0' Filename of SSM file (only for Project Type MTC=2)
rtcFilename char[] 1+N '\0' Filename of RTC file
End of loop 1:Number of studies  
Begin of loop 1:Number of predictors  
predictorName1 char[] 1+N '\0' Internal name of predictor
predictorName2 char[] 1+N '\0' User specified name of predictor
predictorColorCodes unsigned char 4*3     RGB color coding
End of loop 1:Number of predictors  
From here, the file format differs, for non-RFX GLM's:
designMatrix float32 4*t*p   Design matrix (t = Number of time points, p = Number of predictors)
iXX float32 4*p*p   Pseudo inverse of XX (only present in File versions > 1)
multipleRegrR float32 4*d   Multiple regression R values (d = Number of voxels/vertices)
mCorrSS float32 4*d   Sum of Squares
BetaMaps float32 4*d*p   Beta maps
XY float32 4*d*p   Fitted data after regression (only present in File versions > 1)
timeCourseMean float32 4*d   Time course mean (only present in File versions > 1)
arLag1 float32 4*d   Auto-regression Lag value (only if SerialCorrelation > 0)
From here, fields are for RFX GLM's:  
rfxGlobalMap float32 4*d 1 ... Currently unused map
Begin of loop 1:Number of subjects  
Begin of loop 1:Number of subject predictors
subjectPredictorMap float32 4*d 1 ... Beta maps for unique subject/predictor combinations
End of loop 1:Number of subject predictors
End of loop 1:Number of subjects  

 

You are here: HomeBrainVoyagerAutomation & DevelopmentFile Formats ≫ The format of GLM files (v1-3)