General Linear Model Specification XML File

This page details the format of files used to specify a General Linear Model (GLM) used in the Dynamic Analysis tool. The GLM specification file is an XML file, with a document type definition of:


<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE GLMSpec [
  <!ELEMENT GLMSpec ((Correlates, HRF?, Confounds?, ContrastVectors?)|(HRF?, Correlates, Confounds?, ContrastVectors?))>
  <!ELEMENT HRF EMPTY>
  <!ATTLIST HRF ResponseDelay CDATA #REQUIRED UndershootDelay CDATA #REQUIRED ResponseDispersion CDATA #REQUIRED UndershootDispersion CDATA #REQUIRED ResponseUndershootRatio CDATA #REQUIRED onsetSeconds CDATA #REQUIRED kernelLengthSeconds CDATA #REQUIRED>
  <!ATTLIST GLMSpec TUnits (TIME | SCAN) #REQUIRED>
  <!ELEMENT Correlates (Correlate*)>
  <!ELEMENT Correlate (Name, T-stats?, (RepeatingBlock | Phase+))>
  <!ELEMENT Name (#PCDATA)>
  <!ELEMENT T-stats EMPTY>
  <!ELEMENT RepeatingBlock EMPTY>
  <!ATTLIST RepeatingBlock RestFirst CDATA #IMPLIED RestDuration CDATA #REQUIRED StimulusDuration CDATA #REQUIRED>
  <!ELEMENT Phase (BlockPhase | FunctionPhase)>
  <!ELEMENT BlockPhase EMPTY>
  <!ATTLIST BlockPhase Onset CDATA #REQUIRED Duration CDATA #REQUIRED>
  <!ELEMENT FunctionPhase EMPTY>
  <!ATTLIST FunctionPhase Onset CDATA #REQUIRED Formula CDATA #REQUIRED>
  <!ELEMENT Confounds (LinearDrift?)>
  <!ELEMENT LinearDrift EMPTY>
  <!ATTLIST Confounds NCycles CDATA #REQUIRED>
  <!ELEMENT ContrastVectors (ContrastVector*)>
  <!ELEMENT ContrastVector (Name)>
  <!ATTLIST ContrastVector Weights CDATA #REQUIRED>
]]>
An example GLM specification file is shown below for a GLM with two correlates, and convolution with a haemodynamic response function. The first correlate ("TaskA") is a repeating off-on block pattern and the second ("TaskB") is consists of four blocks with onsets at scans 13, 49, 88 and 186 and respective durations of 12, 18, 19 and 14 scans. All onsets and durations are measured in scan units (not seconds).

<!--GLMSpec created by Jim on "26 Jan 2014 17:01:54.041 Greenwich Mean Time" by Operator ID "mhfield"-->
<GLMSpec TUnits="SCAN">
<HRF ResponseDelay="6.0" ResponseDispersion="1.0" ResponseUndershootRatio="6.0" UndershootDelay="16.0" UndershootDispersion="1.0" kernelLengthSeconds="32.0" onsetSeconds="0.0"/>
<Correlates>
<Correlate>
<Name>TaskA</Name>
<T-stats/>
<RepeatingBlock RestDuration="8" RestFirst="true" StimulusDuration="8"/>
</Correlate>
<Correlate>
<Name>TaskB</Name>
<T-stats/>
<Phase>
<BlockPhase Duration="12" Onset="13"/>
</Phase>
<Phase>
<BlockPhase Duration="18" Onset="49"/>
</Phase>
<Phase>
<BlockPhase Duration="19" Onset="88"/>
</Phase>
<Phase>
<BlockPhase Duration="14" Onset="186"/>
</Phase>
</Correlate>
</Correlates>
<Confounds NCycles="3">
<LinearDrift/>
</Confounds>
<ContrastVectors/>
</GLMSpec>
Jim Home