Repository 'color_deconvolution'
hg clone https://toolshed.g2.bx.psu.edu/repos/thomaswollmann/color_deconvolution

Changeset 2:8fcbcf6509d8 (2017-02-09)
Previous changeset 1:e5d95eb1daad (2017-02-07) Next changeset 3:3006ce5f7a7d (2017-02-11)
Commit message:
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/color-deconvolution commit 92068c64f9a6c3cf59f756b9efc2d561196c6873
modified:
color-deconvolution.xml
color_deconvolution.py
b
diff -r e5d95eb1daad -r 8fcbcf6509d8 color-deconvolution.xml
--- a/color-deconvolution.xml Tue Feb 07 10:29:32 2017 -0500
+++ b/color-deconvolution.xml Thu Feb 09 04:36:37 2017 -0500
b
@@ -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>
b
diff -r e5d95eb1daad -r 8fcbcf6509d8 color_deconvolution.py
--- 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])
 }