Giter Club home page Giter Club logo

deconvolution's Introduction

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:

from deconvolution import Deconvolution
from PIL import Image

img = 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:

pip install deconvolution

Alternatively, you can clone the repository and run:

make install

Since then you can import use the module in your scripts:

from deconvolution import Deconvolution
d = Deconvolution()

Testing

# 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 html

Deconvolve

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:

mkdir ~/bin
cp deconvolve.py ~/bin
export PATH=~/bin:$PATH

Since then you can deconvolve images using:

deconvolve.py image1.png image2.png ...
# For help
deconvolve.py -h

Documentation

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](1, 2) Research paper by Ruifrok and Johnston
[IJ](1, 2) 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

deconvolution's People

Contributors

pawel-czyz avatar grfrederic avatar

Stargazers

Noregret0 avatar  avatar  avatar sun mingjian avatar

Watchers

 avatar

deconvolution's Issues

Definition of parameters

decimg = Deconvolution(image=img, basis=[[1, 0.1, 0.2], [0, 0.1, 0.8]])
For this code what does the parameter "basis" represent?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.