Image processing library in C++
A library for 3D medical images written from scratch in C++: file readers, an image class and a family of filters, including a median filter built on the algorithm from Sonka's textbook. You can run it on a brain scan in your browser.
- When
- Nov to Dec 2021 (about 2 months)
- Status
- Online Runs in your browser, on this page.
- Where
- MSc coursework, PMI programming course
- Built with
- C++, Image processing, WebAssembly demo
- Made as
- Individual project
About the project
The library reads and writes two medical image formats (.pip and .mhd) and holds the scan in its own Image class, with constructors, iterators and resizing for up to five dimensions.
Every filter shares one interface: set the input, call update, get the output. On top of it sit a threshold filter, a statistics filter, an averaging convolution, a mask filter, a Gaussian blur, a Laplacian for edges and two median filters.
The second median filter follows the histogram-based algorithm described in Sonka's textbook Image Processing, Analysis and Machine Vision. In my version it came out slower than the plain median filter and seemed to keep edges slightly better. Both are in the demo above, so you can compare the running time yourself.
The demo runs the original source files, compiled to WebAssembly. The only code added for the website is a small wrapper that lets the page ask for one filter at a time.
Try it yourself
Loading the library and the scan (about 2 MB)…