Skip to content

Commit

Permalink
Merge pull request #17554 from davelopez/enhance_avivator_display_app
Browse files Browse the repository at this point in the history
Enhance Avivator display app to support regular Tiffs
  • Loading branch information
mvdbeek authored Feb 27, 2024
2 parents 8b2074a + 110f46f commit bd49ba4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lib/galaxy/config/sample/datatypes_conf.xml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@
<datatype extension="cnr" type="galaxy.datatypes.tabular:Tabular" subclass="true" display_in_upload="true"/>
<datatype extension="hhr" type="galaxy.datatypes.data:Text" subclass="true" display_in_upload="true"/>
<datatype extension="jpg" type="galaxy.datatypes.images:Jpg" mimetype="image/jpeg"/>
<datatype extension="tiff" type="galaxy.datatypes.images:Tiff" mimetype="image/tiff" display_in_upload="true"/>
<datatype extension="tiff" type="galaxy.datatypes.images:Tiff" mimetype="image/tiff" display_in_upload="true">
<display file="image/avivator.xml"/>
</datatype>
<datatype extension="tf2" type="galaxy.datatypes.images:Tiff" subclass="true" display_in_upload="false"/>
<datatype extension="tf8" type="galaxy.datatypes.images:Tiff" subclass="true" display_in_upload="false"/>
<datatype extension="btf" type="galaxy.datatypes.images:Tiff" subclass="true" display_in_upload="false"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<display id="avivator" version="1.0.0" name="display at">
<link id="main" name="Avivator">
<url>http://avivator.gehlenborglab.org/?image_url=${qp($tiff_file.url)}</url>
<param type="data" name="tiff_file" url="galaxy_${DATASET_HASH}.ome.tiff" allow_cors="true"/>
<param type="data" name="tiff_file" url="galaxy_${DATASET_HASH}.${dataset.extension}" allow_cors="true"/>
<param type="data" name="offsets_file" url="galaxy_${DATASET_HASH}.offsets.json" metadata="offsets" allow_cors="true"/>
</link>
</display>
8 changes: 4 additions & 4 deletions lib/galaxy/datatypes/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ class Png(Image):
class Tiff(Image):
edam_format = "format_3591"
file_ext = "tiff"


class OMETiff(Tiff):
file_ext = "ome.tiff"
MetadataElement(
name="offsets",
desc="Offsets File",
Expand All @@ -120,6 +116,10 @@ def set_meta(
json.dump(offsets, f)
dataset.metadata.offsets = offsets_file


class OMETiff(Tiff):
file_ext = "ome.tiff"

def sniff(self, filename: str) -> bool:
with tifffile.TiffFile(filename) as tif:
if tif.is_ome:
Expand Down

0 comments on commit bd49ba4

Please sign in to comment.