NAME - converts Bruker format data to other image formats

SYNOPSIS [@configfile] [options] paravision_data_dir [output_dir]


If the Bruker data is stored in a directory ``/brukerdata/mysession'', and you want to create analyze format files in the current directory, then: /brukerdata/mysession/ -verbose -all

will convert all the series in the Bruker data directory.

See for more information.


    -help          print help message and quit
    -man           full documentation and quit
    -verbose       more messages, more detailed help output
    -quiet         no messages during operation
    -version       returns version no
    -clobber       overwrite pre-existing files
    -all           convert all series in the directory [default]
    -series        one or more series to convert
    -dbpath        one or more directories to search for PV data
    -ptype         one or more file name <-> protocol name pairs
    -outtype       output type, "analyze" or "minc"
    -outdir        directory to output files
    -outfile       name of file to output (extension ignored)
    -radio         use radiological orientation for orientation output 
    -noradio       use neurological orientation for orientation output [default]
    -showmat       display verbose sequential listing of orientation data
    -dirext        adds PV directory ext to output names
    -frecofix      fix reported byte ordering for FRECO and other reconstructions
    -rawfile       specify rawfile (2dseq) to use
    -anon          do not save subject data into brkhdr files
    -noanon        save subject data into brkhdr files
    -timelength    specify no of volumes in time series 
    -layers        separate images according to layer information [default]
    -nolayers      do not separate images according to layer information 
    -recono        reconstruction no to convert
    -reshape       whether to reshape (MINC only so far)
    -stepdir       directions of increase x, y, z
    -view          show image after conversion (MINC only)
    Configuration file containing any of the options above in format
    given by Getopts::Argvfile ( - the format is
    the same as for the command line, but allowing multiple
    lines and comments.


Print a long help message and exit.

Prints the manual page and exit.

Gives out moderately helpful warning and other messages during image conversion. Adding -verbose to -help outputs more help.

Turn off any messages during conversion

Returns version no to the console.

Will overwrite preexisting files. If there are preexisting files, and you do not use -clobber, pvconv will exit with an error message.

Convert all series in the directory. This is the default behaviour.

Specify series to convert, e.g. /brukerdata/mysession/ -series 1 -series 3

will convert series 1 and 3 only. Defaults to -all

Specify one or more directories to search for PV data. This can be used to give default search paths in which to look for the specified paravision subject data. e.g. mysession -dbpath /brukerdata -dbpath /another/dir

If (as here) the required directory does not contain a path component, seachpath is used to search for a matching dataset. Paths specified later are searched first: here, ``/another/dir'' will be searched before ``/brukerdata''.

If (as here) the required directory (``mysession'') does not contain an extension, then the program will search for any directory matching ``<inputname>*'' - here ``mysession*''. This allows you to search for data where you know only the first few characters of the directory name.

One or more file suffix / protocol name pairs for clever file naming - e.g: /brukerdata/mysession/ -ptype T3=tripilot -series 1

This -ptype string will cause pvconv to match the contents of the Bruker ACQ_protocol_name field with the regular expression after the equals sign (here the regexp is just the string ``tripilot''). If pvconv finds a match, it will append the first string in the pair (here ``T3'') to the output file name, preceded by an underscore. Here the output might be:


The protocol name is treated as a perl regular expression; for example, you might specify ``-ptype EPI=(epi|fmri)'' if you wanted files with either ``epi'' or ``fmri'' in the protocol_name field to have ``EPI'' appended to the output file name. The match is not case sensitive.

These file suffix / protocol name pairs are probably best stored in configuration files.

Specify output type, currently one of ``analyze'' or ``minc''. ``analyze'' is the default.

Directory to output converted image files; e.g. /brukerdata/mysession/ -all -outdir /home/me/images

The default output directory is the current directory.

Root name of image files to output (extension ignored); e.g. /brukerdata/mysession/ -series 2 -outname image2

will create Analyze format output files:


pvconv derives the default file name from the name of the Bruker data directory, the series number, and any matches it finds of the protocol name with preset strings identifying image types (see -ptype option).

Fix reported byte ordering for FRECO reconstructions in paravision 2.0, and for some other reconstructions. If the reco file specifies that the reconstructed data has a different endianness from the raw (FID) data, then the reconstructed data is assumed to have the endianness of the raw data. Try this flag if you get a snowstorm effect in converted images without it.

Set orientation calculations to return radiological orientation.

Set orientation calculations to return neuroogical orientation (the pvconv and Bruker default).

Shows a verbose output of the orientation matrix as it is built step by step from the Bruker parameters.

Adds Bruker directory extension to output names. Bruker data directories usually have an extension that is unique for the particular day of scanning. pvconv usually omits this extension from the default output filename; e.g. /brukerdata/mysession.fs1 -series 1

may generate a file: ./mysession_01.img

The -dirext option causes the extension to be added to the filename; e.g. /brukerdata/mysession.fs1 -series 1 -dirext

may generate a file: ./mysession_fs1_01.img

Omit Bruker subject information from .brkhdr txt file. Very useful if real subject names etc are stored in this file. use -noanon to keep subject information in brkhdr file.

Specify raw image file to use as image data instead of 2dseq: e.g. /brukerdata/mysession/ -all -rawdata mydata.img

Specify no of volumes in time series. This is useful in cases where the reco etc files have incorrect parameters, and you know the actual no of volumes.

Separate images according to layer information; for example, multiecho sequences such as combined T1/PD acquisitions have images from the two echos interleaved. This option will cause pvconv to split the interleaved slices into two images. Use -nolayers to disable this behaviour.

Reconstruction number to convert. Usually there is only one; use e.g. /brukerdata/mysession/ -series 4 -recono 2

to convert a second reconstruction for series 4.

Whether to reshape (MINC only so far)

Directions of increase x, y, z (MINC only)

Show image after conversion (MINC only)


Options can be specified by configuration files in the same format as for the command line, except options can be specified across many lines, and comments can be interposed: e.g /brukerdata/mysession @myconfig

where ``myconfig'' is the following text file

 # data search path, in search order
 -dbpath /cbu/imagers/wbic_data
 # file name ending for protocol regexps
 -ptype SPGR=spgr
 -ptype anatomique=anatom
 -ptype T3=tripilot
 -ptype template=template
 -ptype PD-T2=pd-t2
 -ptype EPI=(epi|new90|new100)
 -ptype phasemap=phase
 # frecofix by default

Configuration files are read in the following order: in the directory of the script; in your home directory; in the current directory; and any configuration file passed on the command line. Options in files read later override those in earlier files. Options passed on the command line override options passed in files, and any options specified earlier on the the command line than the @configfile item.

DESCRIPTION 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.


pvconv reads the text header files from the Bruker data format ( ), and uses the values therein to fill a header information for Analyze format images ( ), and possibly MINC files.


Matthew Brett <mailto://>

Andrew Janke <rotor AT DOT au>


This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License distributed with Perl version 5.003 or (at your option) any later version. Please refer to the Artistic License that came with your Perl distribution for more details.