Skip to content

Conversation

@guiwitz
Copy link

@guiwitz guiwitz commented Jan 13, 2026

References and relevant issues

Improving the section about images was discussed at the napari hackaton and in a more general PR about docs reorganisation.

Description

The PR expands and modernizes the previous version. The main improvement is a more detailed section about using reader plugins to import formats not natively supported by napari. In more details, the section now:

  • shows how to use "bundle" importers, i.e. readers that group multiple readers for different formats. ndevio is used as an example
  • shows how to use a single-format reader with napari-meshio as an example
  • shows that different imports might generate different outcomes regarding dimensions. An example is shown on how to fix dimensions via a plugin using napari-skimage
  • shows how to deal if multiple readers are available for a single format

All the examples use downloadable data (from openmicroscopy and the BioImage Archive) and are generated, not screenshots. As discussed in #working-group-documentation > Capturing images, this implies that plugins are required to build the documentation. I added dependencies to pixi.toml, but being a complete beginner with it, someone should check if that's correct (especially given the multiple sections with dependencies). Also those dependencies might be missing when not using pixi?

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 13, 2026
Copy link
Contributor

@TimMonko TimMonko left a comment

Choose a reason for hiding this comment

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

@guiwitz this is BEAUTIFUL. Gorgeous, fantastic, amazing, well written, and inspiring. You clearly spent a ton of time on this and I'm absolutely LOVING this contribution. I don't have too many comments because I really like the organization and flow.

Also... Holy smokes @guiwitz I actually had a panic attack. 😱 Have you actually tried ndevio? It's certainly mature enough that I share it with folks, but to put it in here like this is both an honor and so intimidating. I am a big believer in it, so getting eyes on it would be great lol. I guess the main flaw with it is that it's pypi only at the moment. It looks like I'd be able to add it to conda-forge with bioio-ome-tiff and bioio-ome-zarr (and the option for bioio-lif) which would at least be a start! I will work on it this week (regardless!). Unfortunately, I don't know of another "catch-all" reader that works with modern napari, so that might be the one to go with.

Would be good to get feedback from others.
Also, this might be a good file to mention https://github.com/napari/napari-tiff . I havne't worked on this much, so hopefully others can describe its value better than I can.

I added dependencies to pixi.toml, but being a complete beginner with it, someone should check if that's correct (especially given the multiple sections with dependencies). Also those dependencies might be missing when not using pixi?

For this, we have the unfortunate problem that we would need to add the dependencies to napari's pyproject -- the full build workflow on CI will fail right now (if we trigger it with the bot). https://github.com/napari/napari/blob/326d0144b22b7808cd16dfeb49c48590d94869d9/pyproject.toml#L276-L304
It's one of those complicated issues with how we have things organized, sadly.

But we can test with pixi though locally! i.e. pixi run docs-live. For some reason it seems like the code blocks aren't showing outputs, despite seeing C:\Users\timmo\Documents\GitHub\napari-docs\docs\getting_started/open_images.md: Executing notebook using local CWD [mystnb]... so I'll try to look into it

Good news too, the additional dependencies don't add too much, which is good and should be easily maintainable:

  + P aicspylibczi          3.3.1
  + P aiobotocore           3.1.0
  + P aioitertools          0.13.0
  + P bioio                 3.2.0
  + P bioio-base            3.2.0
  + P bioio-czi             2.4.2
  + P bioio-imageio         1.3.0
  + P bioio-ome-tiff        1.4.0
  + P bioio-ome-zarr        3.2.1
  + P bioio-tifffile        1.3.0
  + P botocore              1.42.19
  + P cmake                 4.2.1
  + P elementpath           5.1.0
  + P imagecodecs           2026.1.1
  + P jmespath              1.0.1
  + P kerchunk              0.2.9
  + P macro-kit             0.4.10
  + P magic-class           0.7.20
  + P napari-meshio         0.0.2
  + P napari-skimage        0.6.0
  + P nbatch                0.0.4
  + P ndev-settings         0.4.0
  + P ndevio                0.7.0
  + P ome-types             0.6.3
  + P pydantic-extra-types  2.11.0
  + P pylibczirw            5.1.1
  ~ P pyqt5-sip             12.17.2   ->  12.18.0
  + P s3fs                  2026.1.0
  + P semver                3.0.4
  + P ujson                 5.11.0
  + P validators            0.35.0
  + P xmlschema             4.3.0
  + P xmltodict             1.0.2
  + P xsdata                25.7

nbscreenshot(viewer, alt_text="napari viewer showing a multi-channel CZI image opened via ndevio of Ostrinia nubilalis cells.")
```

On top of just allowing to open file formats, some plugins also provide additional tools, for example to explore metadata, offer import options, etc. The ndevio plugin for example provides widgets to export data and explore basic metadata via the `Plugins -> ndevio -> I/O utilities` menu. Here we see that valuable information about pixel size was recovered from the czi file metadata:
Copy link
Contributor

Choose a reason for hiding this comment

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

Once we release napari-metadata, I think this would be a good spot to also expose metadata (and would be my preference). At that point, I will likely reduce my I/O Utilities widget to be much slimmer and prioritize napari-metadata

Copy link
Author

Choose a reason for hiding this comment

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

I can also remove that section. But I find it useful to show that some readers offer more than just opening images. It's the case also e.g. for the napari-czitools (but I didn't want to have that plugin as a dependency).

nbscreenshot(viewer, alt_text="napari viewer showing a multi-channel TIFF image of E. coli cells opened via ndevio.")
```

In the case of badly interpreted dimensions, one can also reshape the data using certain plugins. For example the [napari-skimage](https://napari-hub.org/plugins/napari-skimage.html) plugin provides a tool to reshape layers via the `Plugins -> napari skimage -> Axis operations` menu. Here we use the `swap axes` function to exchange the X and Y axes:
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be another spot we can refer to napari-metadata

@TimMonko
Copy link
Contributor

TimMonko commented Jan 13, 2026

Alright, I figured out the build issue, it's the matter of the pooch cells timing out because of the download time. By default, the cell execution limit is 30 seconds.

nbclient.exceptions.CellTimeoutError: A cell timed out while it was being executed, after 30 seconds.
The message was: Cell execution timed out.
Here is a preview of the cell contents:
-------------------
['import pooch', 'import os', 'from pathlib import Path', 'import napari', 'from napari.utils import nbscreenshot']
...
['        url="https://downloads.openmicroscopy.org/images/OME-TIFF/2016-06/MitoCheck/00001_01.ome.tiff",', "        known_hash='7c5c8c7c3e3a09ec38eb478fec47fc3458ba9cc79dda924b918cba83572054ab',", "        fname = '00001_01.ome.tiff',", '        path=Path(os.path.expanduser("~"))', '        )']
-------------------

While I think it makes sense to increase the timeout for this individual cell, perhaps we also want to consider smaller downloads?

Aha, yes its all so beautiful now once the cells execute. Not sure about the geometry warning though
image

guiwitz and others added 3 commits January 13, 2026 18:40
Co-authored-by: Tim Monko <timmonko@gmail.com>
Co-authored-by: Tim Monko <timmonko@gmail.com>
Co-authored-by: Tim Monko <timmonko@gmail.com>

For demo purpose, we will use a sample image that comes with napari.
```{code-cell} ipython3
:execution: {"timeout": 300}
Copy link
Contributor

Choose a reason for hiding this comment

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

oops, maybe this needs to be a string? The docs aren't making it obvious to me, where it looks like it doesn't need to be a string... https://myst-nb.readthedocs.io/en/latest/computation/execute.html#execution-timeout
I'm confused, but making it a string seemed to fix it locally... 🤷 I don't know why its not something like :tags: [execution_timeout = 300] I'm confused lol

Suggested change
:execution: {"timeout": 300}
:execution: {"timeout": "300"}

I currently get this error...

Exception occurred:
  File "C:\Users\timmo\Documents\GitHub\napari-docs\.pixi\envs\default\Lib\site-packages\nbformat\validator.py", line 509, in validate
    raise error
nbformat.validator.NotebookValidationError: 300 is not of type 'string'

Failed validating 'type' in notebook['properties']['metadata']['properties']['execution']['patternProperties']['^.*$']:

On instance['metadata']['execution']['timeout']:
300
The full traceback has been saved in C:\Users\timmo\AppData\Local\Temp\sphinx-err-bny55o5w.log, if you want to report the issue to the developers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe it should be in the config at the top of the notebook?

Copy link
Author

Choose a reason for hiding this comment

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

I noted the same issue when trying to transforming the md file to notebook with jupytext complaining about that timeout, but I haven't figured out a solution yet. Will investigate more...

@TimMonko TimMonko added this to the 0.7.0 milestone Jan 13, 2026
@guiwitz
Copy link
Author

guiwitz commented Jan 15, 2026

Regarding dependencies: is there an explanation anywhere on the "machinery" used to build docs? It's not clear to me why the dependencies have to be added to napari.

@melissawm
Copy link
Member

I don't think there's anything beyond https://napari.org/stable/tutorials/fundamentals/installation.html#using-constraints-files . Unfortunately since we're using the two repos it's a bit convoluted, but this allows us to do

pip install napari[docs]

and have the docs dependencies follow the general constraints required for reliably building napari itself.

Copy link
Contributor

@DragaDoncila DragaDoncila left a comment

Choose a reason for hiding this comment

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

This is awesome @guiwitz 🤩 ! I left a couple of comments, but I think once we figure out the CI issues this is ready to go in. I mentioned to Tim earlier today that it would be great to expand a bit on the different File -> Open options (File, File(s), File(s) as stack, Folder...), but that should come in a separate PR imo.

guiwitz and others added 5 commits January 16, 2026 13:29
Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>
Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>
Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>
Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>
Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants