Skip to content
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

MVP of napari viewer #30

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

MVP of napari viewer #30

wants to merge 4 commits into from

Conversation

ieivanov
Copy link
Collaborator

@ieivanov ieivanov commented Apr 30, 2023

fixes #12

Intended usage

  • start mantis acquisition
  • open separate terminal window and run viewer with python viewer.py /path/to/dataset, for example, python .\viewer.py "Q:\Ivan\testing\mantis_acquisition_test_12"

On the terminal you'll see messages such as

Reading index... 0.4%       C:\Users\Cameron\miniconda3\envs\mantis\lib\site-packages\ndtiff\nd_tiff_current.py:570: UserWarning: Index appears to not have been properly terminated (the dataset may still work)!

That's OK, that is currently the expected behavior. When viewing the data, you may also occasionally see a "seek of closed file error" (or something like that) - that's OK too, it doesn't cause any problems.

I've tested this viewer with the demo acquisition, and it seems to run well, without disturbing the ongoing acquisition. Will also test on the mantis.

TODO:

  • start viewer with the acquisition engine with a call to subprocess.Popen(["python", "viewer.py", "/path/to/dataset"])
  • add niceties such that proper scaling, overlays, colors, auto-contrast, etc...

@ieivanov ieivanov changed the title add viewer MVP of napari viewer May 2, 2023
@ieivanov ieivanov marked this pull request as ready for review May 2, 2023 22:17

if lf_data is not None and ls_data is not None:
# update data
try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be slightly faster to check the key with something like:

if LF_LAYER_NAME not in viewer.layers:
    viewer.add_image(...)
else:
    ...
if LS_LAYER_NAME not in viewer.layers:
    ...
else:
    ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yield (lf_data, ls_data)

if time.time() - t_start < 60:
if _verbose:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be logging.debug instead?

@ziw-liu
Copy link
Contributor

ziw-liu commented May 17, 2023

That's OK, that is currently the expected behavior. When viewing the data, you may also occasionally see a "seek of closed file error" (or something like that) - that's OK too, it doesn't cause any problems.

Linking micro-manager/NDStorage#110

@edyoshikun
Copy link
Contributor

In today's copylot meeting, @AhmetCanSolak showed copylot's Viewer which is faster and less laggy than napari viewer. This can be found here and imported very similarly to napari's. Should we also try this ?

@ieivanov
Copy link
Collaborator Author

ieivanov commented Jun 6, 2023

I don't anticipate napari's speed to be an issue here: we don't actually stream live data. I also like that napari is fully featured - has overlays, scales, colormaps, etc. that we already know how to use. The vispy viewer seems better fit for live streaming applications, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement viewer
3 participants