GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ImageWidget by kushalkolar · Pull Request #51 · fastplotlib/fastplotlib

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Dec 2, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

start implementing #31

TODO:

  • Simple plot
  • grid plot
  • implement quick_min_max()
  • bool kwarg for vmin vmax range-sliders
  • maybe rename "axes" to dimensions/dims to prevent confusion with matplotlib axes
  • test all combinations of kwargs for axes_order and slider_axes
    • in progress
  • implement window_function to allow applying a function along chosen dimension(s) using a window around the current index
    • change the current slice_avg so that a user can just pass any function that takes an axis argument. They can create a wrapper if it doesn't take an axis kwarg.
      • arg in the form like: window_funcs = {"t": (np.mean, 5), "z": None})
  • implement frame_apply, user can provide a single function (for simple plot) or a dict of functions mapping each data array to a function that is called and applied on each slice before it is displayed. This function is called on the output of the window_function if it exists. These function(s) must return a 2D array-like

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kushalkolar
started implementation of ImageWidget, nothing is tested yet
1fea4aa
@kushalkolar
kushalkolar requested a review from clewis7 December 2, 2022 03:58
kushalkolar added 2 commits December 1, 2022 23:41
@kushalkolar
basic stuff finished for single plot with a slider, need to test
1bc65a0
@kushalkolar
basic image widget works
6592cc3
@kushalkolar

kushalkolar commented Dec 2, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

basic image widget without gridplot is functional, takes slider axes arguments

Basic

Can choose the dimension index that the slider should use is desired

img_widget.mp4

Complex axes order arguments

By default it assumes that the "t" dimension is for the slider but any dimension can be used for the slider

img_widget_axes.mp4
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Dec 2, 2022

Copy link
Copy Markdown
Member Author

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 pygfx objects.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Dec 2, 2022
Update names of graphic classes #52
Closed
Update demo nb to use ImageWidget nel-lab/mesmerize-core#137
Closed
kushalkolar added 4 commits December 2, 2022 13:08
@kushalkolar
docs
658f298
@kushalkolar
splitting imagewidget into two classes
5cc91ae
@kushalkolar
split ImageWidget into ImageWidgetSingle and later ImageWidgetGrid
7a6a136
@kushalkolar
combined single and grid ImageWidget into single class
7cce91f
@kushalkolar kushalkolar mentioned this pull request Dec 4, 2022
create array-like object for reconstructed movie, background and residuals nel-lab/mesmerize-core#139
Closed
kushalkolar added 2 commits December 4, 2022 03:18
@kushalkolar
simple and grid image widget works, tested with simple args, need to …
56a9b1c
…try the crazier combinations
@kushalkolar
catch another user error
79f4452
@kushalkolar

kushalkolar commented Dec 4, 2022

Copy link
Copy Markdown
Member Author

basic functionality of simple and gridplots work!

img_widget_both.mp4

Did 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()
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
fix type annotation
e4f6b12
@kushalkolar kushalkolar added this to the v0.1 alpha 6 milestone Dec 4, 2022
kushalkolar added 2 commits December 4, 2022 18:00
@kushalkolar
docstrings, started slice_avg implementation
5028ce7
@kushalkolar
slice averaging on single and multiple dimensions works perfectly
5ef32eb
@kushalkolar

kushalkolar commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

can now average across multiple dims in both single and gridplots

slice_avg is a property that can be modified at any time

averaging in single plots

imgwidget_avg_single.mp4

averaging multiple dims in gridplot (can also average multiple dims in single plot)

imgwidget_avg_grid.mp4
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
is_array() checks for and attr, better error messages
eca6599
This was referenced Dec 8, 2022
Lazy arrays nel-lab/mesmerize-core#140
Merged
Roadmap 2026 #55
Open
kushalkolar added 6 commits December 9, 2022 22:46
@kushalkolar
rename axis -> dims
0e3cf16
@kushalkolar
make most imagewidget methods private, most attributes as read-only p…
570c076
…roperties
@kushalkolar
quick_min_max() returns pre-computed min max if int or float, imagewi…
4764b84
…dget does auto vmin vmax
@kushalkolar
vmin vmax for gridplot
afc0378
@kushalkolar
Merge branch 'master' into high-level-widgets
fc3365b
@kushalkolar
update Image -> ImageGraphic
b1e922c
kushalkolar added 2 commits December 11, 2022 04:43
@kushalkolar
refactor, window_funcs now works very well, slow with multiple dims b…
e6c5d3a
…ut it's a numpy thing
@kushalkolar
vminmax works, also added names for subplots, everything works
64faffd
@kushalkolar
kushalkolar marked this pull request as ready for review December 11, 2022 10:17
@kushalkolar
proper-ish image widget example
8fc63b3
@kushalkolar

kushalkolar commented Dec 11, 2022

Copy link
Copy Markdown
Member Author

just for fun, ImageWidget has:

66 if statements
11 elif
15 else
21 for loops
35 possible raise

for handling all the possible args 🙃

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
kushalkolar merged commit 0bdddf7 into master Dec 11, 2022
@kushalkolar kushalkolar mentioned this pull request Dec 14, 2022
dsavg movie class nel-lab/mesmerize-core#61
Closed
@kushalkolar
kushalkolar deleted the high-level-widgets branch December 25, 2022 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@clewis7 clewis7 Awaiting requested review from clewis7

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

v0.1 alpha 6

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@kushalkolar
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.