Skip to content

Commit

Permalink
Merge pull request #120 from kostrykin/update/dev
Browse files Browse the repository at this point in the history
undefined
  • Loading branch information
kostrykin authored Apr 25, 2024
2 parents c86a1b9 + 50c4ea6 commit 60cf803
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tools/overlay_images/overlay_images.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<import>creators.xml</import>
<import>tests.xml</import>
<token name="@TOOL_VERSION@">0.0.4</token>
<token name="@VERSION_SUFFIX@">2</token>
<token name="@VERSION_SUFFIX@">3</token>
</macros>
<creator>
<expand macro="creators/bmcv"/>
Expand Down Expand Up @@ -51,13 +51,13 @@
<option value="seg_contour">Segmentation contours over image</option>
</param>
<when value="coloc_vis">
<param name="im1" type="data" format="tiff,png" label="Image #1 (red channel)" />
<param name="im2" type="data" format="tiff,png" label="Image #2 (green channel)" />
<param name="im1" type="data" format="tiff,png" label="Image 1 (red channel)" />
<param name="im2" type="data" format="tiff,png" label="Image 2 (green channel)" />
</when>
<when value="blending">
<param name="im1" type="data" format="tiff,png" label="Image #1" />
<param name="im2" type="data" format="tiff,png" label="Image #2" />
<param name="alpha" type="float" value="0.5" min="0.0" max="1.0" label="The weight for blending: I_out = (1 - w) * I_1 + w * I_2."/>
<param name="im1" type="data" format="tiff,png" label="Image 1" />
<param name="im2" type="data" format="tiff,png" label="Image 2" />
<param name="alpha" type="float" value="0.5" min="0.0" max="1.0" label="The weight for blending: result = (1 - weight) * image1 + weight * image2." />
</when>
<when value="seg_contour">
<param name="im1" type="data" format="tiff,png" label="Intensity image" />
Expand Down
8 changes: 8 additions & 0 deletions tools/repeat_channels/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
categories:
- Imaging
description: Convert single-channel to multi-channel image
long_description: This tools converts a single-channel image to a multi-channel image by repeating the channel multiple times.
name: repeat_channels
owner: imgteam
homepage_url: https://github.com/bmcv
remote_repository_url: https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/repeat_channels/
1 change: 1 addition & 0 deletions tools/repeat_channels/creators.xml
19 changes: 19 additions & 0 deletions tools/repeat_channels/repeat_channels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import argparse

import giatools.io
import numpy as np
import skimage.io


if __name__ == '__main__':

parser = argparse.ArgumentParser()
parser.add_argument('input', type=str)
parser.add_argument('count', type=int)
parser.add_argument('output', type=str)
args = parser.parse_args()

im = giatools.io.imread(args.input)
im = np.squeeze(im)
im = np.dstack([im] * args.count)
skimage.io.imsave(args.output, im)
61 changes: 61 additions & 0 deletions tools/repeat_channels/repeat_channels.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<tool id="repeat_channels" name="Convert single-channel to multi-channel image" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05">
<description>with NumPy</description>
<macros>
<import>creators.xml</import>
<import>tests.xml</import>
<token name="@TOOL_VERSION@">1.26.4</token>
<token name="@VERSION_SUFFIX@">0</token>
</macros>
<creator>
<expand macro="creators/bmcv"/>
</creator>
<edam_operations>
<edam_operation>operation_3443</edam_operation>
</edam_operations>
<xrefs>
<xref type="bio.tools">galaxy_image_analysis</xref>
</xrefs>
<requirements>
<requirement type="package" version="1.26.4">numpy</requirement>
<requirement type="package" version="0.18.1">scikit-image</requirement>
<requirement type="package" version="0.1">giatools</requirement>
</requirements>
<command><![CDATA[
## Inputs
python '$__tool_directory__/repeat_channels.py'
'$input'
'$count'
## Outputs
./output.tif
]]>
</command>
<inputs>
<param name="input" type="data" format="tiff,png" label="Input image (single-channel)" />
<param name="count" type="integer" value="3" min="1" label="Number of channels" />
</inputs>
<outputs>
<data format="tiff" name="output" from_work_dir="output.tif" />
</outputs>
<tests>
<test>
<param name="input" value="input1.tif" />
<param name="count" value="3" />
<expand macro="tests/intensity_image_diff" name="output" value="input1_c3.tif" ftype="tiff" />
</test>
</tests>
<help>

**Convert single-channel to multi-channel image.**

This tools converts a single-channel image to a multi-channel image by repeating the channel multiple times.

</help>
<citations>
<citation type="doi">10.1038/s41586-020-2649-2</citation>
</citations>
</tool>
Binary file added tools/repeat_channels/test-data/input1.tif
Binary file not shown.
Binary file added tools/repeat_channels/test-data/input1_c3.tif
Binary file not shown.
1 change: 1 addition & 0 deletions tools/repeat_channels/tests.xml
6 changes: 3 additions & 3 deletions tools/voronoi_tessellation/voronoi_tessellation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<macros>
<import>creators.xml</import>
<token name="@TOOL_VERSION@">0.22.0</token>
<token name="@VERSION_SUFFIX@">2</token>
<token name="@VERSION_SUFFIX@">3</token>
</macros>
<edam_operations>
<edam_operation>operation_3443</edam_operation>
Expand Down Expand Up @@ -31,7 +31,7 @@
]]>
</command>
<inputs>
<param name="input" type="data" format="png,tiff" label="Input image" help="Must be a label map." />
<param name="input" type="data" format="png,tiff" label="Label map" />
</inputs>
<outputs>
<data format="tiff" name="result" from_work_dir="result.tiff" />
Expand All @@ -54,7 +54,7 @@
</tests>
<help>

**Computes Voronoi tessellations for labeled images.**
**Computes Voronoi tessellations for label maps (labeled images).**

Voronoi tessellations are also known as Vornoi diagrams, or Dirichlet tessellations.
Zero labels are treated as image background.
Expand Down

0 comments on commit 60cf803

Please sign in to comment.