1. Tuomo Valkonen
  2. dticode


DTI code

Written 2012-2014 by Tuomo Valkonen <tuomov@iki.fi>, 
University of Graz & University of Cambridge.

This repository includes code for TGV^2 and TV denoising and
reconstruction from sparse k-space data. For problems with
linear operators, the Chambolle-Pock [3] modified primal dual
hybrid gradientn method (PDHGM) is used. For problems with
non-linear, the non-linear PHDHGM of [5] and the Gauss-Newton
method are supported. Optional Bregman iterations may be applied
to many problems. The code is parallelised using OpenMP. 
There is also OpenACC GPU support, but at the moment it is
not actively maintained.

The included programs and cases covered are the following.

  * denoise: basic colour or grayscale image denoising.

  * tensorreg: Diffusion tensor denoising per [2]. This solves the 
    optionally positivity-constrained problem

        min_{u >= 0} FID(f-Au) + REG(u)

    for tensor fields u and f. For u, tensors of order 0 (scalar 
    functions), 1 (vector fields), and 2 are supported. A is a 
    pointwise operator, and FID either the L1 fidelity or the squared
    L2 fidelity. The regulariser REG is one of TGV^2, TD (TGV^1), or TV. 

    Small sub-problems in the positivity-constrained case with A!=I are
    solved with the primal-dual interior point method of [4].

  * ksreg: Sparse reconstruction from K-space data. This solves the

      min_u |f-SFu|^2 + REG(u)

    for complex image u, and sparse K-space data f. Here S is the
    sparse sampling operator and F the (discrete) Fourier transform.

  * ksreg-nl: The same as ksreg, but with individual regularisation
    of the phase and magnitude of u, and non-linear reconstruction of
    u from these.


    doc/            Documentation, include a user guide to the 
                    tensorreg program, and quick developer
                    introduction to the C code.

    examples/       Multiple use-case examples, and miscellaneous
                    Matlab code.

    src/            Source code.

    matlab/         Auxiliary Matlab code. 
                    (Plotting, NIFTI import, ...)
                    See README.matlab for information.

    mex/            Auxiliary Mex routines for Matlab.
                    Necessary for the plotting routine!


    GNU make        http://www.gnu.org/

                    Other variants of make may not work.

    pgcc            http://www.pgroup.com/

                    Or any other OpenACC compiler for the
                    GPU implementation.

    FFTW3           http://www.fftw.org/

                    For Fast Fourier Transform.

    NFFT3           http://www-user.tu-chemnitz.de/~potts/nfft/

                    Non-uniform Fast Fourier Transform.


To compile the code, follow the following steps

 1. Download install the libtu utility library from


 2. Copy local.mk.in as local.mk

 3. Edit local.mk to suit your system and choices.

 4. Run make

Third-party code

This package includes NIFTI code by Jimmy Shen (matlab/NIFTI_code), 
and Rice distribution code by Ged Ridgway (matlab/rician).


This work is published under GNU GPLv3. See the attached LICENSE.txt.


  [1] K. Bredies and K. Kunisch and T. Pock, Total generalised 
      variation, SIAM Journal on Imaging Sciences 3 (2011), 492--526.


  [2] T. Valkonen, K. Bredies, and F. Knoll, Total generalised 
      variation in diffusion tensor imaging, SIAM Journal on 
      Imaging Sciences 6 (2013), 487–525, DOI:10.1137/120867172



  [3] A. Chambolle and T. Pock, A first-order primal-dual algorithm
      for convex problems with applications to imaging, Journal of 
      Mathematical Imaging and Vision 40 (2011), 120-145. 


  [4] T. Valkonen, A method for weighted projections to the positive
      definite cone, SFB-Report 2012-016, Karl-Franzens University 
      of Graz (2012).



  [5] T. Valkonen, A primal-dual hybrid gradient method for non-linear
      operators with applications to MRI (2013). Submitted.