Preliminary analysis

Here are the procedures

import the nifti files

Using the code wrapper_import_data_server.m just put the subject ids into the list

subj_id_list = {'3488','3487','3485','3422'}; % '3211','3402','3424','3425','3484' 

The code populates all the nifti files with extension 'nii.gz' and makes a measure (beta or zstat) matrix whose row contains exemplar and column contains all voxels in the scan.

The output files are

total_exemplar_beta_tstat_matrix.mat

total_sexemplar_beta_tstat_matrix.mat

Note that all exemplar will be included into the matrix regardless of whether or not they were included in the stimuli list or not.

-- list of undesired exemplar ---

filtered_exemplar_beta_tstat_matrix.mat

filtered_sexemplar_beta_tstat_matrix.mat

Note that so far, ROI is not considered at all, meaning that all the voxels in the scan are included in the output file.

Next we extract ROI and apply one to each subject using the code wrapper_ROI_extract_server.m., and the output files would be in the format of:

<input>_<roi_name>.mat

Now we want to export and assign the numerical values to the exemplar using the code wrapper_assign_category_label.m. Keep an eye on the warning messages you might get. For example,

The one below means the output is successfully processed, and there is no category mismatch occurring.

/NAS_II/Projects/MVPA_Language/lexical/3488/stats_images_fmri/filtered_exemplar_beta_tstat_matrix_lh_mask_vtc2
the following items are not marked properly
ans = 
   Empty cell array: 0-by-1

Alternatively, the category mismatch can happen when subject calls a category name not existing in the stimuli list. For example, a subject call 'tiger' as 'leopard', resulting in the following warning messages.

/NAS_II/Projects/MVPA_Language/lexical/3487/stats_images_fmri/filtered_sexemplar_beta_tstat_matrix_rh_mask_vtc2
the following items are not marked properly
ans = 
    'leopard'

And you will need to add the class 'leopard' into the stimuli list by opening the file stimuli/stim_list_5_v2.txt (not others) and add 'leopard' to the text file (and don't forget to save it!!!). Then we rerun the code wrapper_assign_category_label.m for that particular subject giving the warning.

Now we want to calculate the MI or IGR for each file using the code wrapper_precal_MI_n_fold_cv.m. We will use this precalculated MI/IGR later on. This process might take some times. The output files starts with mi_4_fold_X.mat.

So far we have:

1) the exemplar x measure matrix

2) the ROI masks

3) exemplar name with its category ground truth

4) the precalculated MI and IGR for each voxel in the brain

So, we are ready to perform leave-one-run-out classification on each file. We have 2 types: wrapper_decode.m and wrapper_decode_LRhemis.m.

for left hemisphere or right hemisphere alone, we use the code wrapper_decode.m. but for the left+right hemisphere, we will need the code wrapper_decode_LRhemis.m. The reason that we have the separate file to treat left+right hemisphere is that we will have to merge the voxels and MI from left and right sides of the brain together.