1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
// Read the function library
include("Library");
// Open the test workspace
openWorkspace("tensor.itksnap");
// Enter snake mode
enterSnakeModeFullROI();
//=== Entering classification mode
var snakepanel = engine.findChild(mainwin,"SnakeWizardPanel");
var combo = engine.findChild(snakepanel,"inPreprocessMode");
var index = engine.findItemRow(combo,"Classification");
combo.setCurrentIndex(index);
//=== Show just the axial view
engine.findChild(mainwin, "btnAxial").click();
// Get the axial panel
var panel0 = engine.findChild(mainwin,"panel0");
var sliceView0 = engine.findChild(panel0,"sliceView");
//=== Enter paintbrush mode
engine.findChild(mainwin,"actionPaintbrush").trigger();
//=== Paint with foreground label
setForegroundLabel("Label 1");
setCursor(20,8,13);
engine.postKeyEvent(sliceView0, "Space");
//=== Paint with background label
setForegroundLabel("Label 2");
setCursor(10,24,13);
engine.postKeyEvent(sliceView0, "Space");
//=== Paint with background label
setForegroundLabel("Label 3");
setCursor(26,28,13);
engine.postKeyEvent(sliceView0, "Space");
//=== Perform classification
engine.findChild(snakepanel,"btnClassifyTrain").click();
//=== Clear segmentation
engine.findChild(snakepanel,"btnClassifyClearExamples").click();
//=== Go to bubble mode
engine.findChild(snakepanel,"btnNextPreproc").click();
engine.sleep(1000);
//=== Go back to the first seed
setCursor(20,8,13);
//=== Validating speed image
engine.validateFloatValue(readVoxelIntensity(4), 0.8, 0.4)
//=== Add a bubble
engine.findChild(snakepanel,"btnAddBubble").click();
//=== Set bubble radius
engine.findChild(snakepanel,"inBubbleRadius").value = 4;
//=== Go to snake mode
engine.findChild(snakepanel,"btnBubbleNext").click();
engine.sleep(1000);
//=== Set step size
engine.findChild(snakepanel,"inStepSize").value = 10;
//=== Run snake 100 iter
for(var i = 0; i < 10; i++)
{
engine.findChild(snakepanel,"btnSingleStep").click();
}
//=== Finish snake mode
engine.findChild(snakepanel,"btnEvolutionNext").click()
engine.sleep(1000)
//=== Open volumes and statistics
engine.findChild(mainwin,"actionVolumesAndStatistics").trigger();
//=== Check the value
var dialog = engine.findChild(mainwin, "dlgStatistics");
var table = engine.findChild(dialog, "tvVolumes");
var value = engine.tableItemText(table,1,1);
engine.validateFloatValue(value, 1200, 600);
|