Mercurial > repos > thomaswollmann > color_deconvolution
changeset 2:8fcbcf6509d8 draft
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/color-deconvolution commit 92068c64f9a6c3cf59f756b9efc2d561196c6873
author | thomaswollmann |
---|---|
date | Thu, 09 Feb 2017 04:36:37 -0500 |
parents | e5d95eb1daad |
children | 3006ce5f7a7d |
files | color-deconvolution.xml color_deconvolution.py |
diffstat | 2 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/color-deconvolution.xml Tue Feb 07 10:29:32 2017 -0500 +++ b/color-deconvolution.xml Thu Feb 09 04:36:37 2017 -0500 @@ -1,4 +1,4 @@ -<tool id="color_deconvolution" name="Color Deconvolution" version="0.3"> +<tool id="color_deconvolution" name="Color Deconvolution" version="0.4"> <description>Color deconvolution</description> <requirements> <requirement type="package" version="0.12.3" >scikit-image</requirement> @@ -14,7 +14,10 @@ <inputs> <param name="input" type="data" format="tiff,png,jpg,bmp" label="Image file with 3 channels"/> <param name="convtype" type="select" label="Transformation type"> - <option value="pca" selected="True">pca</option> + <option value="ica" selected="True">ica</option> + <option value="pca">pca</option> + <option value="nmf">nmf</option> + <option value="fa">fa</option> <option value="xyz2rgb">xyz2rgb</option> <option value="rgb_from_rbd">rgb_from_rbd</option> <option value="rgb_from_hdx">rgb_from_hdx</option>
--- a/color_deconvolution.py Tue Feb 07 10:29:32 2017 -0500 +++ b/color_deconvolution.py Thu Feb 09 04:36:37 2017 -0500 @@ -5,7 +5,7 @@ import skimage.io import skimage.color import skimage.util -from sklearn.decomposition import PCA +from sklearn.decomposition import PCA, NMF, FastICA, FactorAnalysis convOptions = { 'hed2rgb' : lambda img_raw: skimage.color.hed2rgb(img_raw), @@ -61,6 +61,12 @@ 'hpx_from_rgb' : lambda img_raw: skimage.color.separate_stains(img_raw, skimage.color.hpx_from_rgb), 'pca' : lambda img_raw: np.reshape(PCA(n_components=3).fit_transform(np.reshape(img_raw, [-1, img_raw.shape[2]])), + [img_raw.shape[0],img_raw.shape[1],-1]), + 'nmf' : lambda img_raw: np.reshape(NMF(n_components=3, init='nndsvda').fit_transform(np.reshape(img_raw, [-1, img_raw.shape[2]])), + [img_raw.shape[0],img_raw.shape[1],-1]), + 'ica' : lambda img_raw: np.reshape(FastICA(n_components=3).fit_transform(np.reshape(img_raw, [-1, img_raw.shape[2]])), + [img_raw.shape[0],img_raw.shape[1],-1]), + 'fa' : lambda img_raw: np.reshape(FactorAnalysis(n_components=3).fit_transform(np.reshape(img_raw, [-1, img_raw.shape[2]])), [img_raw.shape[0],img_raw.shape[1],-1]) }