comparison imagej2_bunwarpj_align.xml @ 0:ab54024c0a88 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
author imgteam
date Tue, 17 Sep 2019 17:02:18 -0400
parents
children e9243cad1d67
comparison
equal deleted inserted replaced
-1:000000000000 0:ab54024c0a88
1 <?xml version='1.0' encoding='UTF-8'?>
2 <tool id="imagej2_bunwarpj_align" name="Align two images" version="@WRAPPER_VERSION@.0">
3 <description>with bUnwarpJ</description>
4 <macros>
5 <import>imagej2_macros.xml</import>
6 </macros>
7 <expand macro="fiji_requirements" />
8 <command>
9 <![CDATA[
10 python $__tool_directory__/imagej2_bunwarpj_align.py
11 --target_image "$target_image"
12 --target_image_format $target_image.ext
13 --source_image "$source_image"
14 --source_image_format $source_image.ext
15 #if $align_with_mask_cond.align_with_mask == 'yes':
16 --target_mask "$target_mask"
17 --target_mask_format $target_mask.ext
18 --source_mask "$source_mask"
19 --source_mask_format $source_mask.ext
20 #end if
21 --min_scale_def $min_scale_def
22 --max_scale_def $max_scale_def
23 --max_subsamp_fact $max_subsamp_fact
24 --divergence_weight $divergence_weight
25 --curl_weight $curl_weight
26 --image_weight $image_weight
27 --consistency_weight $consistency_weight
28 #if $advanced_options_cond.advanced_options == 'landmarks':
29 --landmarks_weight $advanced_options_cond.landmarks_weight
30 --landmarks_file "$advanced_options_cond.landmarks_file"
31 #else if $advanced_options_cond.advanced_options == 'affine':
32 --target_affine_file "$advanced_options_cond.target_affine_file"
33 --source_affine_file "$advanced_options_cond.source_affine_file"
34 #else if $advanced_options_cond.advanced_options == 'mono':
35 --mono "true"
36 #else if $advanced_options_cond.advanced_options == 'save_transformation':
37 --target_trans_out "$target_trans_out"
38 --source_trans_out "$source_trans_out"
39 #end if
40 --source_out "$source_out"
41 --source_out_datatype $source_out_datatype
42 #if $advanced_options_cond.advanced_options != 'mono':
43 --target_out "$target_out"
44 --target_out_datatype $target_out_datatype
45 #end if
46 --jython_script $__tool_directory__/imagej2_bunwarpj_align_jython_script.py
47 ]]>
48 </command>
49 <inputs>
50 <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="target_image" type="data" label="Target image"/>
51 <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="source_image" type="data" label="Source image"/>
52 <conditional name="align_with_mask_cond">
53 <param name="align_with_mask" type="select" label="Align with masks?" help="Source and target mask can be any image format.">
54 <option value="no" selected="True">No</option>
55 <option value="yes">Yes</option>
56 </param>
57 <when value="no" />
58 <when value="yes">
59 <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="target_mask" type="data" label="Target mask"/>
60 <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="source_mask" type="data" label="Source mask"/>
61 </when>
62 </conditional>
63 <param name="min_scale_def" type="select" label="Initial deformation">
64 <option value="0" selected="True">Very Coarse</option>
65 <option value="1">Coarse</option>
66 <option value="2">Fine</option>
67 <option value="3">Very Fine</option>
68 </param>
69 <param name="max_scale_def" type="select" label="Final deformation">
70 <option value="0">Very Coarse</option>
71 <option value="1">Coarse</option>
72 <option value="2" selected="True">Fine</option>
73 <option value="3">Very Fine</option>
74 </param>
75 <param name="max_subsamp_fact" type="integer" value="0" min="0" label="Image sub-sample factor" help="Power of 2: [0, 1, 2 .. 7]"/>
76 <param name="divergence_weight" type="float" value="0.0" label="Weight of the divergence term" help="Value is a floating point number"/>
77 <param name="curl_weight" type="float" label="Weight of the curl term" value="0.0" help="Value is a floating point number"/>
78 <param name="image_weight" type="float" label="Weight of the image term" value="1.0" help="Value is a floating point number"/>
79 <param name="consistency_weight" type="float" label="Weight of the deformation consistency" value="10.0" help="Value is a floating point number"/>
80 <param name="target_out_datatype" type="select" label="Save registered target image as format">
81 <expand macro="image_datatypes" />
82 </param>
83 <param name="source_out_datatype" type="select" label="Save registered source image as format">
84 <expand macro="image_datatypes" />
85 </param>
86 <!--
87 The following additional options can be added to the advanced_options select
88 list as soon as appropriate. Their use is supported in the imagej2_bunwarp_align.py
89 wrapper.
90
91 I invested heavily in working with landmarks, but could never get them to
92 produce the same results from both the ImageJ GUI and the command line. I'm
93 convinced this is not a result of using Galaxy as I tested using ImageJ in headless
94 mode outside of Galaxy and the results differed from using the ImageJ GUI. Until
95 we know the reasons for these differences, we will eliminate this option.
96 <option value="landmarks">Apply landmarks</option>
97
98 A separate tool will be needed to create an affine matrix transformation file,
99 so we'll eliminate this option until we have that tool.
100 <option value="affine">Apply affine matrix transformation</option>
101
102 Similar to landmarks, I could not get the ImageJ mono option to produce the same
103 results from the ImageJ GUI and in headless mode from the command line.
104 <option value="mono">Unidirectional registration (source to target)</option>
105 -->
106 <conditional name="advanced_options_cond">
107 <param name="advanced_options" type="select" label="Advanced options" help="These are mutually exclusive for each execution">
108 <option value="none" selected="True">None</option>
109 <option value="save_transformation">Save calculated transformations</option>
110 </param>
111 <when value="none" />
112 <!--
113 <when value="landmarks">
114 <param name="landmarks_weight" type="float" label="Landmark weight" value="0.0" help="Value is a floating point number"/>
115 <param format="txt" name="landmarks_file" type="data" label="Landmark file"/>
116 </when>
117 <when value="affine">
118 <param format="txt" name="target_affine_file" type="data" label="Initial target affine matrix transformation"/>
119 <param format="txt" name="source_affine_file" type="data" label="Initial source affine matrix transformation"/>
120 </when>
121 <when value="mono"/>
122 -->
123 <when value="save_transformation"/>
124 </conditional>
125 </inputs>
126 <outputs>
127 <data name="source_out" format="png" label="${tool.name} on ${on_string}: Registered source image">
128 <actions>
129 <action type="format">
130 <option type="from_param" name="source_out_datatype" />
131 </action>
132 </actions>
133 </data>
134 <data name="target_out" format="png" label="${tool.name} on ${on_string}: Registered target image">
135 <filter>advanced_options_cond['advanced_options'] != "mono"</filter>
136 <actions>
137 <action type="format">
138 <option type="from_param" name="target_out_datatype" />
139 </action>
140 </actions>
141 </data>
142 <data format="txt" name="source_trans_out" label="${tool.name} on ${on_string}: Direct source transformation matrix">
143 <filter>advanced_options_cond['advanced_options'] == "save_transformation"</filter>
144 </data>
145 <data format="txt" name="target_trans_out" label="${tool.name} on ${on_string}: Inverse target transformation matrix">
146 <filter>advanced_options_cond['advanced_options'] == "save_transformation"</filter>
147 </data>
148 </outputs>
149 <tests>
150 <test>
151 <!-- Align two images without landmarks or mask and not saving transformation matrices -->
152 <param name="target_image" value="dotblot.jpg" />
153 <param name="source_image" value="blobs.gif" />
154 <param name="min_scale_def" value="0" />
155 <param name="max_scale_def" value="2" />
156 <param name="max_subsamp_fact" value="1" />
157 <param name="divergence_weight" value="0.0" />
158 <param name="curl_weight" value="0.0" />
159 <param name="image_weight" value="1.0" />
160 <param name="consistency_weight" value="10.0" />
161 <param name="target_out_datatype" value="png" />
162 <param name="source_out_datatype" value="png" />
163 <output name="source_out" file="registered_source1.png" compare="sim_size" />
164 <output name="target_out" file="registered_target1.png" compare="sim_size" />
165 </test>
166 <test>
167 <!-- Align two images without landmarks or mask, but saving transformation matrices -->
168 <param name="target_image" value="dotblot.jpg" />
169 <param name="source_image" value="blobs.gif" />
170 <param name="min_scale_def" value="0" />
171 <param name="max_scale_def" value="2" />
172 <param name="max_subsamp_fact" value="1" />
173 <param name="divergence_weight" value="0.0" />
174 <param name="curl_weight" value="0.0" />
175 <param name="image_weight" value="1.0" />
176 <param name="consistency_weight" value="10.0" />
177 <param name="target_out_datatype" value="png" />
178 <param name="source_out_datatype" value="png" />
179 <param name="advanced_options" value="save_transformation" />
180 <output name="source_out" file="registered_source1.png" compare="sim_size" />
181 <output name="target_out" file="registered_target1.png" compare="sim_size" />
182 <output name="source_trans_out" file="source_elastic_transformation.txt" />
183 <output name="target_trans_out" file="target_elastic_transformation.txt" />
184 </test>
185 <test>
186 <!-- Align two images without landmarks but with mask, not saving transformation matrices -->
187 <param name="target_image" value="dotblot.jpg" />
188 <param name="source_image" value="blobs.gif" />
189 <param name="target_mask" value="mask_white.png" />
190 <param name="source_mask" value="mask_ramp.gif" />
191 <param name="min_scale_def" value="0" />
192 <param name="max_scale_def" value="2" />
193 <param name="max_subsamp_fact" value="1" />
194 <param name="divergence_weight" value="0.0" />
195 <param name="curl_weight" value="0.0" />
196 <param name="image_weight" value="1.0" />
197 <param name="consistency_weight" value="10.0" />
198 <param name="target_out_datatype" value="png" />
199 <param name="source_out_datatype" value="png" />
200 <output name="source_out" file="registered_source2.png" compare="sim_size" />
201 <output name="target_out" file="registered_target2.png" compare="sim_size" />
202 </test>
203 </tests>
204 <help>
205 **What it does**
206
207 <![CDATA[
208 Performs a simultaneous registration of two images, A and B. Image A is elastically deformed
209 in order to look as similar as possible to image B, and, at the same time, the "inverse"
210 transformation (from B to A) is also calculated so a pseudo-invertibility of the final deformation
211 could be guaranteed. RGB Color images will be converted to grayscale during the registration
212 process but the resulting transformations will be applied to the original color images.
213
214 Two images are produced: the deformed versions of A and B images.
215
216 .. image:: ./static/images/bunwarpj_scheme.png
217
218 Both selected images will work simultaneously as source and target, their tags are there only for the sake
219 of clarification. The registration mode is currently restricted to "Fast" ("Mono" has been eliminated for now).
220 The registration mode "Mono" perfoms only unidirectional registration, i.e. from source to target. The
221 registration mode "Fast" involve performing bidirectional registration and affects the stopping criteria
222 internally used by the bUnwarpJ program.
223
224 Using the **Align with masks** otion, masks are introduced together with the input images. In this mode, the
225 input images is treated as the first slice of the mask pair and the mask is treated as the second slice. In this
226 way, the mask can have any shape.
227
228 The **Initial deformation** and **Final deformation** options allow you to select the coarsest and finest scale
229 of the spline deformation field. "Very coarse" corresponds to 4 splines (one in each corner of the image). As you
230 increase the deformation level, the number of splines is doubled in each direction (horizontal and vertical).
231
232 The value of the **Image sub-sample factor** will enable the registration to be calculated using the subsampled
233 versions of the images but the results will be applied to the original ones. The image subsampling parameter can
234 be set from 0 and 7, i.e. the image dimensions can be reduced by a factor of 20 = 1 to 27 = 128. This is very
235 useful when registering large images.
236
237 The different weights of the goal function control the relative weight of each one of the terms. These weights
238 are not restricted to be between 0 and 1, and they may take any value as long as it is non-negative=2E.
239
240 If the **Advanced option - Save transformation** option is selected, two files are produced in addition to
241 the registerd source and target images: the direct transformation matrix of A and the inverse transformation
242 matrix of B.
243 ]]>
244
245 </help>
246 <expand macro="bunwarpj_citations" />
247 </tool>