Skip to main content

Image Enhancement Toolkit for Retinal Fundus Images IETK-Ret

Project description

IETK-Ret - Image Enhancement Toolkit for Retinal Fundus Images

This repository contains a collection of enhancement methods useful for retinal fundus images, with emphasis on Pixel Color Amplification.
These methods are very useful as a pre-processing step to fundus image analysis and machine learning. They have applicability to a wide variety of image domains, but we focus on retinal fundus images.

I would be happy to link to your paper in the "papers" section if you use this code or method. Please cite or acknowledge the below paper if you use the code or method. Thank you!

A. Gaudio, A. Smailagic, A. Campilho, “Enhancement of Retinal Fundus Images via Pixel Color Amplification,” In: Karray F., Campilho A., Wang Z. (eds) Image Analysis and Recognition. ICIAR 2020. Lecture Notes in Computer Science, vol 11663. Springer, Cham (accepted)

Some Example Results

Example: correcting over-exposure Example: correcting under-exposure Example: improving segmentation Example: several results

Papers:

  • ./iciar2020/ - Code, slides and paper for the Pixel Color Amplification paper from ICIAR 2020.

Code:

  • ietk.util - methods to separate the fundus from the black background, as well as crop the image to minimize background.
  • ietk.methods - a set of enhancement methods, mostly based on pixel color amplification for brightening, darkening and sharpening.
  • ietk.data - access to the images in the IDRiD dataset for R&D (assuming you already downloaded the dataset)

Usage

pip install ietk-ret

Example usage:

from matplotlib import pyplot as plt
from ietk import methods
from ietk import util
from ietk.data import IDRiD

# load a fundus image, normalized into 0-1 range (not 0-255)
# such as one from the IDRiD dataset  (assuming you already have it on disk)
dset = IDRiD('./data/IDRiD_segmentation')
img_id, img, labels = dset.sample()
print("using image", img_id)


# crop fundus image and get a focus region  (a very useful function!)
I = img.copy()
I, fg = util.center_crop_and_get_foreground_mask(I)

# enhance the image with an enhancement method from the ICIAR 2020 paper
# (any combination of letters A,B,C,D,W,X,Y,Z and sA,sB,sC,... are supported)
enhanced_img = methods.brighten_darken(I, 'A+B+X', focus_region=fg)
enhanced_img2 = methods.sharpen(enhanced_img, bg=~fg)

# plot results
f, (ax1, ax2, ax3) = plt.subplots(1, 3)
ax1.imshow(img)
ax2.imshow(enhanced_img)
ax3.imshow(enhanced_img2)
f.tight_layout()

Disclaimer

This code, including the API and methods, may not be backwards compatible between releases. If you use it, fix the version, git tag or git commit used in your requirements.txt file.

I am not responsible or liable for your use of this code or methods. Please carefully verify and ensure safety of its use in any production or decision-making or clinical or other contexts.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

IETK-Ret-0.1.1.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

IETK_Ret-0.1.1-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file IETK-Ret-0.1.1.tar.gz.

File metadata

  • Download URL: IETK-Ret-0.1.1.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for IETK-Ret-0.1.1.tar.gz
Algorithm Hash digest
SHA256 10e317b60e94a5e19cc36b57d708b8129cbf90dc449ff9b229a29cc9b7c4516c
MD5 12e0577a6983ee60253ef1ef74d41bfd
BLAKE2b-256 6550712cd2118667c4dbda0a26ae161b7a1891ae2843652de80076c2a17f979e

See more details on using hashes here.

File details

Details for the file IETK_Ret-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: IETK_Ret-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for IETK_Ret-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57b8cf4355d20a9268d0e51b05271a8a077e5b77992d4a7d693159efc44468ae
MD5 9860daf24cbc97a31c028a8e06efb59f
BLAKE2b-256 d593183e3505920a671c0cc6600e34771f0bad24906fa8bbd46d3a7fa79a11f1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page