diff --git a/AutoRemesh/AutoRemesh.esproj/user.brosensteiner.espressostorage b/AutoRemesh/AutoRemesh.esproj/user.brosensteiner.espressostorage index 6576a33..31966ac 100644 Binary files a/AutoRemesh/AutoRemesh.esproj/user.brosensteiner.espressostorage and b/AutoRemesh/AutoRemesh.esproj/user.brosensteiner.espressostorage differ diff --git a/AutoRemesh/AutoRemesh.scro b/AutoRemesh/AutoRemesh.scro index f4c595e..1e5c659 100644 --- a/AutoRemesh/AutoRemesh.scro +++ b/AutoRemesh/AutoRemesh.scro @@ -8,17 +8,92 @@ namespace import -force \ ::SharedProcs::* - -#set moduleName [string map { "\.scro" "" } $this];# the name of the module - $this proc constructor {} { -# button port -#$this newPortButtonList Utilities 1 -#$this Utilities setLabel 0 "Connect all label fields" -#$this Utilities setCmd 0 { $this autoConnectToSurface } +set moduleName [moduleName] +set theAuthor [theAuthor "Bernhard Rosensteiner"] + +# button port for Utilities +$this newPortButtonList Utilities 1 +$this Utilities setLabel 0 "Connect all surface fields" +$this Utilities setCmd 0 { autoConnectToAll HxSurface } + +set theSurfaceRemesher [create HxRemeshSurface] +#$theSurfaceRemesher hide;will be hidden in final version + +#recreating the ports of the RemeshSurface module and connecting with it: +$this newPortMultiMenu objective 2 +$this objective setLabel 0 0 "High regularity" +$this objective setLabel 0 1 "Best isotropic vertex placement" +$this objective connect $theSurfaceRemesher objective + +$this newPortIntTextN triangleArea 3 +$this triangleArea setLabel 0 "nPasses" +$this triangleArea setLabel 1 "nAreaSteps" +$this triangleArea setLabel 2 "nEdgeFlips" +$this triangleArea setValues 5 3 3 +$this triangleArea connect $theSurfaceRemesher triangleArea + +$this newPortIntTextN lloydRelaxation 1 +$this lloydRelaxation setLabel 0 "nPasses" +$this lloydRelaxation setValues 40 +$this lloydRelaxation connect $theSurfaceRemesher lloydRelaxation + +$this newPortIntTextN desiredSize 3 +$this desiredSize setLabel 0 "#vert." +$this desiredSize setLabel 1 "#tris" +$this desiredSize setLabel 2 "%" +$this desiredSize setMinMax 2 1 100 +$this desiredSize setValues 0 0 100 +$this desiredSize connect $theSurfaceRemesher desiredSize + +$this newPortButtonList defaults 1 +$this defaults setLabel 0 "Set" +$this defaults connect $theSurfaceRemesher defaults + +$this newPortIntTextN errorThresholds 2 +$this errorThresholds setLabel 0 "smoothness" +$this errorThresholds setLabel 1 "distance" +$this errorThresholds setValues 0 0 +$this errorThresholds connect $theSurfaceRemesher errorThresholds + +$this newPortFloatTextN densityContrast 1 +$this densityContrast setValues 0 +$this densityContrast connect $theSurfaceRemesher densityContrast + +$this newPortFloatTextN densityRange 2 +$this errorThresholds setLabel 0 "min" +$this errorThresholds setLabel 1 "max" +$this errorThresholds setValues 8.58993e+09 8.58993e+09 +$this errorThresholds connect $theSurfaceRemesher errorThresholds + +$this newPortRadioBox interpolateOrigSurface 2 +$this interpolateOrigSurface setLabel "Interpolate orig. surface" +$this interpolateOrigSurface setLabel 0 "smoothly" +$this interpolateOrigSurface setLabel 1 "none" +$this interpolateOrigSurface setValue 1 +$this interpolateOrigSurface connect $theSurfaceRemesher interpolateOrigSurface + +$this newPortToggleList remeshOptions1 2 +$this remeshOptions1 setLabel 0 "fix contours" +$this remeshOptions1 setLabel 1 "contract boundary edges" +$this remeshOptions1 setValue 0 0 +$this remeshOptions1 setValue 1 1 +$this remeshOptions1 connect $theSurfaceRemesher remeshOptions1 + +$this newPortRadioBox remeshOptions2 2 +$this remeshOptions2 setLabel 0 "whole surface" +$this remeshOptions2 setLabel 1 "only around corners" +$this remeshOptions2 setValue 1 +$this remeshOptions2 connect $theSurfaceRemesher remeshOptions2 + +$this newPortButtonList modifyResult 1 +$this modifyResult setLabel 0 "Apply" +$this modifyResult connect $theSurfaceRemesher modifyResult + + + sayHello -say "hallo es geht alles gut mit dem package loaden" } diff --git a/AutoRemesh/AutoRemeshProcs.tcl b/AutoRemesh/AutoRemeshProcs.tcl index c886105..eb815d8 100644 --- a/AutoRemesh/AutoRemeshProcs.tcl +++ b/AutoRemesh/AutoRemeshProcs.tcl @@ -1,19 +1,3 @@ -# procedure which connects $this to all surface fields in the pool when invoked: -$this proc autoConnectToSurface {} { - - set allSurfacesInPoolList [all HxSurface] - set allConPorts [$this connectionPorts] - - foreach item $allConPorts { - if { [$this $item isOfType "HxConnection"] } then { $this $item disconnect };#disconnects only HxConnection connection ports (e.g. not colormap port) - } - #(re)connects to all labelfields in pool: - foreach item $allSurfacesInPoolList { - $this [lindex $allEmptyConPorts 0] connect $item - $this compute - } -} - # procedure creates gui elements (separator, bottons, toggles) for a connected lab field \ argument i is the number of portname $this proc createConPortButtonsToggles { i } { diff --git a/ExtractLabels/ExtractLabels.scro b/ExtractLabels/ExtractLabels.scro index 39651f6..291c449 100644 --- a/ExtractLabels/ExtractLabels.scro +++ b/ExtractLabels/ExtractLabels.scro @@ -91,7 +91,7 @@ $this proc constructor {} { # creates a generic port for some stuff (maybe future extensions): $this newPortButtonList Utilities 2 $this Utilities setLabel 0 "Connect all label fields" - $this Utilities setCmd 0 { $this autoConnectToLabelField } + $this Utilities setCmd 0 { autoConnectToAll HxUniformLabelField3 } $this Utilities setLabel 1 "Apply transformation" $this Utilities setCmd 1 { $this applyTransformation } diff --git a/ExtractLabels/ExtractLables.esproj/user.brosensteiner.espressostorage b/ExtractLabels/ExtractLables.esproj/user.brosensteiner.espressostorage index f14d124..313803e 100644 Binary files a/ExtractLabels/ExtractLables.esproj/user.brosensteiner.espressostorage and b/ExtractLabels/ExtractLables.esproj/user.brosensteiner.espressostorage differ diff --git a/ExtractLabels/extractLabels.tcl b/ExtractLabels/extractLabels.tcl index c293fb3..1f0f6d7 100644 --- a/ExtractLabels/extractLabels.tcl +++ b/ExtractLabels/extractLabels.tcl @@ -307,24 +307,6 @@ $this proc makeArrayFromAmiraParameters { field { theComplValArr {} } { concatBu } - -# procedure which connects $this to all label fields in the pool when invoked: -$this proc autoConnectToLabelField {} { - - global allConnectedLabFields allEmptyConPorts - set allLabelFieldsInPoolList [all HxUniformLabelField3] - set allConPorts [$this connectionPorts] - - foreach item $allConPorts { - if { [$this $item isOfType "HxConnection"] } then { $this $item disconnect };#disconnects only HxConnection connection ports (e.g. not colormap port) - } - #(re)connects to all labelfields in pool: - foreach item $allLabelFieldsInPoolList { - $this [lindex $allEmptyConPorts 0] connect $item - $this compute - } -} - # proc for applying the transformation which $this made -> transformation matrix gets reset, but the object in 3D space stays at its position \ this proc is needed, because when one wants to export for example a HxSurface Object in another application for further processing \ most of the time the amira transformation matrix is not recognized by this applications (except the app can interpret amiramesh files) @@ -495,7 +477,7 @@ $this proc createConPortButtonsToggles { i } { eval "\$this labSetSelBottons\$i setCmd 0 \{ \$this bottonNonePressed " "$i \}" eval "\$this labSetSelBottons\$i setCmd 1 \{ \$this bottonAllPressed " "$i \}" - # ports should initially hidden: + # ports should initially be hidden: $this labSeparator$i hide $this labSetSelBottons$i hide $this labSet$i hide diff --git a/README.markdown b/README.markdown index 00d101f..c392c0b 100644 --- a/README.markdown +++ b/README.markdown @@ -1,6 +1,6 @@ # Scripts for Amira -this Amira scipt-object collection is the result of a "little" sideproject of my diploma thesis at the Department of Theoretical Biology at the University of Vienna. +this Amira scipt-object collection is the result of a "little" sideproject of my diploma thesis at the Department of Theoretical Biology at the University of Vienna. For working with Amira script-objects it is advisable to make a local amira directory (look in the online Amira documentation on how to do it). For convenience there is for every script-object a .rc file for integrating the script-object in the Amira context menu (must be copied in the share/resources folder of $AMIRA\_LOCAL or $AMIRA\_ROOT). Under some circumstances the .rc file has to be adapted at the hosts environment: