@@ -99,7 +99,7 @@ def __makeObjects(self):
9999 'Colormap: ' ,
100100 style = wx .ALIGN_RIGHT )
101101
102- self .cmap_nameList = ['autumn' , 'bone' , 'bone_r' , 'cool' , 'copper' ,
102+ self .cmap_nameList = ['autumn' , 'bone' , 'bone_r' , 'bwr' , ' cool' , 'copper' ,
103103 'flag' , 'gray' , 'gray_r' , 'hot' , 'hot_r' ,
104104 'hsv' , 'jet' , 'pink' , 'prism' , 'spring' ,
105105 'summer' , 'winter' , 'spectral' ]
@@ -111,22 +111,31 @@ def __makeObjects(self):
111111
112112 self .cmin_val = 0
113113 self .cmin_lab = wx .StaticText (self , wx .NewId (),
114- 'Minimum: ' ,
115- style = wx .ALIGN_RIGHT )
114+ 'Minimum: ' ,
115+ style = wx .ALIGN_RIGHT )
116116 self .cmin_txt = wx .TextCtrl (self , wx .NewId (),
117- value = str (self .cmin_val ),
118- style = wx .RAISED_BORDER | wx .TE_PROCESS_ENTER )
117+ value = str (self .cmin_val ),
118+ style = wx .RAISED_BORDER | wx .TE_PROCESS_ENTER )
119119 self .cmUnder_box = wx .CheckBox (self , wx .NewId (), 'show under' )
120120
121121 self .cmax_val = 2000
122122 self .cmax_lab = wx .StaticText (self , wx .NewId (),
123- 'Maximum: ' ,
124- style = wx .ALIGN_RIGHT )
123+ 'Maximum: ' ,
124+ style = wx .ALIGN_RIGHT )
125125 self .cmax_txt = wx .TextCtrl (self , wx .NewId (),
126- value = str (self .cmax_val ),
127- style = wx .RAISED_BORDER | wx .TE_PROCESS_ENTER )
126+ value = str (self .cmax_val ),
127+ style = wx .RAISED_BORDER | wx .TE_PROCESS_ENTER )
128128 self .cmOver_box = wx .CheckBox (self , wx .NewId (), 'show over' )
129129
130+ self .apply_filter = False
131+ self .filter_val = 0.8
132+ self .applyFilter_txt = wx .TextCtrl (self , wx .NewId (),
133+ value = str (self .filter_val ),
134+ style = wx .RAISED_BORDER | wx .TE_PROCESS_ENTER )
135+ self .applyFilter_lab = wx .StaticText (self , wx .NewId (),
136+ 'Apply filter: ' ,
137+ style = wx .ALIGN_RIGHT )
138+ self .applyFilter_box = wx .CheckBox (self , wx .NewId (), 'apply filter' )
130139
131140 return
132141
@@ -140,14 +149,16 @@ def __makeBindings(self):
140149 self .Bind (wx .EVT_CHECKBOX , self .OnSetUnder , self .cmUnder_box )
141150 self .Bind (wx .EVT_CHECKBOX , self .OnSetOver , self .cmOver_box )
142151
152+ self .Bind (wx .EVT_TEXT_ENTER , self .OnSetFilterVal , self .applyFilter_txt )
153+ self .Bind (wx .EVT_CHECKBOX , self .OnApplyFilter , self .applyFilter_box )
143154 return
144155
145156 def __makeSizers (self ):
146157 """Lay out the interactors"""
147158 #
148159 # colormap sizer
149160 #
150- nrow = 3 ; ncol = 3 ; padx = 5 ; pady = 5
161+ nrow = 4 ; ncol = 3 ; padx = 5 ; pady = 5
151162 self .cmSizer = wx .FlexGridSizer (nrow , ncol , padx , pady )
152163
153164 self .cmSizer .Add (self .cmap_lab , 0 , wx .EXPAND | wx .ALIGN_RIGHT )
@@ -162,6 +173,11 @@ def __makeSizers(self):
162173 self .cmSizer .Add (self .cmax_txt , 0 , wx .EXPAND | wx .ALIGN_RIGHT )
163174 self .cmSizer .Add (self .cmOver_box , 0 , wx .EXPAND | wx .ALIGN_RIGHT )
164175
176+ self .cmSizer .Add (self .applyFilter_lab , 0 , wx .EXPAND | wx .ALIGN_RIGHT )
177+ self .cmSizer .Add (self .applyFilter_txt , 0 , wx .EXPAND | wx .ALIGN_RIGHT )
178+ self .cmSizer .Add (self .applyFilter_box , 0 , wx .EXPAND | wx .ALIGN_RIGHT )
179+
180+
165181 self .sizer = wx .BoxSizer (wx .VERTICAL )
166182 self .sizer .Add (self .tbarSizer , 0 , wx .EXPAND | wx .ALIGN_CENTER )
167183 self .sizer .Add (self .cmSizer , 0 , wx .EXPAND | wx .ALIGN_RIGHT )
@@ -219,6 +235,27 @@ def OnSetOver(self, e):
219235
220236 return
221237
238+ def OnSetFilterVal (self , e ):
239+ """set std dev for filter"""
240+
241+ self .filter_val = float (self .applyFilter_txt .GetValue ())
242+ self .update (updateImage = True )
243+
244+ return
245+
246+ def OnApplyFilter (self , e ):
247+ """toggle application of gauss-laplace filter in display"""
248+
249+ if e .IsChecked ():
250+ self .apply_filter = True
251+ else :
252+ self .apply_filter = False
253+ pass
254+
255+ self .update (updateImage = True )
256+
257+ return
258+
222259 pass # end class
223260#
224261# -----------------------------------------------END CLASS: cmapPanel
0 commit comments