List of MATLAB scripts

The following scripts can be used independent of BrainVoyager, because they read the files directly. Scripting of BrainVoyager QX from Matlab will be possible in one of the next versions.

For scripting BrainVoyager 2000 from Matlab, a scripting guide is available written by Jens Schwarzbach (F.C. Donderscentre, NL).

 

Activation of the scripts mentioned below:

The scripts don't have to be modified before they can be used. Any required information will be asked or shown via dialogs.

Activate a script by loading the script in Matlab and pressing 'run', unless indicated otherwise (when the script is a function).

Although efforts are made to make the scripts as reliable and accurate as possible, use of scripts is for own risk.

 

 

Script name

Description

Status

 

 

 

Data related:

 

 

 

 

 

BVQXtools

Toolbox for reading and writing BrainVoyager formats in Matlab.

By Jochen Weber

0.5

 

 

 

ProcessVMP.m

Convert a VoxBo CUB to Analyze, read it into  MATLAB, and drop the actual numbers into the VMP structure we read in from BV.  Then we write this back out as a new VMP file.

Kindly provided by D. Brainard

 

 

 

 

 

 

 

writeDcmInfo.m

Writes header information of a DICOM file to a text file. For Matlab 6.5 or higher with image processing module.

1.0

readVMRforQXandBV2000.m

Purpose: read BrainVoyager *.vmr file (both BV 2000 & BV QX formats)(VMR = Volume based anatomical MRI data, T1)

 

readSTC.m

Purpose: read *.stc file (Slice time course)

Remarks:

The script will present one of the slices as image and save intensity information about the slices in a structure 'stcStruct'. (Click the image away to work in the command window). See the script help for more information.

1.0

readVTC.m

Purpose: read *.vtc file (Volume time course)

Remarks: coordinates are to BrainVoyager system coordinates (see BrainVoyager *.vtc file format documentation)

beta

readMTC.m

Purpose: read *.mtc file (mesh time course)

Remarks: The script will generate a file that contains information from the *.mtc file header and some general intensity information.

 

chProtInFMR.m

Purpose: this script helps changing the protocol file name in an FMR

 

getPRTfromVTC.m

function prtName = getPRTfromVTC(VTCname)

Purpose: get linked protocol file name (without path) from given VTC file (with path) Returns: protocol file name (without path) or, when no protocol file is linked, ""

1.0

getPRTfromFMR.m

function prtFileName = getPRTfromFMR(fmrFileName)

Purpose: reads FMR file and returns protocol file name including path

1.0

writeColoredVMR.m

Purpose: show possible colors in VMR by creating a VMR with all colors and saving this 'colors.vmr' in the 'C:\Program Files\BrainVoyager' directory. Color values are often used to create masks, like the "BrainTalMask.vmr". In the "BrainTalMask.vmr", green and orange are used in the segmentation procedure to indicate different brain areas.

Intensity values between 0 (black) and 225 (white) in the VMR format are greyscale values.

 

createUFF.m

Purpose: create BrainVoyager user defined file format (*.uff)

A *.uff file can be used when the image data format is not in the list of formats recognized by BrainVoyager automatically when creating a *.fmr/*.vmr/*.amr project. For more information about the *.uff format, see the chapter 'Data import/export' in the BrainVoyager File Format documentation.

 

readNifti1.m

Read a NIfTI-1 file (for more information about NIfTI-1, see the BrainVoyager file format documentation or http://nifti.nimh.nih.gov/dfwg/.

beta

funcWriteFMR2fromMosaicDCMLog.m

Purpose: create FMR project and STC (slice time course) files from Mosaic DICOM files & makes DICOM matrix dimensions square by zero padding, if necessary. The script will rotate the images 90 degrees towards upright position. Produces logfile.

Notes:

1. works only on Matlab 6.5 or higher with the Image Processing Toolbox

2. Under construction, use for own risk. Please check the values in the FMR file!

3. No *.pos and *.amr files are created; no check for byte order

beta

makeDCMsquareCreateVMR.m

Purpose: make DICOM matrix dimensions square by zero padding and create a VMR for anatomical files with largest dimension 512.

Notes:

 - Works only on Matlab 6.5 or higher with the Image Processing Toolbox

-- Script is only tested with exclusively the anatomical DICOM files in the folder

 - Dependent of brightest value in file, intensity adjustment not always necessary (line 113)

 - Use for own risk. No positioning information is saved in the VMR header (might require point-based coregistration)

beta

 

 

 

Statistics related:

 

 

designMatrixSPM2BV.m

Purpose: Export SPM design matrix (SPM.xX.X) to BrainVoyager *.rtc design matrix

beta

readMAPexport2Excel.m

Purpose: read statistical values from a *.map file (statistical map for 2D anatomical slices) and export these values to Excel

 

readVMP.m

Purpose: read statistical values from a *.vmp file (statistical map in 3D)

1.0

readVMPExport2Excel.m

Purpose: read statistical values from a *.vmp file (statistical map for anatomical volumes) and export to Excel

1.0

readSMP.m

readSMPversion3.m

Purpose: read *.smp file (surface statistical map, to be projected on *.srf file). The script for version 3 can be used for SMP files that are created in BrainVoyager QX.

1.0

readGLMExport2Excel.m

Purpose: read statistical values from a *.glm file and export the beta values, mean time courses and XY*predictor values to Excel.

Warning: Excel can become pretty large.

Thanks to Elia Formisano for the reading of the GLM part

 

exportVMPVOI2Excel.m

Purpose: Quick & dirty way to export *.vmp Volume of Interest (VOI) to Excel.

The script will ask for the coordinates of the ROI/VOI within the VMP volume (175 x 121 x 139); these coordinates are relative to the VMR volume, indicated by the variables 'XStart', 'XEnd' ... 'ZEnd'.

X coordinates are rows in Excel file

Y coordinates are columns in Excel file

Z coordinates are files in Excel file

Notes:

1. running of readVMP script is required before using this script.

2. values are separated by tabs (might be needed to indicate to Excel)

beta

importExcel2GLM.m and expGLM2Excel2GLM.m

Purpose: read statistical values from a *.glm file and export the beta values, mean time courses and XY*predictor values to Excel.

The script will create a textfile with the exported filenames in it, to be used with the importExcel2GLM.m script, to import the data back in Matlab when performing computations on the data in Excel.

Thanks to dr. Elia Formisano for the reading of the GLM part

 

 

 

 

Conversion scripts:

 

 

convertVMRQX2BV2000.m

Purpose: convert BV QX *.vmr file (Volume based anatomical MRI data) to BV 2000 format; generates an HTML file with the VMR positioning data and an image (*.bmp) with a sample of a volume

Note: POS file is not converted from version 3 to version 2

1.0

exportVMR1toAnalyze.m

Purpose: exports VMR file to Analyze 7.5 format

Currently only from VMR file format, version 1 (BV 2000 format)

beta

exportAMRtoBMP.m

Purpose: this script reads a BrainVoyager *.amr project and exports the bitmaps in the *.amr project to separate bitmaps (*.bmp).

Notes:

1. Use of "Export AMR function" in BrainVoyager is recommended; this script is only for temporary purposes

2. Script can be used on Matlab 6.5 with Image Processing Toolbox

beta