MorphMesh Method


Description

Morphs a created or loaded mesh; typical applications are surface smoothing or skin reconstruction..

Syntax

objDocument.MorphMesh(intNrOfIterations, intUpdateScreen, floatSmoothFactor, floatFindSurfFactor, intFindIntensity, boolSmoothingMode)

Remarks

Valid only if objDocument is of type VMR and and at least one mesh is present in the Surface Module window. If multiple meshes exist, morphing is apllied to the current mesh. Individual morphing steps producing small changes can be repeated as specified by the intNrOfIterations parameter. The screen is not necessarily updated after each morphing step but after several steps as specified by the intUpdateScreen parameter. The changes performed by a single morphing step are controlled by several forces. The smoothing force is specified by the floatSmoothFactor which typically has values between 0.05 and 0.8. Another force is the surface finding force which is specified by the intFindSurfFactor parameter which typically has values between 0.0 and 0.5. The surface finding force lets a vertex move in the direction of its normal vector until it finds an intensity value in the underlying VMR data set as specified by the intFindIntensity parameter. The surface finding force can be turned off by spcifiying a intFindSurfFactor of '0.0' or by setting the boolSmoothingMode parameter to 'True'..

Example

' VBScript
Set doc = BrainVoyager.OpenDocument("NN_TAL_WM_LH_BL2.vmr")
doc.SwitchToSurfaceModule
doc.
RefreshSurfaceWindow
doc.ReconstructBoundary
' Smooth mesh: Perform 50 iterations, update screen every 10th step
doc.
MorphMesh 50, 10, 0.3, 0.0, 50, True
doc.
SaveMesh "NN_LH_RECOSM.srf"

// JScript
doc = BrainVoyager.OpenDocument("NN_TAL_WM_LH_BL2.vmr");
doc.SwitchToSurfaceModule();
doc.RefreshSurfaceWindow();
doc.ReconstructBoundary();
doc.MorphMesh(50, 10, 0.3, 0.0, 50, true)
doc.SaveMesh("NN_LH_RECOSM.srf");

# PerlScript
$doc = $BrainVoyager->OpenDocument("NN_TAL_WM_LH_BL2.vmr");
$doc->SwitchToSurfaceModule();
$doc->RefreshSurfaceWindow();
$doc->ReconstructBoundary();
$doc->MorphMesh(50, 10, 0.3, 0.0, 50, 1);
$doc
->SaveMesh("NN_LH_RECOSM.srf");