Statistical Image Processing and Multidimensional Modeling

Matlab Scripts | (see also Links to Data Sets, List of Examples) |

Nearly all figures in the book showing any kind of numerical result are computer generated, rather than artificially drawn, meaning that I (the author) had to develop Matlab scripts to produce all of the figures. Therefore, to make the methods and algorithms described in this book as useful and accessible as possible, a variety of the MATLAB scripts are being made available.

The intent of the scripts is certainly not to be directly applicable to large multidimensional problems. Instead, the code is provided to give the reader some simple examples which actually work, which illustrate the concepts documented in the text, and which hopefully more rapidly lead the reader to be able to do implementations of his or her own.

Therefore I wish to make available much of the code which I developed. The code is provided "as is", with no guarantees of correctness:

- Hopefully the code is complementary to the textbook, allowing the reader to learn and understand certain concepts more clearly.
- The code is not interactive, and in many cases does not produce nicely-formatted multi-panel figures. It is code which produces the figures which you see in the textbook.
- You are free to take the code and edit/modify it. However if you use the code in a publication you should acknowledge it, and if you post the code you need to provide a link back to this page.
- There are subtle variations between different versions of Matlab, Octave etc., particularly with regards to plotting commands. All of the scripts on this page were tested to run under Matlab 7.9 on a dual-core Linux machine, but should require only minor tweaks to run acceptably under other versions.
- All of the scripts take a first argument 'printon', which determines whether to plot to file or to format for viewing on a computer screen. By default, the function plots to figures on the screen.

Click on any of the bold headings below to expand / collapse the individual descriptions and script links:

Matrix Condition Number (cond_num.m) | (Used in Example 2.4, Example 2.5) |

Evaluate the condition number for exponential and Gaussian point-spread functions for two different point-spread widths. Separately evaluate the likelihood of a matrix being positive-definite as a function of its condition number and the degree of random perturbation.

Parameters: | none |

Produces: | the 17 figure panels of Examples 2.4 and 2.5 |

Link: | cond_num.m |

Requires: | nice_plot.m, plotprint.m |

Interpolation and Regularization (interp_reg.m) | (Used in Example 2.7) |

Perform simple one-dimensional regularized interpolation given a few data points, using both first-order and second-order priors.

Parameters: | none |

Produces: | the figure panels of Example 2.7 plus panels for an earlier version of Example 3.4 |

Link: | interp_reg.m |

Requires: | nice_plot.m, plotprint.m |

Cross Validation (cross_val.m) | (Used in Example 2.8) |

Perform a cross-validation as illustrated in Example 2.8. Cross validation is performed for flat, linear, and parabolic measurements, and for 1st/2nd/3rd order models. It is important to observe the interplay between the form of the measurements and the assumed order of the prior.

Parameters: | none |

Produces: | three figures: measurements, cross-validation, and resulting estimates |

Link: | cross_val.m |

Requires: | nice_plot.m, plotprint.m, exprange.m |

Matrix Banding (bands.m) | (Used in Figure 5.7, Figure 5.18) |

A simple script showing very basic multiplicative and inverse behaviour of banded matrices

Parameters: | none |

Produces: | First and second order banded system matrices, matrix inverse of banded matrix |

Link: | bands.m |

Requires: | nice_plot.m, plotprint.m |

Matrix Kernels (kernels.m) | (Used in Figure 5.8) |

Computes 1D, 2D, 3D kernels for the first-order (membrane) and second-order (thin-plate) prior models. Also defines the 2D "wood grain" texture which is used frequently in the book.

Parameters: | none |

Produces: | no plots, just 1D, 2D, 3D kernel definitions |

Link: | kernels.m |

Requires: | none |

Kernel Correlation Length (corr_len.m) | (Used in Figure 5.15) |

Calculate the correlation length of 1D, 2D, and 3D kernels. Uses the FFT method to invert the kernels, and so is a good illustration of FFT approaches.

Parameters: | none |

Produces: | Two figures, the correlation length for first-order and second-order priors |

Link: | corr_len.m |

Requires: | kernels.m, progress.m, nice_plot.m, plotprint.m |

Two-Dimensional Interpolation (twod_interp.m) | (Used in Example 5.1, and Figures 9.3, 9.6, 9.7, 9.8, 9.12) |

A very large 2D interpolation example with cuts, folds, and boundary conditions. The code is very complex and may require a lot of memory, especially for some of the preconditioned problems. Includes code for both preconditioning via wavelets and hierarchical triangles.

Parameters: | none (6 parameters may be specified, but leave empty to generate default plots) |

Produces: | 16 plots of reconstructed surfaces and of iterative convergence |

Link: | twod_interp.m |

Requires: | nice_plot.m, plotprint.m |

Matrix Positivity (posdef.m) | (Used in Figure 5.16, Figure A.1) |

A look at issues of matrix positivity. The script computes the range of correlation coefficients over which a matrix is positive-definite, and also plots the six analytical positive-definite forms.

Parameters: | none |

Produces: | two figures |

Link: | posdef.m |

Requires: | nice_plot.m, plotprint.m |

Matrix Condition Number (cond_num.m) | (Used in Example 2.4, Example 2.5) |

Evaluate the condition number for exponential and Gaussian point-spread functions for two different point-spread widths. Separately evaluate the likelihood of a matrix being positive-definite as a function of its condition number and the degree of random perturbation.

Parameters: | none |

Produces: | the 17 figure panels of Examples 2.4 and 2.5 |

Link: | cond_num.m |

(Page last updated September 13, 2016, [an error occurred while processing this directive])