Update 3/4/19: I am in the process of cleaning up the C++ version and creating cmake files. This was originally ported from the C version and did not fully exploit C++ constructs.
DISCLAIMER: This is research done at Stanford University. We do not guarantee that the code is error-free. Please contact the author if you find any bugs or have any suggestions or thoughts. Evan Levine (evanlevine@alumni.stanford.edu) 2017.
There are MATLAB, C, and C++ implementations.
MATLAB code, test scripts, and two demos. Implementations of sampling functions in MATLAB are provided in matlab/dda_utils.
C code that can be used with the Berkeley Advanced Reconstruction Toolbox (BART). If this is not set up, MATLAB code will revert to slower implementations in MATLAB.
To use this, check out BART and commit 125a8a2c794f3cde7aa17294e35aed23de838d75.
The following functions should be added.
Calculate w from sensitivity maps.
Calculate p from sampling pattern.
Calculate Delta J from w and p.
Best candidate sampling and approximate best candidate samplign.
C++ implementation of best candidate sampling algorithms and function to compute Delta J. The BART implementation has the same functionality and a few more algorithms. I preferred C++ to implement the data structures used in best candidate sampling.
===============
MATLAB.
g++ and BART are recommended as efficient implementations. For cpp version, cmake and boost are required. On macOS, run "brew install boost" with homebrew.
To compile the C++ version with CMake, run
$ cd cpp
$ mkdir build
$ cd build
$ cmake ..
$ make
Steps to set up BART code are:
- Install BART. Your BART directory, should have a Makefile and subdirectory src. I'll refer to this directory as "bart."
- Copy the directory dda_tools to bart/src/. This is the library with sampling functions
- Copy the C files in bart, dda_getp.c, dda_getw.c, dda_getDeltaJ.c, dda_bc.c to bart/src/.
- Make the following changes to the BART Makefile so that it looks like BART/Makefile
Add these lines:
MODULES_bart = -lbox -lgrecon -lsense -lnoir -liter -llinops -lwavelet -llowrank -lnoncart -lcalib -lsimu -lsake -ldfwavelet -lnlops -lmoba -lgeom -lnn -ldda_tools
MODULES_dda_bc = -ldda_tools
MODULES_dda_getw = -ldda_tools
MODULES_dda_getp = -ldda_tools
MODULES_dda_getDeltaJ = -ldda_tools
TSAMPLING=dda_bc dda_getp dda_getw dda_getDeltaJ
Modify the following lines:
XTARGETS +=
ALIBS = misc num grecon sense noir iter linops wavelet lowrank noncart calib simu sake dfwavelet nlops moba lapacke box geom nn dda_tools
MODULES_bart = -lbox -lgrecon -lsense -lnoir -liter -llinops -lwavelet -llowrank -lnoncart -lcalib -lsimu -lsake -ldfwavelet -lnlops -lmoba -lgeom -lnn -ldda_tools
- Compile the BART code with: $ make dda_getp $ make dda_getw $ make dda_getDeltaJ $ make dda_bc