Home

Awesome

Michigan Image Reconstruction Toolbox (MIRT) - Matlab Version

https://github.com/JeffFessler/mirt

This directory contains various algorithms for image reconstruction and other inverse problems such as image restoration and image registration. It also contains code for related applications including MRI pulse design.

For many years this toolbox was posted as a (too large) .tgz file here: http://web.eecs.umich.edu/~fessler/code/index.html

The github version is a work-in-progress. All the code is here, but to keep the repo size small, the data and the compiled mex files are not included. Currently one must still use the .tgz file to get the complete version of the mex files and data.

To get some, but not all, of the mex files using the github repo, one can run the script ir_mex_build.m from the repo's home directory. To get some, but not all, of the data used in the examples, this repo will automatically download data from a data repo at https://github.com/JeffFessler/MIRTdata and store it on your machine. I will eventually work on some other way to distribute the complete data and mex files.

This Matlab code is no longer being very actively maintained because I am switching to using Julia instead. See: https://github.com/JeffFessler/MIRT.jl

GETTING STARTED

After installing the toolbox, use matlab's path functionality to put the top level directory in its path (or launch matlab from that directory). Then run the file setup.m that will add all the appropriate subdirectories to the path. You may find it convenient to read setup.m and customize it.

When using this repo for the first time, run the ir_mex_build.m script to create the mex files.

I recommend running and examining some of the files in the example/ directory or any of the many ..._example.m files around, such as emission/eml_osem_example.m

Many example files prompt you to hit enter before continuing, so you (and I) can see the output of each stage before proceeding. To change this behavior, execute prompt run. (See utilities/prompt.m for help.)

A few examples may require the binary programs wt or op that are part of Aspire. You can also get Aspire for free by following the instructions at http://web.eecs.umich.edu/~fessler/aspire/index.html There are also mex files that you may need: wtfmex and f3dmex for example. I distribute these only in linux/mac formats; see mex/ directory.

Part of my motivation for creating these files is to accompany a book on image reconstruction that I am currently writing. If you have any problems with these m-files, or any suggestions, I welcome your input!

Jeff Fessler, http://web.eecs.umich.edu/~fessler/

Subdirectories (in alphabetical order):

Most algorithms also include a test routine...

Additional notes:

Raymod Muzic has matlab routines for reading ECAT files available: http://www.nuclear.uhrad.com/comkat (I have not yet tried them myself.)

One of many annoying issues with Matlab is that it can store sparse matrices only as doubles, wasting memory, and if you do S * x, where S is a sparse matrix and x is a vector of class single, Matlab (as of 2016a) gives an error message rather than politely upgrading x to a double. The object Gsparse.m provides a work around for this. Complain to Mathworks that they should fix this limitation. Or use Julia.

Windows users:

Some of the subdirectories of the systems directory contain "links" to m-files in other directories. (These are created using ln -s in unix.) These links are also in the .tar file as soft links. But these links may not be recognized by Windoze, resulting in various error messages. They work fine on Mac OSX since it is unix "under the hood." I recommend that you avoid using Windows. But if you insist, then you will have to figure out how to fix those links or copy the appropriate m-files into the appropriate directories.

Another problem is that apparently windoze is case insensitive. I believe I have purged most of the m-files that had capitalized names now. Nevertheless, at this point it would be better to just install linux instead. Or switch to Julia.

2022 Mac Security work-around

Apparently recent versions of MacOS are very protective and may delete .mex files in the interest of security. The following command line instructions (where irt refers to the name of the directory where you installed MIRT) may help:

Deprecations:

Older versions included a subdirectory freemat that was intended to try to make the code run with freemat freemat. This is no longer supported; just use octave or Julia instead.