The purpose of this work is to adjust image intensities for visualization purposes
src: contains the source python file src/histogram_equalization.py - implementation of standard and Contrast Limited Adaptive Histogram Equalization (CLAHE) histogram equalization. It support 8 BPP and 16 BPP grayscale images and RGB color images.Dockerfileplugin.jsonmanifestsample-datafolder with test data
The project is leveraging numpy, tifffile, imagecodecs, and opencv libraries. It has been developed on Windows 11 and tested on MacOSX.
conda create --name hist_equ python=3.7
conda activate hist_equ
conda install numpy, opencv-python-headless, tifffile, imagecodecs
Note: The current version outputs compressed intensity adjusted images using LZW compression. This requires using Python 10.x and up (tested with 10.x and 11.x). If a previous version of Python is used, then the imwrite function must change to 'none' compression flag since the 'lzw' flag is not supported on Windows 11 in imagecodes: see
docker build . -t wipp/wipp-hist-equalize-python:0.0.1
- open URL: https://usnistgov.github.io/WIPP-Plugin-Manifest-generator/
- type all relevant information into web form
- save the file as plugin.json
From this directory:
python ./src/histogram_equalization.py \
--inputImages ./sample-data/inputs \
--output ./sample-data/outputs
From this directory:
docker run -v "$PWD"/sample-data:/data \
wipp/wipp-hist-equalize-python:0.0.1 \
--inputImages /data/inputs \
--output /data/outputs
-v: mounts a volume/folder from your machine inside of the Docker container
- register the plugin.json in a deployed WIPP instance - see https://github.com/usnistgov/WIPP
- upload images from sample-data/inputs as WIPP image collection
- create a workflow by adding one step called histogram equalization
- run and monitor the workflow execution
- download resulting WIPPP image colection
- Peter Bajcsy, ITL NIST, Software and System Division, Information Systems Group
- Contact email address at NIST: peter.bajcsy@nist.gov
- The contributions to the code in this repository came from:
- Peter Bajcsy
- Mylene Simon
- URL for opencv tutorial: https://docs.opencv.org/4.x/d5/daf/tutorial_py_histogram_equalization.html
R. C. Gonzalez and R. E. Woods, Digital Image Processing, Third. Upper Saddle River, NJ, USA: Prentice Hall, 2008