Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unexpected Argument: 'vmin_vmax_sliders' #375

Closed
@brian1000

Description

@brian1000

Hello. I wanted to try the interactivity notebook from your scipy2023 talk linked here. Everything went alright except for the pieces of code that mentioned the vmin_vmax_slider of the ImageWidget, i.e.

# for the image data and contours
cnmf_iw = fpl.ImageWidget(
    movie, 
    vmin_vmax_sliders=True, 
    grid_plot_kwargs={"size": (600, 400)},
    cmap="gnuplot2",
)

and cnmf_iw.vmin_vmax_sliders[0].value = (-5, 15). I am not familiar with the fastplotlib library so I imagine some of the things changed since then. Could you please help me make the sliders work in the current version of fastplotlib or point me to the version that worked for this example?
This is the error I get:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[9], line 2
      1 # for the image data and contours
----> 2 cnmf_iw = fpl.ImageWidget(
      3     movie, 
      4     vmin_vmax_sliders=True, 
      5     grid_plot_kwargs={"size": (600, 400)},
      6     cmap="gnuplot2",
      7 )
      9 # temporal plot
     10 plot_temporal = fpl.Plot(size=(600,100))

File ~\anaconda3\envs\Ca2\lib\site-packages\fastplotlib\widgets\image.py:558, in ImageWidget.__init__(self, data, dims_order, slider_dims, window_funcs, frame_apply, grid_shape, names, grid_plot_kwargs, histogram_widget, **kwargs)
    556 frame = self._process_indices(d, slice_indices=self._current_index)
    557 frame = self._process_frame_apply(frame, data_ix)
--> 558 ig = ImageGraphic(frame, name="image_widget_managed", **kwargs)
    559 subplot.add_graphic(ig)
    560 subplot.name = name

File ~\anaconda3\envs\Ca2\lib\site-packages\fastplotlib\graphics\image.py:259, in ImageGraphic.__init__(self, data, vmin, vmax, cmap, filter, isolated_buffer, *args, **kwargs)
    201 def __init__(
    202     self,
    203     data: Any,
   (...)
    210     **kwargs,
    211 ):
    212     """
    213     Create an Image Graphic
    214 
   (...)
    256 
    257     """
--> 259     super().__init__(*args, **kwargs)
    261     data = to_gpu_supported_dtype(data)
    263     # TODO: we need to organize and do this better

TypeError: __init__() got an unexpected keyword argument 'vmin_vmax_sliders'

I'm currently working with the pip installation of fastplotlib[notebook] (v01.0a15) on windows 10 in jupyter lab. I'm using the demo data provided in the scipy2023 repo from which this ipynb originates. Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions