VMR files can be automatically transformed to isovoxel size of 1 x 1 x 1 mm via the function
AutoTransformToIsoVoxel(<interpolation method>, <new vmr name>).
The resulting VMR is written to disk. The function returns a boolean value (true or false) to indicate whether the transformation succeeded. The transformation matrix is also displayed in the BrainVoyager QX Log tab.
Thanks to Daniel Wiswede
The values that can be provided as interpolation parameters are displayed in the table below.
Interpolation parameter |
Value |
Cubic spline |
2 |
SINC |
3 |
The function below presents a file dialog to select a VMR file, opens this VMR file in the BrainVoyager QX main window, transforms the VMR file and saves it on disk in the same directory as the original VMR file with the name "isovoxel.vmr".
function Make_VMR_isovoxel() {
var vmrname = FileDialog.getOpenFileName("*.vmr", "Please select a VMR file to make isovoxel");
var vmrproject = BrainVoyagerQX.OpenDocument(vmrname);
var vmrfile = new File(vmrname);
var success = vmrproject.AutoTransformToIsoVoxel(1, vmrfile.path + "/isovoxel.vmr");
MessageBox.information("The isovoxel file can be found at '" + vmrfile.path + "/isovoxel.vmr'");
}