diff imagej2_analyze_particles_binary.xml @ 3:862af85a50ec draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
author imgteam
date Wed, 25 Sep 2024 16:13:47 +0000
parents ae4ae9c5c56c
children
line wrap: on
line diff
--- a/imagej2_analyze_particles_binary.xml	Sun Nov 05 14:25:37 2023 +0000
+++ b/imagej2_analyze_particles_binary.xml	Wed Sep 25 16:13:47 2024 +0000
@@ -1,4 +1,4 @@
-<tool id="imagej2_analyze_particles_binary" name="Analyze particles" version="@WRAPPER_VERSION@.1">
+<tool id="imagej2_analyze_particles_binary" name="Analyze particles" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0">
     <description>with ImageJ2</description>
     <macros>
         <import>imagej2_macros.xml</import>
@@ -14,31 +14,32 @@
     <command detect_errors="exit_code"><![CDATA[
 #import os
 #set input_sans_ext = $os.path.splitext($os.path.basename($input.file_name))[0]
-#set input_with_ext = '.'.join([input_sans_ext, $input.ext])
+#set input_with_ext = './' + '.'.join([input_sans_ext, $input.ext])
 ln -s '$input.file_name' '$input_with_ext' &&
-#set output_log = 'output_log.txt'
-touch '$output_log' &&
 #if str($show) == 'Nothing':
     #set display_results = 'yes'
-    #set all_results = 'yes'
     #set output_filename = ''
     #set output_datatype = ''
     #set results_filename = $results
 #else:
-    #set display_results = $display_results_cond.display_results
-    #set all_results = $display_results_cond.all_results
+    #set display_results = $display_results
     #set output_filename = '.'.join(['output', $input.ext])
     #set output_datatype = $input.ext
     touch '$output_filename' &&
-    #if str($display_results_cond.display_results) == 'yes':
+    #if str($display_results) == 'yes':
         #set results_filename = $results
     #else:
         #set results_filename = ''
     #end if
 #end if
+#if str($export_rois) == 'true':
+    #set rois_filename = $rois
+#else:
+    #set rois_filename = ''
+#end if
 ImageJ --ij2 --headless --debug
 --jython '$__tool_directory__/imagej2_analyze_particles_binary_jython_script.py'
-'$output_log'
+'$rois_filename'
 '$input'
 '$black_background'
 '$size'
@@ -46,23 +47,13 @@
 $circularity_max
 '$show'
 '$display_results'
-'$all_results'
 '$exclude_edges'
 '$include_holes'
 '$output_filename'
 '$output_datatype'
 '$results_filename'
-&>'$output_log';
 #if str($output_filename) != '':
-    if [[ $? -ne 0 ]]; then
-        cat '$output_log' >&2;
-    else
-        mv '$output_filename' '$output';
-    fi
-#else:
-    if [[ $? -ne 0 ]]; then
-        cat '$output_log' >&2;
-    fi
+    && mv '$output_filename' '$output';
 #end if
 ]]></command>
     <inputs>
@@ -81,23 +72,14 @@
             <option value="Ellipses">Ellipses</option>
             <option value="Masks">Masks</option>
             <option value="Count_Masks">Count Masks</option>
+            <option value="Overlay">Overlay</option>
+            <option value="Overlay_Masks">Overlay Masks</option>
             <option value="Nothing">Nothing</option>
         </param>
-        <conditional name="display_results_cond">
-            <param name="display_results" type="select" label="Display results">
-                <option value="no" selected="True">No</option>
-                <option value="yes">Yes</option>
-            </param>
-            <when value="no">
-                <param name="all_results" type="hidden" value="no"/>
-            </when>
-            <when value="yes">
-                <param name="all_results" type="select" label="All results?" help="If no, only summary displayed.">
-                    <option value="yes" selected="True">Yes</option>
-                    <option value="no">No</option>
-                </param>
-            </when>
-        </conditional>
+        <param name="display_results" type="select" label="Display results">
+            <option value="no" selected="True">No</option>
+            <option value="yes">Yes</option>
+        </param>
         <param name="exclude_edges" type="select" label="Exclude on edges?">
             <option value="no" selected="True">No</option>
             <option value="yes">Yes</option>
@@ -106,32 +88,55 @@
             <option value="no" selected="True">No</option>
             <option value="yes">Yes</option>
         </param>
+        <param name="export_rois" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Export particles outlines coordinates" help="Exports particles coordinates as a tabular file, which can be imported as ROIs in OMERO." />
     </inputs>
     <outputs>
         <data name="output" format_source="input">
             <filter>show != "Nothing"</filter>
        </data>
         <data format="tabular" name="results" label="${tool.name} (results) on ${on_string}">
-            <filter>show == "Nothing" or display_results_cond['display_results'] == "yes"</filter>
+            <filter>show == "Nothing" or display_results == "yes"</filter>
+        </data>
+        <data format="tabular" name="rois" label="${tool.name} (particles coordinates) on ${on_string}">
+            <filter>export_rois</filter>
         </data>
     </outputs>
     <tests>
-        <test>
+        <test expect_num_outputs="1">
             <param name="input" value="blobs.gif"/>
             <param name="show" value="Nothing"/>
-            <output name="output" file="analyze_particles_nothing.tabular"/>
+            <output name="results" file="analyze_particles_nothing.tabular"/>
         </test>
-        <test>
+        <test expect_num_outputs="1">
             <param name="input" value="blobs.gif"/>
             <param name="show" value="Outlines"/>
-            <output name="output" file="analyze_particles_outlines.gif" compare="sim_size"/>
+            <output name="output" file="analyze_particles_outlines.gif" compare="image_diff"/>
         </test>
-        <test>
+        <test expect_num_outputs="1">
             <param name="input" value="blobs.gif"/>
-            <param name="show" value="Masks"/>
+            <param name="show" value="Bare_Outlines"/>
             <param name="exclude_edges" value="yes"/>
             <param name="include_holes" value="yes"/>
-            <output name="output" file="analyze_particles_masks.gif" compare="sim_size"/>
+            <output name="output" file="analyze_particles_bareoutlines.gif" compare="image_diff" metric="iou"/>
+        </test>
+        <test expect_num_outputs="3">
+            <param name="input" value="blobs.gif"/>
+            <param name="show" value="Overlay_Masks"/>
+            <param name="display_results" value="yes"/>
+            <param name="export_rois" value="true"/>
+            <output name="output" file="analyze_particles_overlaymasks.gif" compare="image_diff"/>
+            <output name="results" file="analyze_particles_nothing.tabular"/>
+            <output name="rois" file="analyze_particles_rois.tabular"/>
+        </test>
+        <test expect_num_outputs="3">
+            <param name="input" value="confocal-series-first-channel_threshold_default.tiff"/>
+            <param name="black_background" value="yes"/>
+            <param name="show" value="Overlay_Masks"/>
+            <param name="display_results" value="yes"/>
+            <param name="export_rois" value="true"/>
+            <output name="output" file="confocal-series-first-channel_threshold_default_overlay_mask.tiff" compare="sim_size"/>
+            <output name="results" file="confocal_analyze_particles.tabular"/>
+            <output name="rois" file="confocal_analyze_particles_rois.tabular"/>
         </test>
     </tests>
     <help>