COBRA example as used in Dumoulin et al. (2003):

Data format

The input data (fMRI and aMRI) need to be in MINC format (.mnc) where the fMRI-files are 4D (time,x,y,z) and the aMRI 3D (x,y,z). Furthermore, it is crucial that the fMRI and aMRI files are properly aligned. Optional, a transformation file (.xfm) can be provided, that aligns the fMRI and aMRI data.

The dimensions of the aMRI and fMRI can be different. The fMRI data will be resampled to that of the aMRI. I strongly suggest providing the aMRI data at a higher sampling grid (resolution) than the fMRI data , this improves the accuracy of the VFS-computation.

Calling COBRA

 >> indicates MATLAB command line

Define output base name:
 >> output = 'my_output_filename'
E.g. the outputs will then be my_output_filename_mVFS.mnc etc.

The aMRI data was provided at 1mm3 resolution in MNI-space (Collins et al., 1994, Talairach et al., 1988) only covering the occipital lobe (see for example "Example/SubjectSD_t1w_occ.mnc.gz"). If the aMRI is in MNI-space it can be reshaped to the dimensions of the example using mincresample like: mincresample -like Example/SubjectSD_t1w_occ.mnc.gz aMRI_tal.mnc aMRI_tal_occ.mnc, since the fMRI data will be resampled to the aMRI data (main time and disk hogger) this will save disk-space and time.
Anatomical MRI:
 >> aMRI = 'aMRI_tal_occ.mnc'

The fMRI data (4D file) with polar angle stimulation (rotating wedges) in native space at 4mm3 resolution, in this example 3 (can be more or less) files for three scans:
 >> fmri_pol=strvcat('fMRI_pol_01.mnc', 'fMRI_pol_02.mnc','fMRI_pol_03.mnc')
Same for scans with eccentricity stimulation (expanding rings):
 >> fmri_ecc=strvcat('fMRI_ecc_01.mnc', 'fMRI_ecc_02.mnc','fMRI_ecc_03.mnc')

In our example the fMRI scan contained 128 time-frames, of which we have to ignore the first 8, for polar-angle and eccentricity scans:
 >> tf_ignore = [1:8; 1:8];
Ten stimulus cycles were present in the remaining 120 time-frames, for both polar angle and eccentricity scans:
 >> stim_freq = [10 10];
We also have to specify the relative direction of the scans, i.e. clockwise or counter-clockwise and expanding or contracting (columns) for the different files (row):
 >> stim_freq = [ 1 1;...
    -1 -1;...
    1 1];

Any additional outputs may be requested (here none are requested):
 >> add_outputs = 0;

Because the fMRI and aMRI are not aligned (native- and MNI-space, respectively) a transformation file needs to be given which aligns them:
 >> xfm = 'fMRI_native_to_aMRI_tal.xfm'
If the two fMRI scans were acquired in different sessions, three corresponding xfm-files may be given for each functional file:
 >> xfm = strvcat('fMRI_native_to_aMRI_tal_01.xfm',...
   'fMRI_native_to_aMRI_tal_02.xfm',...
   'fMRI_native_to_aMRI_tal_02.xfm')

This is not necessary if the fMRI and aMRI are aligned:
 >> xfm = []

The inverse is needed as well but will be created using xfminvert if it is not given:
 >> xfminverse = []
or:
 >> xfminverse = 'fMRI_native_to_aMRI_tal_inv.xfm'
or:
 >> xfminverse = strvcat('fMRI_native_to_aMRI_tal_01_inv.xfm',...
   'fMRI_native_to_aMRI_tal_02_inv.xfm',...
   'fMRI_native_to_aMRI_tal_02_inv.xfm')

Lastly, the file can be defined where the other variables can be found. If this is not given it will take the variables from the file "cobra_options.m":
 >> variables_file = 'cobra_options_modified_by_me'
Alternatively, specific options can be defined on the command line as well (see >> cobra options?).

Now you are ready to call COBRA:
 >> cobra(output,aMRI,fmri_pol,fmri_ecc,stim_freq,...    tf_ignore,directions,add_outputs,xfm,xfminverse,variables_file);
or if adding options (in this example keeping the temporary working directory) on the command line:
 >> cobra(output,aMRI,fmri_pol,fmri_ecc,stim_freq,...
   tf_ignore,directions,add_outputs,xfm,xfminverse,[],'KeepTmp',1);

or if you are happy with the default cobra options:
 >> cobra(output,aMRI,fmri_pol,fmri_ecc,stim_freq,...
   tf_ignore,directions,add_outputs,xfm,xfminverse)


COBRA may run for several minutes to several hours, depending on the data-size and processing speed.

Output files

Cobra will give several outputs, depending on whether additional outputs were requested. Be sure to check my_output_filename_avg_fft_magnitude.mnc, this is the magnitude of the fundamental stimulus frequency divided by the average magnitude of (assumed) noise frequencies. When overlaid on the anatomical MRI, this map should identify the occipital regions stimulated by the mapping stimuli. If this is not the case something has gone wrong.

The main output file is my_output_filename_avg_mVFS.mnc, which is the visual field sign map weighted by the magnitude map.

Last modified: Fri Nov 9 16:15:16 2012