Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grfrederic/deconvolution
Python module for performing (automatic) colour deconvolution.
https://github.com/grfrederic/deconvolution
Last synced: 18 days ago
JSON representation
Python module for performing (automatic) colour deconvolution.
- Host: GitHub
- URL: https://github.com/grfrederic/deconvolution
- Owner: grfrederic
- License: bsd-3-clause
- Created: 2017-05-27T18:50:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-20T19:29:40.000Z (about 2 years ago)
- Last Synced: 2024-12-13T13:58:49.714Z (24 days ago)
- Language: Python
- Size: 424 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
*************
deconvolution
*************
A Python module providing Deconvolution class that implements and generalises Ruifrok-Johnston color deconvolution algorithm [RJ]_, [IJ]_. It allows one to split an image into distinct color layers in just
a few lines of code:.. code:: python
from deconvolution import Deconvolution
from PIL import Imageimg = Image.open("image.jpg")
# Declare an instance of Deconvolution, with image loaded and with color basis defining what layers are interesting
decimg = Deconvolution(image=img, basis=[[1, 0.1, 0.2], [0, 0.1, 0.8]])
# Constructs new PIL Images, with different color layers
layer1, layer2 = decimg.out_images(mode=[1, 2])Installation
------------
You can install the package using pip:.. code:: bash
pip install deconvolution
Alternatively, you can clone the repository and run:
.. code:: bash
make install
Since then you can import use the module in your scripts:
.. code:: python
from deconvolution import Deconvolution
d = Deconvolution()Testing
-------
.. code:: bash
# For Python 3 users
make test
# For Python 2 users
make comp# Check the code coverage
make coverage# Check the coverage interactively, using a web browser
make htmlDeconvolve
----------
For better usage experience we created a script allowing one to deconvolve images from the shell. Copy `deconvolve.py` file into `/usr/local/bin` or, if you want to use it locally:.. code:: bash
mkdir ~/bin
cp deconvolve.py ~/bin
export PATH=~/bin:$PATHSince then you can deconvolve images using:
.. code:: bash
deconvolve.py image1.png image2.png ...
# For help
deconvolve.py -hDocumentation
-------------
Check out our documentation at `Read The Docs
`_.Contributors
------------
Method developed by Frederic Grabowski generalising Ruifrok-Johnston algorithm [RJ]_. and implemented by Frederic Grabowski [FG]_ and Paweł Czyż [PC]_.
We are very grateful to prof. Daniel Wójcik and dr Piotr Majka [N1]_, [N2]_ who supervised the project. We also would like to thank prof. Gabriel Landini [GL]_, who
implemented the colour deconvolution in ImageJ [IJ]_ and allowed us to test the algorithm on his data.References
----------
.. [RJ] `Research paper by Ruifrok and Johnston
`_
.. [IJ] `ImageJ webpage
`_
.. [N1] `Laboratory of Neuroinformatics webpage
`_
.. [GL] `Prof. Gabriel Landini's webpage
`_
.. [N2] https://github.com/Neuroinflab/
.. [FG] https://github.com/grfrederic
.. [PC] https://github.com/pawel-czyz