Interface
Application offers possibilities to create projects in BrainVoyager
-
Public Methods
-
-
Documents()
-
Provides
access to all projects within an instance of BrainVoyager.
ActiveDocument()
-
Retrieves
a reference to the active document of the accessed BrainVoyager instance.
NewDocument()
-
Create
new document
OpenDocument(
string PathName)
-
Opens a BrainVoyager
project file.
CreateProjectVMR(
string FileType, string FirstFile, number NrOfSlices,
number SwapBytes, number x_res, number y_res, number byte_per_pixel)
-
Creates a VMR
project file.
CreateProjectAMR(
string FileType, string FirstFile, number NrOfSlices,
number SwapBytes, number x_res, number y_res, number byte_per_pixel)
-
Creates an AMR
project file.
CreateProjectFMR(
string FileType, string FirstFile, number NrOfVolumes,
number SkipNVolumes, number CreatePseudoAMR, number NrOfSlices,
string STCPrefix, number SwapBytes, number x_res, number y_res, number
byte_per_pixel, string TargetFolder)
-
Creates a FMR
project file.
CreateProjectMosaicFMR(
string FileType, string FirstFile, number NrOfVolumes,
number SkipNVolumes, number CreatePseudoAMR, number NrOfSlices,
string STCPrefix, number SwapBytes, number x_res, number y_res, number
byte_per_pixel, string TargetFolder, number n_vols_in_ima, number bf_x_res,
number bf_y_res)
-
Creates a FMR
project file from Mosaic data.
GetTime()
-
GetTime() provides
a time value in milliseconds.
Exit()
-
Terminates BrainVoyager.
GetCurrentFolder()
-
Determines the
folder where BrainVoyager currently looks for files.
ScriptLaunchedByBV()
-
Determines of
running script was launched by BrainVoyager or from outside, ie.
NewMainWindowPosition(
number x, number y)
-
Changes the position
of the BrainVoyager window on screen.
NewMainWindowSize(
number width, number height)
-
Changes the width
and height of the BrainVoyager window on screen.
Sleep(number
msecs)
-
Stops running
BrainVoyager for a specified amount of milliseconds.
PrepareDemoGSGStep(number
step)
Documentation
Interface
Application offers possibilities to create projects in BrainVoyager
Documents()
-
Provides
access to all projects within an instance of BrainVoyager. This method
retrieves a collection of all documents available in the accessed BrainVoyager
instance. You can loop through the set of objects by using the "For
each" control structure or access documents via the item command.
There are some differences between the scripting languages about how collections
are accessed (see script language documentation).
-
- Returns:
-
active
documents
-
ActiveDocument()
-
Retrieves
a reference to the active document of the accessed BrainVoyager instance.
If successful, the document object objDocument is returned. Use this object
to access document methods.
-
- Returns:
-
active
document
-
NewDocument()
-
Create
new document
-
- Returns:
-
new
document
-
OpenDocument(
string PathName)
-
Opens
a BrainVoyager project file. Project files constitute the three basic
document types in BrainVoyager: FMR, VMR, and AMR. All other data files
(i.e. VTC, GLM) can be used only if one of the basic document types has
been loaded or created. If successful, the object document objDocument
is returned. Use this object to access document methods.
-
- Returns:
-
document
-
CreateProjectVMR(
string FileType, string FirstFile, number NrOfSlices,
number SwapBytes, number x_res, number y_res, number byte_per_pixel)
-
Creates
a VMR project file. VMR projects consist of three-dimensional high-resolution
scans used to overlay statistical maps, i.e. in Talairach space. VMR files
are also used for head and surface reconstructions. If successful, objDocument
is returned. Use this object to access document methods. If the project
creation operation fails, the return value is x. The parameter strFileType
can be one of the following strings: "IMA" (native Siemens format),
"DICOM", "DCxVR" (explicit value coding version of
DICOM format), "ANALYZE" and "GE_MR" (a native GE
format). The strFirstFile parameter must contain the full path information.
In most cases, the intSwapBytes and intBytesPerPixel parameters should
be set to 1 and 2, respectively. You may want to check proper reading
of your data using the New Project Wizard or Create Project dialog before
using this command in your scripts.
-
- Returns:
-
document
-
CreateProjectAMR(
string FileType, string FirstFile, number NrOfSlices,
number SwapBytes, number x_res, number y_res, number byte_per_pixel)
-
Creates
an AMR project file. AMR projects consist of a set of two-dimensional
anatomical scans used to overlay statistical maps in the original "slice
space". If successful, objDocument is returned. Use this object to
access document methods. If the project creation operation fails, the
return value is x. The parameter strFileType can be one of the following
strings: "IMA" (native Siemens format), "DICOM", "DCxVR"
(explicit value coding version of DICOM format), "ANALYZE" and
"GE_MR" (a native GE format). The strFirstFile parameter must
contain the full path information. In most cases, the intSwapBytes and
intBytesPerPixel parameters should be set to 1 and 2, respectively. You
may want to check proper reading of your data using the New Project Wizard
or Create Project dialog before using this command in your scripts.
-
- Parameters:
-
FileType
- String, indicates image filetype; example: 'ima'
FirstFile - String, indicates
- NrOfSlices
Integer, indicates number of slices per volume; example: '15'
SwapBytes - indicates little or big endian
x_res - nr of columns of slice image matrix
y_res - nr of rows of slice image matrix
byte_per_pixel -
- Returns:
-
AMR
document
-
CreateProjectFMR(
string FileType, string FirstFile, number NrOfVolumes,
number SkipNVolumes, number CreatePseudoAMR, number NrOfSlices,
string STCPrefix, number SwapBytes, number x_res, number y_res, number
byte_per_pixel, string TargetFolder)
-
Creates
a FMR project file. FMR projects consist of a set of functional data in
the original "slice space". For each slice a stack of repeated
measurements of that slice is stored in an STC file. The method creates
automatically a pseudo AMR. CreateProjectFMR2 (new version "2")
now can be used to 1) Create FMR from very first file and skipping a number
of volumes, 2) To automatically create a "pseudo-AMR" from the
first (potentially skipped) volume; this makes it also unnecessary to
call "LinkAMRFile" since this is now handled automatically The
version "2" command thus replaces two separate calls as compared
to old version and follows the new logic in "CreateProject"
dialog/wizard (First volume -> T1 saturated, serves for visualizing
of functional clusters on original EPIs with gyral/sulcal info).
-
- Parameters:
-
strFileType
- String, indicates image filetype; example: 'ima'
strFirstFile - String, absolute path; example: 'path
+ "5807-4-4.ima"'
intNrOfVolumes - Integer, indicates number of volumes;
example: '126'
skipNVolumes - Integer, indicates number of volumes
to skip; usually 1 or 2
CreatePseudoAMR - , create pseudo amr or not, depends
from availability of anatomical scan; boolean, 0 or 1
intNrOfSlices - Integer, indicates number of slices
per volume; example: '15'
strSlicePrefix - String, determines prefix of vtc-filenames;
example: '"slice-"'
intSwapBytes - Integer (boolean) - indicates LittleEndian
or BigEndian
intXRes - Integer, nr of columns of slice image matrix;
example: '128'
intYRes - Integer, nr of rows of slice image matrix;
example: '128'
intBytesPerPixel - , Integer, indicates amount of bytes
per pixel, example: '2'
strTargetPath - String, indicates where the files will
be saved; example: "'path'"
- Returns:
-
FMR
document
-
CreateProjectMosaicFMR(
string FileType, string FirstFile, number NrOfVolumes,
number SkipNVolumes, number CreatePseudoAMR, number NrOfSlices,
string STCPrefix, number SwapBytes, number x_res, number y_res, number
byte_per_pixel, string TargetFolder, number n_vols_in_ima, number bf_x_res,
number bf_y_res)
-
Creates
a FMR project file from Mosaic data. FMR projects consist of a set of
functional data in the original "slice space". For each slice
a stack of repeated measurements (images) is stored in an STC file. The
"Mosaic" version of FMR creation is necessary when reading Siemens
files from scanning sequences which store several slices within a single
image. The format of such "mosaic-images" is not a stack of
slices (i.e. as in ANALYZE files), therefore special treatment is required.
If successful, objDocument is returned. Use this object to access document
methods. If the project creation operation fails, the return value is
x. The parameter strFileType can be one of the following strings: "IMA"
(native Siemens format), "DICOM" and "DCxVR" (explicit
value coding version of DICOM format). The strFirstFile parameter must
contain the full path information. In most cases, the intSwapBytes and
intBytesPerPixel parameters should be set to 1 and 2, respectively. The
parameters intImageXRes and intImageYRes describe the resolution of a
single image (i.e. 256 x 256) whereas intSliceXRes and intSliceYRes (i.e.
64 x 64) describe the resolution of the actual slices within an image.
You may want to check proper reading of your data using the New Project
Wizard or Create Project dialog before using this command in your scripts.
-
- Returns:
-
FMR
document
-
GetTime()
-
GetTime()
provides a time value in milliseconds. A pair of calls to this method
can be used to measure the duration of computations. The method internally
calls the Windows multimedia API function timeGetTime which possesses
millisecond precision.
-
- Returns:
-
TimeInMilliseconds
-
Exit()
-
Terminates
BrainVoyager. Before using this method, all open documents should be closed
first. The method should be the last statement in a script, otherwise
an error message might occur. You might want not to use this method in
cases where you want that a script prepares a certain "setting"
from which you want to start to work interactively.
-
-
GetCurrentFolder()
-
Determines
the folder where BrainVoyager currently looks for files. For methods requiring
file names as input, full path information should be provided. It is,
however, more convenient to specify file names without the full path information
which allows also to move folders to new locations without changing the
content of moved script files. If files are specified without absolute
path information, it should be known which folder is used as the current
folder. The presented method allows to obtain the path to the current
folder. BrainVoyager's current folder is also identical with the path
to the running script file but only when the script has been launched
from within BrainVoyager. If a script has been launched from outside of
BrainVoyager, the current folder is not necessarily the same as the folder
from which the script has been started since a freshly launched BrainVoyager
sets the current folder to the one which was active when BrainVoyager
was closed before. If a script has been started from outside of BrainVoyager
via the Windows Script Host, BrainVoyager has no knowledge about the folder
from where the script has been started. In this case, however, the "WScript"
object is available which possesses methods to determine information about
the folder from which the script was started.
-
- Returns:
-
currentFolder
(string)
-
ScriptLaunchedByBV()
-
Determines
of running script was launched by BrainVoyager or from outside, ie. by
double-clicking the script in Windows Explorer. Scripts run faster if
they are launched by BrainVoyager. One disadvantage is, however, that
the "WScript" object is not available for scripts started by
BrainVoyager. You can use the presented method to check whether you can
access the "WScript" object or not. One important application
is the determination of the folder from which a script has been started.
(see GetCurrentFolder method).
-
- Returns:
-
scriptLaunchedByBV
boolean (0 or 1)
-
NewMainWindowPosition(
number x, number y)
-
Changes
the position of the BrainVoyager window on screen. The position arguments
intPosX and intPosY refer to the left, upper corner of the window. The
values are interpreted as pixels on the screen. The (0, 0) coordinates
refer to the left upper corner of the screen.
-
-
NewMainWindowSize(
number width, number height)
-
Changes
the width and height of the BrainVoyager window on screen. The values
are interpreted as pixels. One useful application of this method is to
reduce the size of the window prior to recording a mesh movie.
-
- Parameters:
-
width
- in pixels
height - in pixels
-
Sleep(number
msecs)
-
Stops
running BrainVoyager for a specified amount of milliseconds. One application
of this function would be to slow down animations which would run to fast
otherwise. An example is shown below where the statistical threshold is
gradually changing over time.
-
-
PrepareDemoGSGStep(number
step)
-
-
Alphabetic
index