pvconv.pl - a Bruker data converter

This page very briefly describes a program - pvconv.pl - that converts Bruker format MRI data to Analyze image format. It may also convert Bruker data to MINC format.

The program is based on the converters by Andrew Janke; many thanks to him for the original programs and helpful suggestions.

See the pvconv help for pvconv features and usage. This help information is also available by running pvconv from the command line thus:

pvconv.pl -help  (help summary)
pvconv.pl -help -verbose (more extensive)
pvconv.pl -man   (full documentation)

Installing

The program is written entirely in perl. You will need a working version of perl 5 on your system. To install, download the latest version of the pvconv archive via the pvconv project SourceForge page.

pvconv needs these packages from CPAN: MathMatrix 0.4 and Getopt::Argvfile. See the CPAN module install instructions.

You install pvconv using the normal perl module distribution drill. You will need to decompress and unpack the archive file. Then, for Unix, build and install like this:

perl Makefile.PL
make
make test
make install

This will require root permissions, and will write the script (program) files to a system directory such as /usr/bin; the various library files will end up on your perl system path. If you want to install a private copy of pvconv in your home directory, then you should try to produce the initial Makefile with something like this command:

perl Makefile.PL PREFIX=~/perl

This will put all the library modules in ~/perl/lib, and the scripts in ~/perl/bin. If you want to be more tricky you could try something like:

perl Makefile.PL LIB=~/perl INSTALLSCRIPT=~/bin
will put the libraries into ~/perl/lib, and the scripts into ~/bin.

The Makefile.PL program will start out by checking your perl installation for a few packages that are recommended to be installed together with pvconv.

Windows users may need nmake instead of make to run the installation above.

You can set the default command line options for running pvconv using configuration files; see the help for configuration files.

Time series files

If there are many time points in the data - e.g. for FMRI, then the analyze image that results will be a 4D file (x,y,z, time). You may want to use the ana4dto3d program to convert the 4D image to separate 3D volumes for each time point.

Remaking .mat files from Bruker data

If you have previously converted your Bruker data, still have the Bruker text files, and just want to create the .mat files for those data, you can use the brk2mat.pl program, which is in the same archive as pvconv.

pvconv creates a text file "image.brkhdr" which is the concatenation of all the Bruker text files for the image. You will need to create this file if pvconv has not done it for you, using something like this (3 is the run number you want, "brukerdirectory" is the Bruker data directory for this scanning session):

cd brukerdirectory/3
cat ../subject imnd acqp pdata/1/reco > image.brkhdr
- or put all these files into the same file with a text editor.

Now, you can create a .mat file from this .brkhdr file, with:

brk2mat.pl image.brkhdr
which results in a .mat file "image.mat".

Showing parameters for runs in a Bruker session

If you want to see the scan names, session numbers and number of repetitions for all the files in a Bruker data directory, use pvshow.pl which is in the same archive as the other programs. Here is some example output:
pvshow.pl 000054-m04.ci1/ -all
000054-m04.ci1:1: GEFI_TOMO_TriPilot; byte order: bigEndian; nreps: 1; reconstructed: Yes
000054-m04.ci1:2: EPI_FID_100_fmri; byte order: bigEndian; nreps: 1; reconstructed: Yes
000054-m04.ci1:3: EPI_SE_100_template; byte order: bigEndian; nreps: 4; reconstructed: Yes
000054-m04.ci1:4: EPI_FID_100_fmri; byte order: littleEndian; nreps: 300; reconstructed: Yes
000054-m04.ci1:5: EPI_FID_100_fmri; byte order: littleEndian; nreps: 260; reconstructed: Yes
000054-m04.ci1:6: EPI_SE_100_template; byte order: bigEndian; nreps: 4; reconstructed: Yes
000054-m04.ci1:7: EPI_FID_200_fmri; byte order: bigEndian; nreps: 1; reconstructed: Yes
000054-m04.ci1:8: EPI_SE_200_template; byte order: bigEndian; nreps: 4; reconstructed: Yes
000054-m04.ci1:9: EPI_FID_200_fmri; byte order: littleEndian; nreps: 260; reconstructed: Yes
000054-m04.ci1:10: EPI_SE_100_template; byte order: bigEndian; nreps: 4; reconstructed: Yes
000054-m04.ci1:11: EPI_FID_100_fmri; byte order: littleEndian; nreps: 300; reconstructed: Yes
000054-m04.ci1:12: new 3d phase 1a; byte order: bigEndian; nreps: 1; reconstructed: Yes
000054-m04.ci1:13: new 3d phase 1b; byte order: bigEndian; nreps: 1; reconstructed: Yes
000054-m04.ci1:14: new 3d phase 1c; byte order: bigEndian; nreps: 1; reconstructed: Yes
000054-m04.ci1:15: PD-T2 FSE; byte order: bigEndian; nreps: 1; reconstructed: Yes
000054-m04.ci1:16: SPGR_1mm; byte order: bigEndian; nreps: 1; reconstructed: Yes

The End

I hope this converter is useful to you. If you have any problems, please email me (Matthew Brett). and I will try and help. I will probably ask for a tarred archive of a Bruker data directory (a directory that contains a single scanning session) with the data giving the problem. You might want to remove the FID files from the archive, as they are not used by pvconv, and take up a large amount of space.

Matthew Brett 7 January 2002, 16 September 2002

SourceForge.net Logo

Last Refreshed: Wed Oct 10 15:22:13 BST 2007