diff --git a/omero_vitessce/templates/omero_vitessce/vitessce_open_with.html b/omero_vitessce/templates/omero_vitessce/vitessce_open_with.html new file mode 100644 index 0000000..5a40e74 --- /dev/null +++ b/omero_vitessce/templates/omero_vitessce/vitessce_open_with.html @@ -0,0 +1,192 @@ + +{% extends "webgateway/base/base_header.html" %} +{% block content %} + +
+ {% if json_configs %} +

Please select an attached config file from the list below:

+ + {% else %} +

There are no config files attached!

+

To use the viewer you can attach a .json config file and refresh the panel.

+ {% endif %} +
+ {% if form %} +

Or use the form below to generate a new config file:

+
+ {% csrf_token %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Vitessce viewer configuration
{{ form.config_file_name.label_tag }} + {{ form.config_file_name.help_text }} +
{{ form.config_file_name }}
+ Images
{{ form.images.label_tag }} + {{ form.images.help_text }} +
{{ form.images }}
+ Cell Data
{{ form.segmentation.label_tag }} + {{ form.segmentation.help_text }} +
{{ form.segmentation }}
{{ form.cell_identities.label_tag }} + {{ form.cell_identities.help_text }} +
{{ form.cell_identities }}
{{ form.cell_id_column.label_tag }} + {{ form.cell_id_column.help_text }} +
{{ form.cell_id_column }}
{{ form.cell_label_column.label_tag }} + {{ form.cell_label_column.help_text }} +
{{ form.cell_label_column }}
{{ form.expression.label_tag }} + {{ form.expression.help_text }} +
{{ form.expression }}
{{ form.embeddings.label_tag }} + {{ form.embeddings.help_text }} +
{{ form.embeddings }}
{{ form.embedding_x.label_tag }} + {{ form.embedding_x.help_text }} +
{{ form.embedding_x }}
{{ form.embedding_y.label_tag }} + {{ form.embedding_y.help_text }} +
{{ form.embedding_y }}
+ Molecule Data
{{ form.molecule_id.label_tag }} + {{form.molecule_id.help_text}} +
{{ form.molecules }}
{{ form.molecule_id.label_tag }} + {{ form.molecule_id.help_text }} +
{{ form.molecule_id }}
{{ form.molecule_label.label_tag }} + {{ form.molecule_label.help_text }} +
{{ form.molecule_label }}
{{ form.molecule_x.label_tag }} + {{ form.molecule_x.help_text }} +
{{ form.molecule_x }}
{{ form.molecule_y.label_tag }} + {{ form.molecule_y.help_text }} +
{{ form.molecule_y }}
+ Additional views
{{ form.histograms.label_tag }} + {{ form.histograms.help_text }} +
{{ form.histograms }}
{{ form.heatmap.label_tag }} + {{ form.heatmap.help_text }} +
{{ form.heatmap }}
{{ form.status.label_tag }} + {{ form.status.help_text }} +
{{ form.status }}
{{ form.description.label_tag }} + {{ form.description.help_text }} +
{{ form.description }}
+ +
+ {% else %} +

Autogenerating config files requires the + omero-web-zarr + plugin which seems not to be available.

+ {% endif %} +
+{% endblock %} diff --git a/omero_vitessce/views.py b/omero_vitessce/views.py index 72cf577..220d971 100644 --- a/omero_vitessce/views.py +++ b/omero_vitessce/views.py @@ -73,13 +73,9 @@ def vitessce_open(request, conn=None, **kwargs): if request.GET.get("dataset") is not None: obj_type = "dataset" obj_id = int(request.GET.get("dataset")) - elif request.GET.get("image") is not None: + if request.GET.get("image") is not None: obj_type = "image" obj_id = int(request.GET.get("image")) - else: - context = {"json_configs": dict(), - "obj_type": obj_type, "obj_id": obj_id} - return render(request, "omero_vitessce/vitessce_panel.html", context) _, config_urls = get_attached_configs(obj_type, obj_id, conn) @@ -88,4 +84,12 @@ def vitessce_open(request, conn=None, **kwargs): else: context = {"json_configs": dict(), "obj_type": obj_type, "obj_id": obj_id} - return render(request, "omero_vitessce/vitessce_panel.html", context) + if OMERO_WEB_ZARR: + files, urls, img_files, img_urls = get_files_images( + obj_type, obj_id, conn) + form = ConfigForm(file_names=files, file_urls=urls, + img_names=img_files, img_urls=img_urls) + context["form"] = form + else: + context["form"] = None + return render(request, "omero_vitessce/vitessce_open_with.html", context) diff --git a/setup.py b/setup.py index cde44fd..e19759f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="omero-vitessce", - version="1.0.5", + version="1.0.6", description="OMERO Vitessce multimodal data viewer plugin for OMERO.web", long_description=open('README.md').read(), long_description_content_type='text/markdown',