Design matrix (.mdm) sample scripts

The following functions illustrates how an multi-study design matrix can be created via scripting:

 

Example 1 (script was included in BrainVoyager QX 1.3)

function CreateMultiStudyDesignMatrix() {

 

var bvqx = Application.BrainVoyagerQX;

var path = "C:/BVQXSampleData/ClockTask/";

doc = bvqx.OpenDocument(path + "BS_TAL.vmr");

doc.ClearMultiStudyGLMDefinition();

doc.AddStudyAndDesignMatrix(path + "BS_run1_r1_pp.vtc", path + "ClockTaskDesignMatrix_run1.rtc");                 doc.AddStudyAndDesignMatrix(path + "BS_run2_l1_pp.vtc", path + "ClockTaskDesignMatrix_run2.rtc");  

doc.AddStudyAndDesignMatrix(path + "ML_run1_r1_pp.vtc", path + "ClockTaskDesignMatrix_run1.rtc");

doc.AddStudyAndDesignMatrix( path + "ML_run2_l2_pp.vtc", path + "ClockTaskDesignMatrix_run2.rtc");

 

doc.SeparationOfSubjectPredictors = true;

doc.ZTransformStudies = true;

doc.SaveMultiStudyGLMDefinitionFile("TWOSUBJECTS_FROMSCRIPT.mdm");

 

// Now compute the GLM

doc.CorrectForSerialCorrelations = false;

doc.ComputeMultiStudyGLM();

doc.ShowGLM();

doc.SaveGLM("TWOSUBJS_FROMSCRIPT.glm");

 

// Test also new RFX GLM

doc.PSCTransformStudies = true;

doc.ComputeRFXGLM();

doc.SaveGLM("RFXGLM_FROMSCRIPT.glm");

}

 

Example 2

 

The entryList() method in the provided example can also be replaced by creating an array: