-
-
Notifications
You must be signed in to change notification settings - Fork 412
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vortex optical flow example #6041
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6041 +/- ##
==========================================
- Coverage 91.98% 91.92% -0.07%
==========================================
Files 596 596
Lines 52638 52638
==========================================
- Hits 48421 48389 -32
- Misses 4217 4249 +32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a useful example. The flashing during playback should be opt-in.
I was wondering how I would make it opt-in @kephale... Do I just add both the normal contrast frames and the concatenated frames and make the concatenated version invisible? I could even add only the reverse contrast frames with an offset. But I worry both those options will be confusing... I could also get rid of it altogether... But it's fun to see, no? 馃槂 |
I could see something like this helping in the long term: #6045 An short-term alternative is to use a colormap for |
Ok, poked a little more and I'm leaning to:
The vector lines need tweaking to be visible, but it still has the cool visual effect with less strobing. However, I would still be pretty tempted to not show Screen.Recording.2023-07-08.at.8.27.18.AM.mov |
Then you would lose the illusion which is the whole point of the thing! 馃槀 The effect only works when you invert the contrast of the whole image. The only way to make it less stroby is to use a different image that has ~50% white pixels. And I'm not 100% convinced it would work anyway. I'm happy to drop it, I just thought it was a cute application and wanted to write it down somewhere. 馃槂 I'll do the standard vortex here and save the reverse-phi for my (long neglected) napari-demos repo. Also what on earth did you do to my vectors 馃槀 |
Screen.Recording.2023-07-09.at.8.49.08.AM.movThis seems to keep a balance between maintaining the illusion and having a gentle transition. Yeah, vectors are super borked right now. [edit: code here https://gist.github.com/kephale/8707eb105fc8c52168c1db16ac836580] |
It seems magic_name doesn鈥檛 work for vectors!
@kephale @napari/core-devs I've removed the reverse-phi illusion because (a) it was a bit controversial and (b) anyway it made the example more complicated than it needed to be. The reverse-phi demo lives on at https://github.com/jni/napari-demos/blob/main/vortex.py Since @kephale already approved this and it doesn't affect the main code in any way, I'm going to add the "ready-to-merge" label. |
@jni could you fix milestone? |
This got the "Ready-to-merge" label 2 days ago and got no objections. Merging to move the queue forward. Thanks. |
* main: (59 commits) Fix permission for JasonEtco/create-an-issue@v2 action (napari#6370) Ensure the conda bundle workflows have the appropriate permissions (napari#6379) Exclude the loaded property when linking two layers (napari#6377) Automatic add `maintenance` label to upgrade dependecies workflow (napari#6371) Pydantic 2 compatibility using `pydantic.v1` (napari#6358) Update `fsspec`, `imageio`, `magicgui`, `napari-console`, `npe2`, `pillow`, `tensorstore`, `xarray` (napari#6367) fix `TransformChain.__getitem__` signature (napari#6369) Fix some typing in napari._vispy (napari#6245) Fix typing in napari.utils.theme (napari#6247) Fix typing in napari.layers.base (napari#6028) Fix build wheel workflow file name (napari#6357) Fix upstream deprecation: change `np.alltrue` to `np.array_equiv` (napari#6347) Add codecov token to reduce propability of fail to upload from main branch (napari#6346) Disable ptrace protection to make pytest-pystack work (napari#6343) Update example scripts (magicgui with threads) (napari#6353) Update `dask`, `hypothesis`, `numpy`, `pillow`, `pretend`, `psutil`, `pyqt5`, `pyqt6`, `pyside6`, `superqt` (napari#6322) Add vortex optical flow example (napari#6041) Enable memory benchmarks for layers (napari#6295) Fix labeler configuration (napari#6344) Add 'raise' option back to `strict_qt` in `make_napari_viewer` (napari#6335) ...
Fixes/Closes
Add example of optical flow to the gallery, based on scikit-image.
Epilepsy warning: the movie has some bright/dark flashing.
Screen.Recording.2023-07-06.at.8.05.37.pm.mov
I can remove the reverse phi stuff if people think it's too annoying/dangerous. But it's cool, thought I'd pull up a flashback from my postdoc 馃槀