pvconv.pl - converts Bruker format data to other image formats
pvconv.pl [@configfile] [options] paravision_data_dir [output_dir]
e.g.
If the Bruker data is stored in a directory ``/brukerdata/mysession'', and you want to create analyze format files in the current directory, then:
pvconv.pl /brukerdata/mysession/ -verbose -all
will convert all the series in the Bruker data directory.
See http://pvconv.sourceforge.net for more information.
Options:
-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)
@configfile
Configuration file containing any of the options above in format given by Getopts::Argvfile (www.cpan.org) - the format is the same as for the command line, but allowing multiple lines and comments.
pvconv.pl /brukerdata/mysession/ -series 1 -series 3
will convert series 1 and 3 only. Defaults to -all
pvconv.pl 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.
pvconv.pl /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:
./mysession_01_T3.img ./mysession_01_T3.hdr ./mysession_01_T3.mat
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.
pvconv.pl /brukerdata/mysession/ -all -outdir /home/me/images
The default output directory is the current directory.
pvconv.pl /brukerdata/mysession/ -series 2 -outname image2
will create Analyze format output files:
./image2.img ./image2.hdr ./image2.mat
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).
pvconv.pl /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.
pvconv.pl /brukerdata/mysession.fs1 -series 1 -dirext
may generate a file: ./mysession_fs1_01.img
pvconv.pl /brukerdata/mysession/ -all -rawdata mydata.img
pvconv.pl /brukerdata/mysession/ -series 4 -recono 2
to convert a second reconstruction for series 4.
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
pvconv.pl /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 -frecofix
Configuration files are read in the following order: .pvconv.pl in the directory of the pvconv.pl script; .pvconv.pl in your home directory; .pvconv.pl 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 .pvconv.pl files, and any options specified earlier on the the command line than the @configfile item.
pvconv.pl 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 ( http://www.cmr.uq.edu.au/~rotor/software/ ) Many thanks to him for the original programs and helpful suggestions.
pvconv reads the text header files from the Bruker data format ( http://www.mrc-cbu.cam.ac.uk/Imaging/Common/brukerformat.html ), and uses the values therein to fill a header information for Analyze format images ( http://www.mrc-cbu.cam.ac.uk/Imaging/Common/analyze_fmt.html ), and possibly MINC files.
./mysession_05_EPI.hdr (Analyze header) ./mysession_05_EPI.img (Analyze image data) ./mysession_05_EPI.mat (SPM orientation) ./mysession_05_EPI.brkhdr (Bruker parameter text file data)
Matthew Brett <mailto://matthewb@berkeley.edu>
Andrew Janke <rotor AT cmr.uq.edu 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.