CbiRecon

From Heeger Lab Wiki

Jump to: navigation, search

The NYU Center for Brain Imaging [1] has developed a set of matlab tools for reconstructing fMRI images. The CBI WebDB server automatically reconstructs images. However, you may want to run the reconstruction locally. Here are some quick notes on how to get the recon code running on your machine.

Contents

[edit] Get the software

[edit] Use the heegerlab version

Just add the path to the cbiRecon directory.

>> addpath(genpath('/share/wotan/heegerlab/cbiRecon'))

This version may not be up-to-date though (it depends on whether I have updated it). If you want to have control over updating of the repository follow the directions in the next several steps.

[edit] download the recon code from CBI

 setenv CVSROOT :ext:eli@cbi.nyu.edu:/cvsroot
 setenv CVS_RSH ssh
 cvs checkout -P src/CBIRecon
 cvs checkout -P src/NIfTImatlab
 mv src cbiSrc

[edit] download the NIfTI C library from SourceForge

 cvs -d:pserver:anonymous@niftilib.cvs.sourceforge.net:/cvsroot/niftilib login
 # No password is necessary. Hit enter when prompted for a password
 cvs -z3 -d:pserver:anonymous@niftilib.cvs.sourceforge.net:/cvsroot/niftilib co -P Clibs
 mv Clibs niftiClibs

This library is needed to compile Valerio's nifti code. But, I (justin) couldn't get it to compile on my computer (a PPC Mac). It gave the following error:

echo "arch is "
arch is 
(cd znzlib; make depend; make lib;)
Makefile:33: depend.mk: No such file or directory
gcc -MM -I/usr/include znzlib.c >> depend.mk
csh: depend.mk: No such file or directory.
make[1]: *** [depend.mk] Error 1
Makefile:33: depend.mk: No such file or directory
gcc -MM -I/usr/include znzlib.c >> depend.mk
csh: depend.mk: No such file or directory.
make[1]: *** [depend.mk] Error 1
make: *** [znz] Error 2

I never figured out the problem, but instead of recompiling all of this, consider using the library in the heegerlab partition:

/share/wotan/heegerlab/cbiRecon/@niftiheader
/share/wotan/heegerlab/cbiRecon/@niftifile

[edit] Build the NIfTI stuff

[edit] building NIfTI Clibs

 cd niftiClibs
 make 

[edit] build CBI's NIfTImatlab

(note: this is complicated b/c the autoconf stuff is screwed up

 cd cbiSrc/NIfTImatlab
 autoconf
 ./configure

expect some warnings like:

 config.status: creating Makefile
 config.status: WARNING:  Makefile.in seems to ignore the --datarootdir setting

now edit the file called: src/Makefile.in
change LOCAL_LIBS to add the path to your niftiClibs lib directory. For me, that is:

 LOCAL_LIBS = -L${libdir} -L/users2/eli/src/niftiClibs/lib/ -lniftiio -lznz -lz 

do the same for CFLAGS:

 CFLAGS = -D$(OS) -I@srcdir@ -I$(loc_incdir) -I$(includedir) -I$(includedir)/nifti $(GCINCLUDEFLAG) -I/users2/eli/src/niftiClibs/include/ -DHAVE_ZLIB 

now reconfigure:

 ./configure

and make:

 make

All should build okay

[edit] Add the NIfTI and recon code directories to your matlab path

for my setup, my ~/matlab/startup.m file looks like:

 addpath(genpath('/Local/Users/eli/proj/cbiSrc/NIfTImatlab/matlab'));
 addpath(genpath('/Local/Users/eli/proj/cbiSrc/CBIRecon/matlab'));

[edit] run the recon code

 recon_seg('061212110942.raw', 'test2', 2)
Personal tools