FCONVERT(1) Version 1.6 Oct. 13 2003 NAME fconvert - converts between different medical imaging formats SYNOPSIS fconvert [-v|-help|-silent] <-in [input options]> <-out [output options]> DESCRIPTION There are two mandatory parameters: -in and -out Everything specified after -in is assumed to be an input option. Everything specified after -out is assumed to be an output option. Options can be general, format specific, or input/output specific. There are a number of assumptions that fconvert makes, when some of the options are omitted. If -dir is not given then current working directory is assumed. If -file is not provided then fconvert uses every file in given (assumed) directory with an appropriate format extension. Available input formats are: anz afni bv_stc bv_vtc bv_vmp bv_vmr gei gemr pgh vapet Available output formats are: anz afni bv_stc bv_vtc bv_vmp bv_vmr pgh OPTIONS GENERAL OPTIONS -v verbose mode. Print header info for debugging -silent silent mode. Do not display any messages. -help display this help INPUT/OUTPUT OPTIONS -dir directory where input/output files are located -file list of input/output files (20 files limit) -base prefix of the files that will be read/written -swap swap bytes on input/output INPUT ONLY OPTIONS -in input file format. -filelist ASCII file that contains the list of input files, one file per line. -range subset of total number of volumes of the form <[start..end(step)]> Ex: [1,3,2] [1..5(2)] etc.. The indexing is one based. OUTPUT ONLY OPTIONS -out output file format. -block blocking factor for output files. Number of volumes per output file. -scale Scale the output dataset by this number. -merge add extra header information from native header format file -aux This is a comma separated list of auxiliary header parameters as key = value pairs -datatype specify the output datatype. Available datatypes are (format dependent): int1 int8 int16 int32 float32 float64 NOTE: for ranges and aux list don't forget to use double quotes when running from the shell FORMAT SPECIFIC OPTIONS AND NOTES Analyze Format (anz) When -base is not specified on output, "func_" is used -range option can be used on the output side to re-number output files Valid keys to the -aux flag are: x_size, y_size, z_size and t_size for voxel size and x_org, y_org, z_org for SPM origin location. spm_scale key is used for setting SPM internal scale factor. You can pass 4d flag to produce 4 dimensional Analyze image, this is an analyze image that has 3D+time data. You can also pass a 'runs' flag to name filenames using run number convention. This option is similar to a blocking factor for multiple files. Files are simply grouped together by a naming convention.For example in normal mode files look like this: ., but in 'runs' mode the file will look like this: __. Runs number indicates how many volumes there are in each run. Analyze is the only format that supports 1 bit (int1) datatype When -datatype is not specified on the output, int16 datatype is used regardless of input datatype. For more information go to: http://www.mayo.edu/bir/PDF/ANALYZE75.pdf http://www.mrc-cbu.cam.ac.uk/Imaging/analyze_fmt.html Pittsburgh Format (pgh) When -base is not specified on output "pghout" is used -chunk name of the PGH chunk. If chunk is not given on output, "images" is used. Passing any key=value pair with the -aux flag adds relevant fields to the MRI header. Pittsburgh format takes care of byte-swapping issues automaticly. The endianness of the dataset is determined by utilizing .little_endian property in .mri file. Pittsburgh dataset on input side will always be in correct byte order regardless whether -swap flag is used on the input or not. For more information go to: http://godzilla.kennedykrieger.org/fiasco/mri_pgh.html Afni Format (afni) When -base is not specified on output, "afniout" is used A lot of very useful options are passed as -aux parameters. Unfortunately flags for those options are not user-friendly and were not meant to be used on the command line. You should use FormatConvert GUI to use those flags. Another important note is AFNI orientation. As far as AFNI is concerned all datasets are stored on disk in Axial (RAI) orientation. When orientation in the header is set to something other then the default, AFNI viewer applies the appropriate transformation matrix and displays the dataset as specified by the user. So if your dataset has a sagittal orientation, specifying sagittal orientation in the AFNI header will make your data look correctly in AFNI viewer. Afni format takes care of byte-swapping issues automaticly. The endianness of the dataset is an attribute in .HEAD file, that can be checked by using 3dinfo utility. Afni dataset on input side will always be in correct byte order regardless whether -swap flag is used on the input or not. For more information go to: http://afni.nimh.nih.gov/afni/ GE Formats (gei and gemr) Those formats can be read, but not written -sliceRange Subset of total number of slices. Argument is of the form <[start..end(step)]> Ex: [1,3,2] [1..5(2)] etc.. -swap swap bytes in data on input VAPET Format (vapet) Vapet format is only implemented on input for now and does not have any format specific options. One thing to note is that VAPET does not have a default extension, so every file in the input directory will be used as a VAPET file. For more information go to: http://neurovia.umn.edu/papers/tech_reports/vapet_format.html BV Formats (bv_stc bv_vtc bv_vmp bv_vmr) bv_stc STC files are stored as int16 (short ints). Each STC file contains the time course of a single slice, i.e., STC files are in txy order. That is, if you convert 48 analyze images to STC format, you will get N files where N is the number of slices in each image. To select all files from a single dataset, use the -base option on input to specify the common prefix of the files in that dataset. An FMR file can be specified on input using the auxiliary parameter "FMR_file". There is no option to merge an STC header on output. When -base is not specified on output, "stcout" is used. bv_vmp VMP files are stored as float32 (4 byte floats). Each VMP file stores a statistical map in xyz order. Only one map can be stored per file. When -base is not specified on output, "vmpout" is used. There is an option to merge an existing VMP header on output. The auxiliary parameters that can be used with bv_vmp are: "version", "MapType","NrOfLags","ClusterSize0", "ThresholdCrit0","ThresholdMax0","Df1","Df2","MapName0", "VmrDimX","VmrDimY","VmrDimZ","x_offset","y_offset","z_offset" bv_vmr VMR files are stored as bytes. Each VMR contains a high resolution anatomical volume in xyz order. One VMR volume can be stored per file. There is no option to merge a VMR header on output. When -base is not specified on output, "vmrout" is used. bv_vtc VTC files are stored as int16 (short ints). Each VTC contains a 4D functional dataset in txyz order. VTCs store multiple volumes per file. When -base is not specified on output, "vtcout" is used. VTC file is BrainVoyager low resolution functional dataset. There is an option to merge an existing VTC header on output. The auxiliary parameters that can be used with bv_vtc are: "t_size","version","FMR_file","PRT_file","x_offset", "y_offset","z_offset","h_delay","h_delta","h_tau", "seg_size","seg_offset" For more information go to: http://www.brainvoyager.com/BV2000OnlineHelp/BrainVoyagerWebHelp/ mergedProjects/FileFormats/BrainVoyager_File_Formats.htm EXAMPLES 1) Convert a single analyze file in current working directory to pittsburgh file format and set the chunk name to 'rawdata' fconvert -in anz -file func_00001 -out pgh -file pghfunc -chunk rawdata 2) Convert a directory of GE I.nnn files swapping the bytes on input to afni file. fconvert -in gei -dir 002 -swap -out afni -file afni_struct 3a) Convert a directory of analyze images to afni format with the blocking factor of 12. This means that if there are 48 images in the analyze directory, there will be 4 afni files with 12 volumes in each file. fconvert -in anz -dir air_images -out afni -block 12 3b) This is a reciprocal of the 3a example. Convert afni files with the prefix of 'afniout' to a directory of analyze images fconvert -in afni -dir . -base afniout -out anz -dir air_images 4) Convert afni subbricks 2 through 4 to an analyze format with the prefix 'subfunc_' fconvert -in afni -file afniout001+orig -range "[2-4]" -out anz -base subfunc_ 5) Convert BrainVoyager VTC file to afni format. Also merge the contents of the existing afni header with the newly created dataset. fconvert -in bv_vtc -file vtcdata.vtc -out afni -file afni_from_bv -merge afniout+orig.HEAD 6) Convert a 16bit analyze image to an 8bit analyze image. fconvert -in anz -file func_00001.img -out anz -file 8bit_func -datatype int8 NOTES Written by Eugene Tseytlin, Maureen McHugo, Benjamin Berry (University of Pittsburgh)