Create VDW in native space

To create a registered diffusion weighted file (*.vdw) in VMR or native space, the function CreateVDWInVMRSpace() can be used. The function CreateVDWInVMRSpace() requires 7 parameters. For a description of the parameters, see the Create VDW Overview.

 

 

Example

The function below can be pasted in an existing or new script (*.qs) in the BrainVoyager QX Script Module.

After the script project has been saved, the function can be run from the BrainVoyager QX 'Scripts...' menu or via the 'Defined functions' menu in the Script Module.

The script below runs using input from users via dialog boxes. Therefore the function does not need to be modified before use.

An example dialog box is:

 

 

 

function Create_VDW_in_native_space() {

 

BrainVoyagerQX.TimeOutMessageBox("This function creates a VDW file in native space...", 5);

var vmr = BrainVoyagerQX.OpenDocument(FileDialog.getOpenFileName("*.vmr", "Please select a VMR file"));

var dmrName = FileDialog.getOpenFileName("*.dmr", "Please select a DMR file");

var IA = FileDialog.getOpenFileName("*_IA.trf", "Please select an initial alignment file");

var FA = FileDialog.getOpenFileName("*_FA.trf", "Please select a fine alignment file");

var newVDWname = FileDialog.getSaveFileName("*.vdw", "Please enter a name for the new VDW file");

var res = Input.getNumber("Please enter the resolution (1=1x1x1, 2=2x2x2, 3=3x3x3)", 3, 0, 1, 3); // default: 3 x 3 x 3

var interp = Input.getNumber("Please enter the resolution (0=nearest neighbour, 1=trilinear, 2=sinc)", 1, 0, 0, 2); // trilinear interpolation

var thresh = Input.getNumber("Please enter the intensity threshold for the bounding box", 100, 0, 0, 225);

BrainVoyagerQX.ShowLogTab();

BrainVoyagerQX.PrintToLog("Start creating VDW in native space...");

var success = vmr.CreateVDWInVMRSpace(dmrName, IA, FA, newVDWname, res, interp, thresh);

if (success) {

BrainVoyagerQX.PrintToLog("Created VDW: " + newVDWname);

} else {

BrainVoyagerQX.PrintToLog("VDW creation did not succeed.");

}

 

}

 

 

Back to VDW menu