Avizo script

Example of Avizo Script :

set dir /Path_to_dir

foreach label [glob -directory $dir *.am] {
remove “labels” “mesh” “mesh.scanConverted” “Result” “Result.surf”
[load $label] setLabel “labels”
set t [string range $label 0 end-2]
set mesh [append t “endocast.obj.ply”]
[load $mesh] setLabel “mesh”
set scs [create HxScanConvertSurface “Scan Surface To Volume”]
“Scan Surface To Volume” setIconPosition 208 79
“Scan Surface To Volume” data connect “mesh”
“Scan Surface To Volume” field connect “labels”
“Scan Surface To Volume” fire
“Scan Surface To Volume” applyTransformToResult 1
“Scan Surface To Volume” fire

$scs action touch
$scs action hit
$scs fire

set ari [create HxArithmetic “Arithmetic”]
“Arithmetic” setIconPosition 356 164
“Arithmetic” inputA connect “mesh.scanConverted”
“Arithmetic” inputB connect “labels”
“Arithmetic” fire
“Arithmetic” resultChannels setIndex 0 0
“Arithmetic” expr0 setState A+2*B
“Arithmetic” fire

$ari doIt touch
$ari doIt hit
$ari fire

set gi [create HxGiEditor]

$gi attach “Result”

“Result” removeMaterial 3
“Result” removeMaterial 2

$gi removeIslands 15 “All slices” XY
$gi removeIslands 15 “All slices” YZ
$gi removeIslands 15 “All slices” XZ

$gi detach

set gs [create HxGMC “Generate Surface”]
“Generate Surface” setIconPosition 160 210
“Generate Surface” data connect “Result”
“Generate Surface” fire

$gs action touch
$gs action hit
$gs fire

set t [string range $label 0 end-2]
set result [append t “endocast.avizo.ply”]
“Result.surf” save “Stanford PLY” $result
}

remove -all
remove “labels” “mesh” “mesh.scanConverted” “Result” “Result.surf”