File Types:
The image data is provided to us in a pff (Pittsburgh File Format)format (It is a binary file). There is one raw data file for each subject named detrend.dat and a corresponding detrend.mri contains the information about the dat file (e.g. the number of images and number of pixels in each image). There is also a split file named <subjectnumber>sp1 for each subject which contains 2 columns: condition number and number of  images per token.

The conditions are as follows:
1 -- fixation
2 -- PP preferred
3 -- PP unpreferred
4 -- RRC preferred
5 -- RRC unpreferred
6 -- blocked RR pref (ignore)
7 -- blocked RR pref (ignore)

There are 4 fixation tokens and 10 tokens each for conditions 2 - 5. The 4 fixation tokens will each be 20 images. The number of images for each token in conditions 2 - 5 will vary between 16 and 18.There are 840 separate images ranging from 0-839.

For each subject we also have also have a <subjectnmuber>tsp1 file that contains a separate line for each of the 840 images.The first column is the image number, the second column is a zero and is meaningless, the third corresponds to the condition of the and the fourth is the image number within a token.This file cannot be used as a split file in FIASCO. However, a split file can be created by using the third column for the condition number and adding a column of 1's as the image per token number.
 

For each subject we also have a subdirectory named <subjectnumber>_voxinfo which contains files containing lists of relevant voxels for specific brain areas. The files are named:


.. 02882.LB.fs.list(ascii list of relevant voxels for left Broca)
.. 02882.LT.fs.list(ascii list of relevant voxels for left Temporal)
the data in the ".list" files is indexed based on the first voxel being x=1,y=1,z=1.
The voxinfo directoy also contains a subdirectory named mroi contains information about the roi
LB, LT, RB, RT (subdirectories for four ROIs)
.. .. .. 02882_??_Z0 to 02882_??_Z6(theseascii files contain x and y 
coordinates of the ROI for each
slice numbered 0 to 6)
The data in the "mroi" files is indexed based on the first voxel being x=0,y=0,z=0.

The first two files (02882removed.dat and 02930removed.dat) list the
images that are to be ignored (usually we set condition = 0).Listed is
the image number.It is based on starting at 0 and going to 839.

Data Manipulation Utilities:
To view the data as images, we need to use pff2ppm. It converts data from a PFF format file to a series of PGM images. pff2ppm takes as input the detrend.dat file and a range of values for z and t and outputs a series of images for the given z and t values. All z slices for a given time t can also be merged in a single image. A sample run would be:
The following command generates 10 ppm files with the base name "test" of t = 0-9, z=3:
pff2ppm /afs/cs/project/theo-35/fmri/02882_34/detrend.dat test 0 9 3 3

More help is available if pff2pgm is run without any arguments.
To use the fMRI data in any learning algorithm, we need to convert the pff file to an ascii file. Pff2txt (also called voxelcropper)utility does exactly that. Also it can take a list of voxels (x,y,z coordinates) in which weare interested and generate an ascii file only containing information about those voxels. The list of voxels is stored in the .fs.list files and the program generates a .loc file which which contains the x,y,z locations of the cropped voxels and the .hdr file which contains various human readable information about the data

The following command generates data files for the lb area:

pff2txt -cf /afs/cs/project/theo35/fmri/02882_34/02882_voxinfo/02882.LB.fs.list -tf /afs/cs/project/theo-35/fmri/02882_34/2882tsp1 /afs/cs/project/theo-35/fmri/02882_34/detrend.dat /afs/cs/project/theo35/fmri/02882_34/lb_dat/02882_lb

The ".loc" file generated by the program utilizes a co-ordinate system
where the first voxel is x=0,y=0,z=0.

By default the cropping file is assumed to utilize a co-ordinate system
where the first voxel is x=1,y=1,z=1.This can be changed with the "-i0" option.

The convention for naming the ascii files generated by pff2txt is the following. In each of these directories there is one file for each of the trials, where each line of the file is a set of 15 floating point numbers in ascii, separated by spaces.An example filename is as follows:

02882_lb_i525_c05_n17.031
02882 = subject number
lb= brain areas
i525= original image index (time) of the first image
in this subsequence
c05= experimental condition
n17= number of images in this subsequence
.031= index of the trial for this subject (begins with trial 000)

To use the program pffvar:

Calculate the mean and variance of the data in a pff file.

For help, just type: pffvar:

The following command generates "pff" files containing the mean, variance,
and standard deviation of the entire sequence of data in the 
"02882_34" directory:

pffvar -mf 02882_mean.pff -vf 02882_var.pff -sf 02882_stdev.pff /afs/cs/project/theo-35/fmri/02882_34/detrend.dat 

------------------------------------------------------------------------------

To use the program pffhist:

Calculate a histogram of the data in a pff file.

For help, just type: pffhist

The following command generates a histogram for the file "02882_var.pff"
cotaining variance data:

pffhist -ts 0 -te 0 02882_var.pff > 02882_var.hist

------------------------------------------------------------------------------

Pretty voxel plotting of LB MSE data - full brain version:

pff2ppm -sc 2 -pa -1 -ds 10000 -cm 5 -pf lb-predictability.vox -zm 1 /afs/cs/project/theo-35/fmri/02882_34/stats/02882_mean.pff lb-pred 0 0 0 6
rm -f lb-pred_t000.gif
ppmquant 256 lb-pred_t000.ppm | ppmtogif > lb-pred_t000.gif

------------------------------------------------------------------------------

Pretty voxel plotting of LB MSE data - cropped version:

pff2ppm -sc 4 -xs 35 -xe 55 -ys 10 -ye 30 -pa -1 -ds 10000 -cm 5 -pf lb-predictability.vox -zm 1 /afs/cs/project/theo-35/fmri/02882_34/stats/02882_mean.pff lb-pred-crop 0 0 0 6
rm -f lb-pred-crop_t000.gif
ppmquant 256 lb-pred-crop_t000.ppm | ppmtogif > lb-pred-crop_t000.gif

------------------------------------------------------------------------------

Pretty voxel plotting of LB MSE data - full brain version - straight to gif:

rm -f lb-pred_t000.gif
pff2ppm -sc 2 -pa -1 -ds 10000 -cm 5 -pf lb-predictability.vox -zm 1 /afs/cs/project/theo-35/fmri/02882_34/stats/02882_mean.pff stdout 0 0 0 6 | ppmquant 256 | ppmtogif > lb-pred_t000.gif

------------------------------------------------------------------------------

Pretty voxel plotting of LB MSE data - cropped version - staright to gif:

rm -f lb-pred-crop_t000.gif
pff2ppm -sc 4 -xs 35 -xe 55 -ys 10 -ye 30 -pa -1 -ds 10000 -cm 5 -pf lb-predictability.vox -zm 1 /afs/cs/project/theo-35/fmri/02882_34/stats/02882_mean.pff stdout 0 0 0 6 | ppmquant 256 | ppmtogif > lb-pred-crop_t000.gif

------------------------------------------------------------------------------