VolViewer Scripting in more detail

From BanghamLab
Revision as of 19:50, 24 January 2012 by AndrewBangham (talk | contribs)
Jump to navigation Jump to search

Back to VolViewer overview

VolViewer scripting and accessing VolViewer from Matlab

VolViewer scripting

A script is a limited form of program - a list of commands. In this case the commands (see VolViewerScriptsAPI) cover most of the operations that you would usually do interactively. On Windows, VolViewer is an exe file. It can either be launched by clicking its icon or from the command prompt using the command


Normally VolViewer runs interactively. However, having discovered how best to filter and view an image stack it is possible to tell VolViewer to apply the sequence of operations (stored as a script) to, for example, every image and every stack in an image sequence. To do this one launches VolViewer giving the name of a text file that contains the script needed to repeat the sequence of operations. For example, if the script is contained in a file called 'myscript.txt' then VolViewer should be launched using the command

VolViewer.exe open_script('myscript.txt')

VolViewer will open, execute the operations in 'myscript.txt' and close again with no further actions by the user (you). The following is an example of 'myscript.txt' . It opens an image called 'Anti_Flower 294 (gfp1+txr+vis)' in a directory called 'E:\VOLUME DATA', filters it, save a projection and saves the processed stack.

 'myscript.txt'  contains
open_image_stack(0, 'E:\VOLUME DATA\Anti_Flower 294 (gfp1+txr+vis)\')
compute_GPUfilter_AnisotropicDiffusion(0, 5.0, 0.1, 10)
save_projection('E:\VOLUME DATA\Projections\Anti_Flower 294 (gfp1+txr+vis).png')
save_image_stack('E:\VOLUME DATA\Anti_Flower 294 (gfp1+txr+vis)\Filtered\')

Matlab to Volviewer