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

Add support for ?show=fileset-123 #514

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions omeroweb/webclient/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Show(object):
"well",
"tagset",
"roi",
"fileset",
)

# Regular expression which declares the format for a "path" used either
Expand Down Expand Up @@ -270,6 +271,16 @@ def _load_first_selected(self, first_obj, attributes):
first_selected = self._load_tag(attributes)
elif first_obj == "well":
first_selected = self._load_well(attributes)
elif first_obj == "fileset":
# Don't use getObjects() for fileset since it loads ALL file and images
params = omero.sys.ParametersI()
params.addId(attributes["id"])
params.page(0, 1)
query = "select img from Image img where img.fileset.id=:id order by img.id"
first_image = self.conn.getQueryService().findAllByQuery(
query, params, self.conn.SERVICE_OPTS
)[0]
first_selected = self.conn.getObject("Image", first_image.id.val)
else:
# All other objects can be loaded by type and attributes.
(first_selected,) = self.conn.getObjects(first_obj, attributes=attributes)
Expand Down Expand Up @@ -308,6 +319,8 @@ def _load_first_selected(self, first_obj, attributes):
if first_obj == "roi":
first_obj = "image"
first_selected = first_selected.getImage()
elif first_obj == "fileset":
first_obj = "image"

# Tree hierarchy open to first selected object.
self._initially_open = ["%s-%s" % (first_obj, first_selected.getId())]
Expand Down
Loading