From 79f5f11412db1df3732cb1947d6ba0df6b778067 Mon Sep 17 00:00:00 2001 From: Bernhard Rosensteiner Date: Mon, 11 Jun 2012 01:18:57 +0200 Subject: [PATCH] amira version check --- ExtractLabels.scro | 29 +++++++++++++----- .../user.brosensteiner.espressostorage | Bin 3146 -> 3145 bytes amira_procs.tcl | 2 +- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ExtractLabels.scro b/ExtractLabels.scro index c86dc3d..631b007 100644 --- a/ExtractLabels.scro +++ b/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: @@ -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) @@ -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 @@ -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 @@ -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 @@ -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 } { @@ -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 diff --git a/Scripts_for_Amira.esproj/user.brosensteiner.espressostorage b/Scripts_for_Amira.esproj/user.brosensteiner.espressostorage index 2dd7ed971472fd24ee518aaa48e3f50285a8b9a3..94a1e5db9132cd6600582af35e0217b12befe911 100644 GIT binary patch delta 152 zcmX>laZ-XmsURn_xWvHVG9wc+3#-6H9lMGAvKyxeaf-3Ab8vET^YHTVM?2@|m89mC z1ZP&IPTs(2${SN{XlZ1iqhM%gYErxTBj;O2>BwprKQ^E!KPxr4Bs?=OCBOWlpwPrz zbu|VK27U%J2499O&T7s!&Pkk0IX7_bpaY}+esURn_xWvHVG9wc+3p>X|U)hQLcFY%9*(TrNR^ON<#L30U#m&RZ$1fl# zGeqKpxUP*9fRqEy|oNpO@qN;TbbQBB?%`IwU1B&vqQj<%*yn3_1+K3|S1h4D}3CIG1v6;5^KEj`KF>Q_hdvS={%yUvht+tjQzK G$N~Uj+ASIY diff --git a/amira_procs.tcl b/amira_procs.tcl index 41b02f1..1129b93 100644 --- a/amira_procs.tcl +++ b/amira_procs.tcl @@ -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) } }