ShowFolder session browser

ShowFolder session browser#

Open in Colab

Use ShowFolder at the start of a microscopy session review, when you have a folder full of files and want to know what is worth keeping before writing per-file analysis code.

The widget gives you a practical first pass:

  • HAADF/STEM images appear first as small session rows grouped by magnification and acquisition order.

  • Each row is a compact Show3D stack so you can flip through nearby acquisitions without filling the page with repeated panels.

  • EDS spectrum-image files are listed in the inventory when present; open them explicitly with ShowEDS when you want spectrum-image analysis.

  • The inventory table stays nearby for filenames, magnification, scan rotation, shape, file type, and group.

  • Stars let you keep track of useful image files without moving or deleting raw data.

The example below downloads showfolder_gold(size="small"), a compact real gold HAADF .emd session from Hugging Face under widget-tutorials/showfolder/gold-haadf-session/small: 26 files with repeated 0/90 degree views and overview images. Then it runs the same one-line API you would use on a microscope session folder. Replace folder with your own data path when you work with local files.

from quantem.widget import ShowFolder
from quantem.widget.datasets import showfolder_gold

folder = showfolder_gold(size="small", verbose=False, allow_fallback=False)

ShowFolder(
    folder,
    thumb=256,
    title="Gold HAADF ShowFolder browser",
    save_state=True,  # small docs demo only; omit for large real folders
)

The widget output is the important part of the workflow: browse the folder first, then decide what deserves follow-up.

Work top to bottom: scan the session rows, then star useful image frames. Use the selection panel at the bottom to save .quantem-showfolder.json; this keeps your review state next to the data without changing the raw files.

When you reopen the same folder, the saved selection is loaded again. That makes the next notebook cleaner: you can continue with only the files you marked during folder browsing.

Exact field-of-view mode#

The default session rows are usually the best first pass. They group by magnification and acquisition order, which works even when metadata is incomplete and avoids pretending that every nearby file is the exact same region.

If your session has reliable stage/FOV metadata and your specific question is direct repeated-field comparison, use exact field-of-view grouping:

ShowFolder(folder, thumb=256, group_by="fov", group_view="stack")

That mode intentionally creates small rows, often only 2-4 files, because dose and time usually limit how many times the same field is revisited.

Command line#

Generate the same review notebook or a standalone HTML browser from a terminal. The HTML file is useful when you want to share the first-pass folder browser with someone who should not need to run Jupyter:

quantem showfolder /path/to/microscopy-folder --notebook showfolder.ipynb --thumb 256
quantem showfolder /path/to/microscopy-folder --html showfolder.html --thumb 256

For exact repeated-field grouping, add --group-by fov:

quantem showfolder /path/to/microscopy-folder --notebook showfolder.ipynb --thumb 256 --group-by fov