comparison color_deconvolution.xml @ 2:387414aa6496 draft default tip

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/color_deconvolution/ commit f546b3cd5cbd3a8613cd517975c7ad1d1f83514e
author imgteam
date Thu, 06 Mar 2025 18:12:13 +0000
parents
children
comparison
equal deleted inserted replaced
1:29110ca1b63a 2:387414aa6496
1 <tool id="ip_color_deconvolution" name="Perform color deconvolution or transformation" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
2 <description></description>
3 <macros>
4 <import>creators.xml</import>
5 <import>tests.xml</import>
6 <token name="@TOOL_VERSION@">0.9</token>
7 <token name="@VERSION_SUFFIX@">0</token>
8 </macros>
9 <creator>
10 <expand macro="creators/bmcv"/>
11 </creator>
12 <edam_operations>
13 <edam_operation>operation_3443</edam_operation>
14 </edam_operations>
15 <xrefs>
16 <xref type="bio.tools">galaxy_image_analysis</xref>
17 </xrefs>
18 <requirements>
19 <requirement type="package" version="0.24.0">scikit-image</requirement>
20 <requirement type="package" version="11.0.0">pillow</requirement>
21 <requirement type="package" version="1.5.2">scikit-learn</requirement>
22 <requirement type="package" version="2.1.2">numpy</requirement>
23 <requirement type="package" version="2024.9.20">tifffile</requirement>
24 <requirement type="package" version="0.3.1">giatools</requirement>
25 </requirements>
26 <command detect_errors="aggressive">
27 <![CDATA[
28
29 python '$__tool_directory__/color_deconvolution.py'
30
31 '$input'
32 '$output'
33 '$convtype'
34
35 #if str($isolate_channel) != '':
36 --isolate_channel '${isolate_channel}'
37 #end if
38
39 ]]>
40 </command>
41 <inputs>
42 <param name="input" type="data" format="tiff,png,jpg,bmp" label="Input image" help="The input image must have 3 axes and 3 channels. The channels must correspond to the last axis."/>
43 <param name="convtype" type="select" label="Transformation type">
44
45 <!-- Color deconvolution and recomposition operations -->
46 <option value="he_from_rgb">Deconvolve RGB into H&#38;E (Hematoxylin + Eosin)</option>
47 <option value="rgb_from_he">Recompose RGB from H&#38;E (Hematoxylin + Eosin)</option>
48 <option value="hdx_from_rgb">Deconvolve RGB into Hematoxylin + DAB</option>
49 <option value="rgb_from_hdx">Recompose RGB from Hematoxylin + DAB</option>
50 <option value="rgb2hed">Deconvolve RGB into Hematoxylin + Eosin + DAB</option>
51 <option value="hed2rgb">Recompose RGB from Hematoxylin + Eosin + DAB</option>
52 <option value="hpx_from_rgb">Deconvolve RGB into Hematoxylin + PAS</option>
53 <option value="rgb_from_hpx">Recompose RGB from Hematoxylin + PAS</option>
54 <option value="hax_from_rgb">Deconvolve RGB into Hematoxylin + AEC</option>
55 <option value="rgb_from_hax">Recompose RGB from Hematoxylin + AEC</option>
56 <option value="ahx_from_rgb">Deconvolve RGB into Alcian Blue + Hematoxylin</option>
57 <option value="rgb_from_ahx">Recompose RGB from Alcian Blue + Hematoxylin</option>
58 <option value="bro_from_rgb">Deconvolve RGB to AZAN</option>
59 <option value="rgb_from_bro">Recompose RGB from AZAN</option>
60 <option value="rbd_from_rgb">Deconvolve RGB into FastRed + FastBlue + DAB</option>
61 <option value="rgb_from_rbd">Recompose RGB from FastRed + FastBlue + DAB</option>
62 <option value="fgx_from_rgb">Deconvolve RGB into Feulgen + Light Green</option>
63 <option value="rgb_from_fgx">Recompose RGB from Feulgen + Light Green</option>
64 <option value="bex_from_rgb">Deconvolve RGB into Giemsa stain (Methyl Blue + Eosin)</option>
65 <option value="rgb_from_bex">Recompose RGB from Giemsa stain (Methyl Blue + Eosin)</option>
66 <option value="bpx_from_rgb">Deconvolve RGB into Methyl Blue + Ponceau Fuchsin</option>
67 <option value="rgb_from_bpx">Recompose RGB from Methyl Blue + Ponceau Fuchsin</option>
68 <option value="gdx_from_rgb">Deconvolve RGB into Methyl Green + DAB</option>
69 <option value="rgb_from_gdx">Recompose RGB from Methyl Green + DAB</option>
70
71 <!-- Unsupervised machine learning-based operations -->
72 <option value="ica">Project onto independent components (ICA)</option>
73 <option value="pca">Project onto principal components (PCA)</option>
74 <option value="nmf">Non-negative matrix factorization</option>
75 <option value="fa">Factor analysis</option>
76
77 <!-- General color space conversion operations -->
78 <option value="rgb2hsv" selected="True">Convert RGB to HSV</option>
79 <option value="hsv2rgb">Convert HSV to RGB</option>
80 <option value="rgb2xyz">Convert RGB to XYZ (CIE 1931)</option>
81 <option value="xyz2rgb">Convert XYZ (CIE 1931) to RGB</option>
82 <option value="rgb2luv">Convert RGB to CIE-LUV</option>
83 <option value="luv2rgb">Convert CIE-LUV to RGB</option>
84 <option value="xyz2luv">Convert XYZ (CIE 1931) to CIE-LUV</option>
85 <option value="luv2xyz">Convert CIE-LUV to XYZ (CIE 1931)</option>
86 <option value="rgb2lab">Convert RGB to CIE-LAB (illuminant D65, aperture angle 2&#xb0;)</option>
87 <option value="lab2rgb">Convert CIE-LAB (illuminant D65, aperture angle 2&#xb0;) to RGB</option>
88 <option value="lab2xyz">Convert CIE-LAB (illuminant D65, aperture angle 2&#xb0;) to XYZ (CIE 1931)</option>
89 <option value="xyz2lab">Convert XYZ (CIE 1931) to CIE-LAB (illuminant D65, aperture angle 2&#xb0;)</option>
90 <option value="lch2lab">Convert CIE-LCh to CIE-LAB</option>
91 <option value="lab2lch">Convert CIE-LAB to CIE-LCh</option>
92 <option value="rgb2rgbcie">Convert RGB to RGB-CIE</option>
93 <option value="rgbcie2rgb">Convert RGB-CIE to RGB</option>
94
95 </param>
96 <param name="isolate_channel" type="integer" optional="true" value="" label="Isolate channel" help="Must be empty or the number of a channel (1 to 3). If used, all other channels are set to zero before performing the chosen transformation." />
97 </inputs>
98 <outputs>
99 <data format="tiff" name="output"/>
100 </outputs>
101 <tests>
102
103 <!-- Tests with compatible input files -->
104
105 <test>
106 <!-- Test PNG input and standard color transformation -->
107 <param name="input" value="galaxyIcon_noText.png" />
108 <param name="convtype" value="rgb2hsv" />
109 <expand macro="tests/intensity_image_diff" name="output" value="galaxyIcon_noText.tiff" ftype="tiff"/>
110 </test>
111 <test>
112 <!-- Test deconvolution using scikit-image (H&E + DAB) -->
113 <param name="input" value="he1.tiff" />
114 <param name="convtype" value="rgb2hed" />
115 <expand macro="tests/intensity_image_diff" name="output" value="he1_deconv_hed.tiff" ftype="tiff"/>
116 </test>
117 <test>
118 <!-- Test full recomposition -->
119 <param name="input" value="he1_deconv_hed.tiff" />
120 <param name="convtype" value="hed2rgb" />
121 <expand macro="tests/intensity_image_diff" name="output" value="he1_deconv_hed_recomposed.tiff" ftype="tiff"/>
122 </test>
123 <test>
124 <!-- Test recomposition with isolated channel -->
125 <param name="input" value="he1_deconv_hed.tiff" />
126 <param name="convtype" value="hed2rgb" />
127 <param name="isolate_channel" value="1" />
128 <expand macro="tests/intensity_image_diff" name="output" value="he1_deconv_hed_recomposed1.tiff" ftype="tiff"/>
129 </test>
130 <test>
131 <!-- Test deconvolution using custom stain matrix -->
132 <param name="input" value="he1.tiff" />
133 <param name="convtype" value="he_from_rgb" />
134 <expand macro="tests/intensity_image_diff" name="output" value="he1_deconv_he.tiff" ftype="tiff"/>
135 </test>
136 <test>
137 <!-- Test deconvolution using scikit-image (Hematoxylin + DAB) -->
138 <param name="input" value="hdab1.tiff" />
139 <param name="convtype" value="hdx_from_rgb" />
140 <expand macro="tests/intensity_image_diff" name="output" value="hdab1_deconv_hdab.tiff" ftype="tiff"/>
141 </test>
142 <test>
143 <!-- Test with image that has 3 axes but in unusual order (and 3 channels) -->
144 <param name="input" value="he1_axes_cyx.tiff" />
145 <param name="convtype" value="rgb2hsv" />
146 <expand macro="tests/intensity_image_diff" name="output" value="he1_hsv.tiff" ftype="tiff"/>
147 </test>
148
149 <!-- Tests with incompatible input files (should fail) -->
150
151 <test expect_failure="true">
152 <!-- Test with image that only has 2 axes instead of required 3 -->
153 <param name="input" value="im_axes_yx.tif" />
154 <param name="convtype" value="rgb2hsv" />
155 </test>
156 <test expect_failure="true">
157 <!-- Test with image that has 3 axes but YXZ instead of YXC (and 3 slices) -->
158 <param name="input" value="he1_axes_yxz.tiff" />
159 <param name="convtype" value="rgb2hsv" />
160 </test>
161
162 </tests>
163 <help><![CDATA[
164
165 **This tool converts the color space of an image.**
166
167 Several color deconvolution techniques are also supported.
168
169 Color Deconvolution Example
170 ===========================
171
172 In this example, we are going to perform color deconvolution of the following RGB image:
173
174 .. image:: he.png
175 :width: 434px
176 :scale: 50%
177
178 Using the option "Deconvolve RGB into H&E (Hematoxylin + Eosin)" for the **Transformation type** performs color deconvolution and yields a new image with three chnnales:
179
180 .. image:: he_deconv.png
181 :width: 1305px
182 :scale: 50%
183
184 The channels of the deconvolved image are the Hematoxylin intensities (Channel 1), the Eosin intensities (Channel 2), and the residuals (Channel 3). White image regions correspond to high intensities and black image regions correspond to low intensities.
185
186 For visual inspection of the color deconvolution results, it may be useful to recompose separate RGB images for the Hematoxylin, Eosin, and residual channels. To create such images, this tool must be run once for each channel of the deconvolved image (i.e. three times), using the following options:
187
188 * **Input image:** The result of the color deconvolution (image shown in the figure above)
189 * **Transformation type:** Recompose RGB from H&E (Hematoxylin + Eosin)
190
191 The **Isolate channel** field must be set to 1, 2, and 3 during the three runs, respectively. This will yield the following recomposed RGB images for better visualization of the color deconvolution results:
192
193 .. image:: he_recomposed.png
194 :width: 1305px
195 :scale: 50%
196
197 ]]></help>
198 <citations>
199 <citation type="doi">10.7717/peerj.453</citation>
200 <citation type="bibtex">@inproceedings{sklearn_api,
201 author = {Lars Buitinck and Gilles Louppe and Mathieu Blondel and
202 Fabian Pedregosa and Andreas Mueller and Olivier Grisel and
203 Vlad Niculae and Peter Prettenhofer and Alexandre Gramfort
204 and Jaques Grobler and Robert Layton and Jake VanderPlas and
205 Arnaud Joly and Brian Holt and Ga{\"{e}}l Varoquaux},
206 title = {{API} design for machine learning software: experiences from the scikit-learn project},
207 booktitle = {ECML PKDD Workshop: Languages for Data Mining and Machine Learning},
208 year = {2013},
209 pages = {108--122},
210 }</citation>
211 </citations>
212 </tool>