Image
{# One button. An OME-Zarr image is a directory and an
OME-TIFF is a file, but which one you have is a fact
about the format rather than a question worth asking
-- mode "any" takes either (see native_dialog.py),
and what lands in the box is sniffed the moment it
arrives. #}
Browse…
OME-TIFF, TIFF, QPTIFF, whole-slide (SVS, NDPI, SCN, MRXS), PNG/JPEG, or an OME-Zarr (.zarr) folder.
Please provide a valid path to the image file.
{# Images a registered data node is serving. Shown only when
there are some, so an ordinary install never sees a
control for a thing it does not use. Clicking one fills
the field with `node://
/`, which the
field accepts as readily as a path. #}
{% set node_images = (node_resources or [])|selectattr("kind", "equalto", "image")|list %}
{% if node_images %}
or an image on a data node:
{% for choice in node_images %}
{{ choice.label }}
{% endfor %}
{% endif %}
{# The project's name. Not asked for at the top of the form
any more: the answer was always sitting in the field
above it -- the image's filename -- so this shows what
that came to and offers the pencil for the times it is
not what the project should be called.
One , readonly until the pencil is clicked,
rather than a caption plus a hidden field: two elements
would mean two copies of the name to keep in step, and
the one that posts is not the one anybody can see.
Hidden until there is a name, and `required` is carried
on and off with it by showProjectName() -- a hidden
required control refuses to submit with nothing on
screen to explain why. #}
Project name
{# Automatic first, and it is the right answer for almost
every file: a whole-slide format says what it is by
being one, and an OME-TIFF's storage layout says it
nearly as plainly. The other two options exist for the
file that says nothing -- a three-plane TIFF with no
metadata is genuinely ambiguous, and only the person who
ran the scan knows. Changeable afterwards on the
project's edit page, and it never rewrites the image. #}
Image type
Automatic
H&E / brightfield (RGB)
Fluorescence (multichannel)
Automatic reads the file's own metadata and pixel layout.
Segmentation Mask (optional)
{# A .zarr mask is a directory too -- the server has read
one since LocalSegmentationProvider was written. #}
Browse…
{% set node_masks = (node_resources or [])|selectattr("kind", "equalto", "segmentation")|list %}
{% if node_masks %}
or a mask on a data node:
{% for choice in node_masks %}
{{ choice.label }}
{% endfor %}
{% endif %}
Data (optional)
{# A .zarr store is a directory and a .csv/.h5ad is a
file, and one input takes both -- so one button
takes both. #}
Browse…
CSV, AnnData (.h5ad) or SpatialData (.zarr).
{# The laptop-share layout: the viewer runs beside the
images and the cell table never left the user's own
machine, served by a data node over the same
connection. Without this block that table is invisible
here, and the form quietly demands a file this machine
does not have. #}
{% set node_tables = (node_resources or [])|selectattr("kind", "equalto", "table")|list %}
{% if node_tables %}
or a table on a data node:
{% for choice in node_tables %}
{{ choice.label }}
{% endfor %}
{% endif %}
{# Shown only when the store holds more than one table. #}