Scripts for BrainVoyager (Python, *.py)

Introduction

The Python-scripts (*.py) below can be used from BrainVoyager 20. Python is an experimental feature in BrainVoyager 20.0.

python menu bv

Scripts

Simple script to read/write a transformation file (only type 2, *_a12.trf): read_transformation_file_v021.py (zipped)
Simple script to show slices of VMR volumes (one anatomical, one VTC-in-VMR volume), see figure below: show_img_slices.py (zipped)

show img slices

Script to calculate mutual information between an anatomical image (VMR) and a functional image saved as VMR: mutual_information_in_brainvoyager_v02.py (zipped)
Can be useful to check the undistortion via COPE or anatabacus. First, coregister the distorted and undistorted FMRs to the VMR, then create VTCs, use "Show VTC Vol" in 3D Volume Tools and save via File > Save as Secondary VMR.
Usage: load in BrainVoyager Python editor, click 'Run'. File dialogs asking for the VMRs will appear, and figures of histograms, etc. In v0.2, the figures are saved to disk.
 
Simple script to segment a VMR file by setting all values above a threshold to blue (colour 240): simple_segment_vmr_using_threshold_v01.py (zipped)
 
create stc difference image v01
Script to compare two STC slices, for example before and after EPI distortion correction: create_stc_difference_image_v01.py (zipped)
 
Manual to calculate the Dice similarity coefficient manually in BrainVoyager, and via Python script: PDF. Simple script to calculate the Dice similarity coefficient between an anatomical image (VMR) and a functional image saved as VMR: image_registration_evaluation_with_dice_coefficient_bv22_v02_py.zip
Usage: load in BrainVoyager Python editor, click 'Run'. An input box to enter a threshold and file dialogs asking for the VMRs will appear, and the Dice similarity coefficient will be printed to the BrainVoyager Log tab.