Skip to content

Commit

Permalink
amira version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Rosensteiner committed Jun 10, 2012
1 parent 2750a7f commit 79f5f11
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
29 changes: 21 additions & 8 deletions ExtractLabels.scro
@@ -1,5 +1,11 @@
# Amira-Script-Object V3.0

#Amira version check:
set amira_version [string map {Amira "" . "" " " ""} [app version]]
if { $amira_version < 540 } then {
theMsg warning "!!! your amira version is [app version], but you need at least 5.3 to use this module !!!"
}

source "[file dirname [info script]]/amira_procs.tcl";#relative path to amira_procs.tcl

# some packages:
Expand All @@ -26,7 +32,7 @@ set virtualEvec1 "-wx"
set virtualEvec2 "-wy"
set virtualEvec3 "-wz"
set theExtractedSurfacesList [list];# keeps track of surfaces of the current run
set theArithmeticExtractedVoxelList [list];# keeps track of all extracted surfaces from arithmetic runs
set theArithmeticExtractedVoxelList [list];# keeps track of all extracted surfaces from arithmetic runs (gets deleted every run)
set theMenuEntryInRotationPort "all";#default is "all" for rotation port
set theResampledExtractedVoxelList [list];# keeps track of all extracted surfaces from resample z runs
set theAdditionalDataList [list];#keeps track of additional data that $this produces (e.g. spreadsheet objects)
Expand Down Expand Up @@ -323,7 +329,7 @@ $this proc compute {} {
}
if { $voxelOptionAlignPrincipalAxisIsChecked && $voxelOptionConnectVolrenIsChecked } then { $this colormap show } else { $this colormap hide }

# the next "if" is neccesary because i don´t get the interactive mapping of ports in amira to work (at least with colormap ports),\
# the next "if" is neccesary because i don´t get the interactive mapping of ports in amira to work with the "connect" command (at least with colormap ports),\
so the eventually created volren modules get updated this way when the colormap port of $this will be modified by user:
if { [$this colormap isNew] && [llength volRenList] != 0 } then {# when colormap port has changed and there is something in volRenList list

Expand Down Expand Up @@ -444,7 +450,9 @@ $this proc compute {} {
#some additional info:
$this stampField $newExtractedSurface ModuleInfo ModuleName $moduleName author $theAuthor

lappend theCompleteExtractedList $newExtractedSurface
lappend theExtractedSurfacesList $newExtractedSurface

array unset newExtractedSurfaceParameters

$newExtractedSurface master disconnect;# otherwise the newly created surface gets overriden in the next for loop iteration
Expand All @@ -460,8 +468,6 @@ $this proc compute {} {
}

}

set theCompleteExtractedList [concat $theCompleteExtractedList $theExtractedSurfacesList];# save all generated surfaces in theCompleteExtractedList list

$surfaceViewModul buffer setValue 1;# only get rid of the last selection in buffer which would otherwise be visible in the viewer
$surfaceViewModul compute
Expand Down Expand Up @@ -517,12 +523,12 @@ $this proc compute {} {
orig_labelfield $labelfield \
orig_bundleindex $i

# append extracted voxel field to global lists:
lappend theCompleteExtractedList $theResultFromArithmeticCalcName;
lappend theArithmeticExtractedVoxelList $theResultFromArithmeticCalcName;

# append extracted voxel field to global list:
lappend theCompleteExtractedList $theResultFromArithmeticCalcName
lappend theArithmeticExtractedVoxelList $theResultFromArithmeticCalcName
}
}

if { $voxelOptionAlignPrincipalAxisIsChecked } {

for { set i 0 } {$i < [$this $theLabSetFromLabSetList getNum] } { incr i } {
Expand Down Expand Up @@ -717,6 +723,13 @@ $this proc compute {} {
$this resampleOptions2 setSensitivity 0 0
$this resampleOptions2 setOptSensitivity 0 0
}
if { $theCompleteExtractedList ne "" } then {

$this Utilities setSensitivity 1 1
} else {

$this Utilities setSensitivity 1 0
}

# saving routine:
if { $userSaveState ne "" && $theCompleteExtractedList ne [list] } {# user has typed something in the saveResults port and theCompleteExtractedList is not empty
Expand Down
Binary file modified Scripts_for_Amira.esproj/user.brosensteiner.espressostorage
Binary file not shown.
2 changes: 1 addition & 1 deletion amira_procs.tcl
Expand Up @@ -448,7 +448,7 @@ $this proc applyTransformation {} {
global theCompleteExtractedList

foreach item $theCompleteExtractedList {
$item applyTransform
if { [$item getTypeId] eq "HxUniformScalarField3" } then { $item applyTransform };#only HxUniformScalarField3 have a transformation (HxSurface has not)
}
}

Expand Down

0 comments on commit 79f5f11

Please sign in to comment.