SetVoxelValue Method


Description

Sets the intensity value of the specified voxel in an VMR data set.

Syntax

objDocument.SetVoxelValue(intX, intY, intZ, intIntensity)

Remarks

Valid only if objDocument is of type VMR. Intensity values in VMR files are stored in bytes. The values for intIntensity should be in the range of 10 - 245 since the colors indices below 10 and above 245 are reserved for the Windows system palette. The range of values normally interpreted as grey scale is from 10 to 225. To update the SAG, COR and TRA window, call RefreshView after execution of this method.
Note that the method is quite slow, i.e. it is not appropriate to use this method to loop across all data points. If you want to work efficiently with VMR files, you should follow the method described in the topics "A simple C++ program" and "An easy C++ program". The method has been developed mainly for internal use, i.e. to test the speed of data access using scripts. If in a later release a so called in-process COM server is provided (basically BrainVoyager as a DLL), the speed might be as fast as with using C++. If this turns out to be the case, we will provide further methods for setting and retrieving intensity and dimension values from VMR files.

Example

' VBScript
doc.
SetVoxelValue 100, 185, 120, 200
doc.
RefreshView

// JScript
doc.
SetVoxelValue(100, 185, 120, 200);
doc.
RefreshView();

# PerlScript
$doc->
SetVoxelValue(100, 185, 120, 200);
$doc->
RefreshView();