-
Notifications
You must be signed in to change notification settings - Fork 0
/
7_watershedsegmentation_batch.hx
88 lines (59 loc) · 2.56 KB
/
7_watershedsegmentation_batch.hx
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
remove -all
#### Watershed segmentation batch script for Avizo 9.0.0-rc-2 beta by Hannah Menke on 15 Jan 2015. Email: h.menke12@imperial.ac.uk
#### USER INPUT set first and last scan numbers that you would like segmented
set first {2}
set last {54}
#### END USER INPUT
set loopno "$first"
set loopno2 "first"
for {set loopno "$first"} {$first <= $last} {incr loopno} {
echo $loopno
echo $last
#### USER INPUT set input directory and directory of avizo script objects
[ load D:/hannah/est0.5/diffrefilt/$loopno.am ] setLabel "new"
load "C:/Program Files/Avizo-9.0.0/share/script-objects/WatershedSegmentation2.scro"
#### END USER INPUT
"Watershedsegmentation2_Scro" data connect "new"
Watershedsegmentation2_Scro fire
#trigger 1st action if num phases == 3
"Watershedsegmentation2_Scro" action hit 2
Watershedsegmentation2_Scro fire
#trigger gradient computation
"Watershedsegmentation2_Scro" action hit 2
Watershedsegmentation2_Scro fire
##### USER INPUT set gradient thresholding and trigger next step
"Watershedsegmentation2_Scro" "gradientThreshold" setValue 4500
#### END USER INPUT
"Watershedsegmentation2_Scro" action hit 2
Watershedsegmentation2_Scro fire
##### USER INPUT set Threshold phase 0 and trigger next step
"Watershedsegmentation2_Scro" slider0 setMinMax 0 2500
#### END USER INPUT
"Watershedsegmentation2_Scro" action hit 2
Watershedsegmentation2_Scro fire
##### USER INPUT set Threshold phase 1 and trigger next step
"Watershedsegmentation2_Scro" slider1 setMinMax 2500 65534
#### END USER INPUT
"Watershedsegmentation2_Scro" action hit 2
Watershedsegmentation2_Scro fire
##### USER INPUT set Threshold phase 2 and trigger next step
"Watershedsegmentation2_Scro" slider2 setMinMax 65535 65535
#### END USER INPUT
"Watershedsegmentation2_Scro" action hit 2
Watershedsegmentation2_Scro fire
#Trigger Watershed
"Watershedsegmentation2_Scro" action hit 2
Watershedsegmentation2_Scro fire
#### USER INPUT set saving directory
basins save "Avizo binary" D:/hannah/est0.5/segdiffbasins/segdiffbasins_$loopno.am
#### END USER INPUT
set hideNewModules 0
create HxArithmetic "Arithmetic1"
"Arithmetic1" inputA connect "segdiffbasins_$loopno.am"
"Arithmetic1" expr0 setState (A==2)
[ "Arithmetic1" create ] setLabel "segdiffphase"
segdiffphase save "Avizo binary" D:/hannah/est0.5/segdiffphase/segdiffphase_$loopno.am
remove "new" "basins" "WatershedSegmentation2.scro" "$loopno.am" "segdiffbasins_$loopno.am" "segdiffphase_$loopno.am" "segdiffsub_$loopno.am"
set loopno2 [expr $loopno+1]
}
remove -all