view imagej2_enhance_contrast.xml @ 0:edfc597fb180 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:01:04 -0400
parents
children ef3de3e84817
line wrap: on
line source

<?xml version='1.0' encoding='UTF-8'?>
<tool id="imagej2_enhance_contrast" name="Enhance contrast" version="@WRAPPER_VERSION@.0">
    <description></description>
    <macros>
        <import>imagej2_macros.xml</import>
    </macros>
    <expand macro="fiji_requirements" />
    <command>
<![CDATA[
    python $__tool_directory__/imagej2_enhance_contrast.py
    --input "$input"
    --input_datatype $input.ext
    --equalize_histogram $equalize_histogram_cond.equalize_histogram
    #if $equalize_histogram_cond.equalize_histogram == 'no':
        --saturated_pixels $equalize_histogram_cond.saturated_pixels
        --normalize $equalize_histogram_cond.normalize
    #end if
    --jython_script $__tool_directory__/imagej2_enhance_contrast_jython_script.py
    --output_datatype $output.ext
    --output "$output"
]]>
    </command>
    <inputs>
        <param format="bmp,eps,gif,jpg,pcx,pgm,png,psd,tiff" name="input" type="data" label="Select image"/>
        <conditional name="equalize_histogram_cond">
            <param name="equalize_histogram" type="select" label="Equalize histogram?">
                <option value="no" selected="True">No</option>
                <option value="yes">Yes</option>
            </param>
            <when value="no">
                <param name="saturated_pixels" type="float" value="0.3" min="0.0" max="100.0" label="Saturated pixels pct" help="Value is percentage of total number of pixels">
                    <validator type="in_range" min="0" exclude_min="true" max="100" />
                </param>
                <param name="normalize" type="select" label="Normalize?">
                    <option value="no" selected="True">No</option>
                    <option value="yes">Yes</option>
                </param>
            </when>
            <when value="yes"/>
        </conditional>
    </inputs>
    <outputs>
        <data name="output" format_source="input" label="${tool.name} on ${on_string}"/>
    </outputs>
    <tests>
        <test>
            <param name="input" value="blobs.gif" />
            <param name="equalize_histogram" value="yes" />
            <output name="output" file="blobs_equalize.gif" compare="sim_size" />
        </test>
        <test>
            <param name="input" value="blobs.gif" />
            <param name="saturated_pixels" value="6.2" />
            <output name="output" file="blobs_saturate.gif" compare="sim_size" />
        </test>
        <test>
            <param name="input" value="blobs.gif" />
            <param name="saturated_pixels" value="13.0" />
            <param name="normalize" value="yes" />
            <output name="output" file="blobs_normalize.gif" compare="sim_size" />
        </test>
    </tests>
    <help>

**What it does**

<![CDATA[

Enhances image contrast by using either normalization (contrast stretching) or histogram
equalization.

Normalization (i.e., contrast stretching) attempts to improve the contrast in an image by
stretching the range of intensity values it contains to span a desired range of values
(e.g. the the full range of pixel values that the image type allows).  It differs from the
more sophisticated histogram equalization in that it can only apply a linear scaling function
to the image pixel values.  As a result the enhancement is less harsh.

Histogram equalization provides a sophisticated method for modifying the dynamic range and
contrast of an image by altering the image such that its intensity histogram has a desired
shape.  Unlike contrast stretching, histogram modeling operators may employ non-linear and
non-monotonic transfer functions to map between pixel intensity values in the input and output
images.  Histogram equalization re-assigns the intensity values of pixels in the input image
such that the output image contains a uniform distribution of intensities (i.e. a flat histogram).

- **Equalize histogram** - Enhances the image using histogram equalization.  Choosing this option eliminates the "Saturated pixels pct" and "Normalize" options.
- **Saturated pixels pct** - Determines the number of pixels in the image that are allowed to become saturated.  Increasing this value increases contrast.  This value should be greater than zero to prevent a few outlying pixels from causing the histogram stretch to not work as intended.
- **Normalize** - Recalculates the pixel values of the image so the range is equal to the maximum range for the data type, or 0-1.0 for float images. The maximum range is 0-255 for 8-bit images and 0-65535 for 16-bit images.  Normalization of RGB images is not supported, so selecting "yes" is ignored for this image type.

]]>

    </help>
    <expand macro="fiji_headless_citations" />
</tool>