Code Monkey home page Code Monkey logo

clahe3d's Introduction

CLAHE3D

A three dimensional contrast enhancement code written in C++ and CUDA. Works as standalone C++ application or through a MATLAB interface specified as a *.mex file. Histograms are calculated for subvolumes of definable size. The spacing of the histogram bins can be chosen independently of the bin size. Afterwards, Each histogram is then converted into a normalized cummulative distribution function. By interpolating the inverted distribution function for each subregion, we can enhance the local contrast in a volumetric image.

Beside the basic functionality of CLAHE3D, I started implementing a few more volume processing functions which can improve the outcome of CLAHE3D such as

  • mean filtering
  • gaussian filtering
  • median filtering
  • thresholding of volumes (similar to clip limit)
  • normalization to custom range

All operations support multithreading on CPUs. Some are already pushed to the GPU, others not yet.

Preview of the effect CLAHE3D has on a medical volume

Cloning and Dependencies

git clone https://github.com/hofmannu/CLAHE3D.git
cd CLAHE3D
git submodule init
git submodule update

To use the GUI or CUDA support, there are a few more dependencies to install

Ubuntu

  • Compilation tools and helpers: git, cmake, g++
  • GPU: nvidia-cuda-toolkit
  • Stuff to display things using the GUI: libglfw3-dev
  • Saving and reading from h5 files: libhdf5-dev

With those libraries installed it should work. A few libraries might not be matching with your OS path to them (e.g. not finding header files). The code was only tested for ArchLinux to its full extend.

ArchLinux

  • Compilation tools and helpers: git, cmake, g++
  • GPU: cuda
  • Stuff to display things using the GUI: glfw-x11 or glfw-wayland, glew
  • Saving and reading from h5 files: hdf5

Installation / Compiling

The code is compiled using cmake. You can use the code also with GPU support and the functions will then be accelerated on the GPU (requires CUDA and CUDA capable device). To compile with GPU support, change the flag USE_CUDA in the main CMakeLists.txt to TRUE. Same is true if you want to use the ImGui based graphical user interface (basically a simple slicing and execution interface). Execute the following commands from the project directory.

mkdir Debug
cd Debug 
cmake ..
make all
ctest 
./main_gui

To run a throughout test of the procedures, run ctest from the Debug subfolder after compilation.

Preview of GUI

Feature request / bug report

Feel free to contact me if you need the addition of a feature or if you want to report a bug. Next step of this project is to enable the simultaneous processing of multiple volume pipelines using a simple scripting language. Other feature requests and processing functions are listed in the issues section. Furthermore, the slicer should get some advanced features soon.

Literature about CLAHE3D

clahe3d's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

clahe3d's Issues

Failing testcase #9

Running CLAHE3D with GPU support fails testcase #9 with the following output:

ctest --rerun-failed --output-on-failure

Start 9: test_gaussfilt
1/1 Test #9: test_gaussfilt ...................Subprocess aborted***Exception:   1.38 sec
terminate called after throwing an instance of 'char const*'


0% tests passed, 1 tests failed out of 1

Total Test time (real) =   1.38 sec

The following tests FAILED:
	  9 - test_gaussfilt (Subprocess aborted)
Errors while running CTest

Possibly related warnings that are thrown during compilation:

meanfilt.h:24:7: warning: direct base ‘cudaTools’ inaccessible in ‘meanfilt’ due to ambiguity [-Winaccessible-base]
   24 | class meanfilt :
      |       ^~~~~~~~
 warning: narrowing conversion of ‘(int)sett.gaussfiltsett::kernelSize[0]’ from ‘int’ to ‘long unsigned int’ [-Wnarrowing]
   75 |         gaussfilter.set_kernelSize(
      |        

I downloaded and built the packaged exactly as provided in the instructions. System is an updated ARCH Linux with Nvidia 3090.

Add masking class

generate binary masks depending on a threshold and apply those masks to other volumes again. Implementing this feature requires severe reprogramming of the volume handling since we want to store multiple representations simultaneously.

Make workspace interface to handle multiple volumes at a time

For the future we want to be capable of combining different versions of the volume after applying for example different filters. For this it would be very nice to have a workspace where we can rename, copy, create, delete, etc. different volumetric representations.

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.