Commit 46e88605 authored by pieper's avatar pieper
Browse files

ENH: adapt threshold effect for compatibility with slicer4

git-svn-id: http://svn.slicer.org/Slicer4/trunk@15603 3bd1e089-480b-0410-8dfb-8563597acbee
parent 7b539e09
......@@ -299,17 +299,19 @@ proc EditorToggleErasePaintLabel {} {
proc EditorGetPaintColor { {this ""} } {
set sliceLogic [$::slicer3::ApplicationLogic GetSliceLogic "Red"]
if { $sliceLogic != "" } {
set logic [$sliceLogic GetLabelLayer]
if { $logic != "" } {
set volumeDisplayNode [$logic GetVolumeDisplayNode]
if { $volumeDisplayNode != "" } {
set node [$volumeDisplayNode GetColorNode]
set lut [$node GetLookupTable]
set index [EditorGetPaintLabel]
set index [expr int($index)]
return [$lut GetTableValue $index]
if { [info exists ::slicer3::ApplicationLogic] } {
set sliceLogic [$::slicer3::ApplicationLogic GetSliceLogic "Red"]
if { $sliceLogic != "" } {
set logic [$sliceLogic GetLabelLayer]
if { $logic != "" } {
set volumeDisplayNode [$logic GetVolumeDisplayNode]
if { $volumeDisplayNode != "" } {
set node [$volumeDisplayNode GetColorNode]
set lut [$node GetLookupTable]
set index [EditorGetPaintLabel]
set index [expr int($index)]
return [$lut GetTableValue $index]
}
}
}
}
......
......@@ -36,7 +36,7 @@ if { [itcl::find class ThresholdEffect] == "" } {
# methods
method processEvent {{caller ""} {event ""}} {}
method preview {} {}
method preview { {color ""} } {}
method apply {} {}
method positionCursor {} {}
method buildOptions {} {}
......@@ -100,7 +100,7 @@ itcl::body ThresholdEffect::apply {} {
}
itcl::body ThresholdEffect::preview {} {
itcl::body ThresholdEffect::preview { {color ""} } {
if { [$this getInputBackground] == "" || [$this getInputLabel] == "" } {
$this errorDialog "Background and Label map needed for Threshold"
......@@ -114,7 +114,9 @@ itcl::body ThresholdEffect::preview {} {
# (output of the layer logic's vtkImageReslice instance)
#
set color [::EditorGetPaintColor $::Editor(singleton)]
if { $color == "" } {
set color [::EditorGetPaintColor $::Editor(singleton)]
}
if { ![info exists o(lut)] } {
set o(lut) [vtkNew vtkLookupTable]
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment