@@ -325,10 +325,11 @@ def show(
325325 The port that will be used by the server. If None, a random port will be
326326 selected from the range 1024-65536. Default None
327327 pickerfun : function or None, optional
328- Should be a function that takes two arguments, a voxel index and a vertex
329- index. Is called whenever a location on the surface is clicked in the
330- viewer. This can be used to print information about individual voxels or
331- vertices, plot receptive fields, or many other uses. Default None
328+ Should be a function that takes three arguments, a 3-D voxel vector, a
329+ vertex index, and the hemisphere ("left" or "right"). Is called whenever
330+ a location on the surface is clicked in the viewer. This can be used to
331+ print information about individual voxels or vertices, plot receptive
332+ fields, or many other uses. Default None
332333 recache : bool, optional
333334 Force recreation of CTM and SVG files for surfaces. Default False
334335 template : string, optional
@@ -452,7 +453,7 @@ def show(
452453 my_viewopts [sec ] = dict (options .config .items (sec ))
453454
454455 if pickerfun is None :
455- pickerfun = lambda a , b : None
456+ pickerfun = lambda * a : None
456457
457458 class CTMHandler (web .RequestHandler ):
458459 def get (self , path ):
@@ -888,7 +889,10 @@ def make_movie_views(self, animation, filename="brainmovie%07d.png",
888889
889890 class PickerHandler (web .RequestHandler ):
890891 def get (self ):
891- pickerfun (int (self .get_argument ("voxel" )), int (self .get_argument ("vertex" )))
892+ voxel : tuple [int , int , int ] = tuple (int (i ) for i in self .get_argument ("voxel" ).split ("," ))
893+ vertex : int = int (self .get_argument ("vertex" ))
894+ hemi : str = self .get_argument ("hemi" )
895+ pickerfun (voxel , vertex , hemi )
892896
893897 class WebApp (serve .WebApp ):
894898 disconnect_on_close = autoclose
0 commit comments