Brain Innovation

support portal

Navigation

BrainVoyager Available Tools Available Scripts Scripts for BrainVoyager (Python, *.py)

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.

  • For more information about Python in BrainVoyager, please see Rainer's BV blog. They are an addition to the scripts that are available in the folder /(My) Documents/BrainVoyager/BVExtensions/PythonScripts/ after installation of BrainVoyager.
  • For a BrainVoyager file formats library in Python (in progress), see https://github.com/ofgulban/bvbabel.
  • For Python in BrainVoyager documentation, please see "Python" > "Python Developer Guide" in the BrainVoyager menu, or older documentation is available online at http://fladd.github.io/BVPython/index.html.
  • For information about the Python language and some useful libraries, see: Python website and the SciPy website. Also, the JavaScript language can still be used in BrainVoyager (see JavaScripts), and on Mac, AppleScript can be used.

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.

 

You are here: HomeBrainVoyagerAvailable ToolsAvailable Scripts ≫ Scripts for BrainVoyager (Python, *.py)