Getting Started


dictlearn is a module for signal and image processing. This tool include easy-to-use algorithms for denoising, inpainting, feature enhancement and detection, and image segmentation. Additionally, this tool has some methods designed specifically for medical image processing, among these are vessel segmentation and denoising of large 3D images.

  • Multiple algorithms for dictionary learning and sparse coding
  • Accelerated with Cython and C
  • Built on numpy, scipy and scikit-learn

This module is a part of a masters thesis in applied mathematics, which can be read here.


Clone the repository:

$ git clone


Install dependencies with:

$ pip install -r requirements.txt

Make sure scipy and numpy are linked with BLAS/lapack. See the installation guides for numpy and scipy for more details.

Then install the library with:

$ python install


Using Anaconda is strongly recommended. The PyWavelet package in requirement.txt are not listed in anaconda package repository. Comment out this dependency with #, then install dependencies with conda install:

$ conda install --file requirements.txt
$ pip install PyWavelets

Then install the library with:

$ python install

Cython not compiling on Windows

Make sure you have the Microsoft C++ compiler. Download the compiler for python 2.7:
For python 3 you need Build Tools for Visual Studio 2017 :

See here if downloading the above compiler doesn’t fix the problem.

Next steps

See the examples, or the dictionary learning tutorial