-
Notifications
You must be signed in to change notification settings - Fork 53
ImageWidget #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImageWidget #51
Conversation
basic image widget without gridplot is functional, takes slider axes arguments BasicCan choose the dimension index that the slider should use is desired img_widget.mp4Complex axes order argumentsBy default it assumes that the "t" dimension is for the slider but any dimension can be used for the slider img_widget_axes.mp4 |
If it is a single plot and not a gridplot, we can show a z-axis slider vertically. Maybe once #30 is done we can use the docked viewports to show sliders for individual subplots by creating widgets using |
…try the crazier combinations
basic functionality of simple and gridplots work! img_widget_both.mp4Did some light testing, errors for basic user mistakes are caught correctly, tried different kwargs like this, need to test more thoroughly. a = np.random.rand(100, 512, 512, 5)
b = np.random.rand(100, 512, 512, 5)
c = np.random.rand(100, 512, 512, 7)
d = np.random.rand(100, 512, 512, 7)
iw = ImageWidget([a, b, c, d], slider_axes=["t", "z"], axes_order="txyz", cmap="gnuplot2")
iw.show() |
can now average across multiple dims in both single and gridplots
averaging in single plotsimgwidget_avg_single.mp4averaging multiple dims in gridplot (can also average multiple dims in single plot)imgwidget_avg_grid.mp4 |
…dget does auto vmin vmax
just for fun, 66 for handling all the possible args 🙃 |
start implementing #31
TODO:
quick_min_max()
bool
kwarg for vmin vmax range-slidersaxes_order
andslider_axes
window_function
to allow applying a function along chosen dimension(s) using a window around the current indexslice_avg
so that a user can just pass any function that takes anaxis
argument. They can create a wrapper if it doesn't take anaxis
kwarg.window_funcs = {"t": (np.mean, 5), "z": None})
frame_apply
, user can provide a single function (for simple plot) or a dict of functions mapping eachdata
array to a function that is called and applied on each slice before it is displayed. This function is called on the output of thewindow_function
if it exists. These function(s) must return a 2D array-like