Skip to content

Commit

Permalink
Merge pull request #69 from kostrykin/bfconvert
Browse files Browse the repository at this point in the history
disables generation of pyramids for output formats which do not support pyramids in `bfconvert` tool
  • Loading branch information
bgruening authored Aug 30, 2023
2 parents 71dae1d + 6bd6644 commit e27798c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions tools/bfconvert/bfconvert.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="ip_convertimage" name="Convert image" version="6.7.0+galaxy0">
<tool id="ip_convertimage" name="Convert image" version="6.7.0+galaxy1">
<description>Convert image</description>
<requirements>
<requirement type="package" version="6.7.0">bftools</requirement>
Expand Down Expand Up @@ -27,7 +27,7 @@
#if $tile_options['extract'] == 'True'
-tilex $tile_options.tile_x -tiley $tile_options.tile_y
#end if
#if $pyramid_options.generate == 'True'
#if $pyramid_options.generate == 'True' and $out_format not in ['png', 'jpg', 'eps', 'avi']
-pyramid-resolutions $pyramid_options.pyramid_resolutions
-pyramid-scale $pyramid_options.pyramid_scale
#end if
Expand All @@ -36,7 +36,7 @@
#if $compression != 'False'
-compression $compression
#end if
'$input_file' './res.$out_format' &&
'$input_file' './res.$out_format' &&
mv './res.$out_format' ./result_image
]]>
</command>
Expand Down Expand Up @@ -128,14 +128,15 @@
</when>
</conditional>
<conditional name="pyramid_options">
<param label="Pyramid image" name="generate" type="select">
<param label="Pyramid image" name="generate" type="select" help="Pyramids will be generated only if the selected output format supports pyramids (OME TIFF, JPEG 2000)."><!-- see: https://docs.openmicroscopy.org/bio-formats/6.7.0/supported-formats.html -->
<option selected="True" value="True">Generate Pyramid</option>
<option value="False">No Pyramid</option>
</param>
<when value="True">
<param name="pyramid_resolutions" type="integer" value="4" label="Pyramid Resolutions"/>
<param name="pyramid_scale" type="integer" value="2" label="Pyramid Scale" />
</when>
<when value="False" />
</conditional>
<param name="bigtiff" label="Big TIFF" type="boolean" checked="false" truevalue="-bigtiff" falsevalue=""/>
<param name="noflat" label="No Flatten" type="boolean" checked="true" truevalue="-noflat" falsevalue=""/>
Expand Down Expand Up @@ -170,11 +171,18 @@
<test>
<param name="input_file" value="input.png" />
<param name="out_format" value="ome.tiff" />
<param name="pyramid_options.generate" value="True"/>
<param name="pyramid_options.pyramid_resolutions" value="4"/>
<param name="pyramid_options.pyramid_scale" value="2"/>
<conditional name="pyramid_options">
<param name="generate" value="True"/>
<param name="pyramid_resolutions" value="4"/>
<param name="pyramid_scale" value="2"/>
</conditional>
<output name="output" value="res.ome.tiff" ftype="ome.tiff" compare="sim_size"/>
</test>
<test>
<param name="input_file" value="input.tiff" />
<param name="out_format" value="png" />
<output name="output" value="input.tiff.png" ftype="png" compare="sim_size"/>
</test>
</tests>
<help>
**What it does**
Expand Down
Binary file added tools/bfconvert/test-data/input.tiff
Binary file not shown.
Binary file added tools/bfconvert/test-data/input.tiff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e27798c

Please sign in to comment.