Mercurial > repos > thomaswollmann > color_deconvolution
diff color_deconvolution.py @ 2:3b2341714506 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:22 -0500 |
parents | 101d1347abd9 |
children | b1a42e192603 |
line wrap: on
line diff
--- a/color_deconvolution.py Tue Feb 07 10:29:20 2017 -0500 +++ b/color_deconvolution.py Thu Feb 09 04:36:22 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]) }