-
Notifications
You must be signed in to change notification settings - Fork 0
/
mhdIO.scro
30 lines (24 loc) · 906 Bytes
/
mhdIO.scro
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
# Amira-Script-Object V3.0
#see CopyTransformation.scro and https://github.com/brosensteiner/Scripts_for_Amira/tree/master/ExtractLabels
# The Constructor is called when a scro is created or restarted
$this proc constructor {} {
$this newPortFilename fn
$this fn setLabel "Output Filename"
$this newPortDoIt doit
$this script hide
}
# The "compute" method is called whenever a port has changed
$this proc compute {} {
# Check if the button Apply was hit. Nothing is done if it was not.
if { ![$this doit wasHit 0] } {
return
}
# If no data is specified at Data port, the message "please connect a Spatial Data" is displayed
set dataObject ["$this" data source]
if { $dataObject == "" } {
echo "Please connect a Spatial Data object to the Data port"
return
}
set fileName [$this fn getValue]
writemhdfile $dataObject $fileName
}