5. Session / Datamat file pairs
5.1. Creating PET session file
5.2. Creating PET datamat file
5.3. Creating ERP session file
5.4. Creating ERP datamat file and ERP
data file
5.5. Modifying ERP datamat file and
saving to a different name
5.6. Creating E.R.fMRI session file
5.7. Creating E.R.fMRI datamat file
5.8. Creating E.R.fMRI session file with
user defined HRF
5.9. Creating E.R.fMRI datamat file with
user defined HRF
5.10. Creating Blocked fMRI session
file
5.11. Creating Blocked fMRI datamat
file
5.12. Creating Structural MRI session
file
5.13. Creating Structural MRI datamat
file and data file
5.14. Modifying Structural MRI datamat
file and saving to a different name
7.1. Displaying PET result file
7.1.2. Voxel Intensity Response
7.1.3. Multiple Voxels Extraction
7.1.4. Design LV and Design Scores Plot
7.1.5. Task PLS Brain Scores with CI
7.1.6. Brain Scores vs. Behavior Data
Plot
7.1.7. Datamat Correlations Response
7.1.8. Datamat Correlations Plot
7.2. Displaying Structural MRI result
file
7.3. Displaying Blocked fMRI result file
7.4. Displaying E.R.fMRI result file
7.4.1. Different slices layout in result
window
7.4.2. Response Function Plot vs. Voxel
Intensity Response
7.4.3. Temporal Brain Scores Plot
7.4.4. Temporal Brain Correlation Plot
7.4.5. Different Datamat Correlations
Response window
7.5. Displaying ERP result file
9.1. How to write a batch script file
9.2. Batch file to create E.R.fMRI
datamat
9.3. Batch file to run E.R.fMRI analysis
9.4. Batch file to create Blocked fMRI
datamat
9.5. Batch file to run Blocked fMRI
analysis
9.6. Batch file to create ERP datamat
9.7. Batch file to run ERP analysis
9.8. Batch file to create PET datamat
9.9. Batch file to run PET analysis
9.10. Batch file to create Structural
datamat
9.11. Batch file to run Structural
analysis
10.1. Appendix A: Example Data Sets
10.2. Appendix B: Command-Line PLS
10.3. Appendix C: Plot Bootstrap
Results for Region of Interest (ROI) analyses
Partial least squares (PLS), which was first introduced to the neuroimaging community in 1996 (McIntosh et al., 1996), has proven to be a robust method for extracting distributed signal changes related to changing task demands (Mean-Centering PLS and Non-Rotated Task PLS). It has also been applied to measuring distributed patterns that impact on task performance (Regular Behav PLS, Non-Rotated Behav PLS and Multiblock PLS) and finally to task dependent changes in the relation between brain regions. This latter application is an assessment of functional connectivity or the correlation between neural elements (Seed PLS). PLS analysis has been used to characterize distributed signals measured by neuroimaging methods like positron emission tomography (PET), event-related functional magnetic resonance imaging (E.R.fMRI), Blocked fMRI, Structural MRI, event-related potentials (ERP) and magnetoencephalography (MEG).
PLSgui is a MATLAB program with a graphic user interface (GUI) driven by messages from mouse and keyboard. As an alternative, this user interface can also be driven by batch_plsgui command (see Batch Process), which is part of PLSgui program. PLScmd program (see Appendix B) is a command-line PLS, and it is a separate program that is not compatible with PLSgui. Both PLSgui and PLScmd can be downloaded from our Download Files web page.
For PET, Structural MRI, E.R.fMRI and Blocked fMRI, PLSgui is compatible with both ANALYZE format images (Mayo Clinic) and NIfTI format images (National Institutes of Health). For ERP (including MEG), it can read some of the binary data directly; such as NeuroScan average data, ANT's average data, EGI's simple-binary data, as well as tab (or space) delimited text files from any system.
This User's Guide intend to show how to use PLSgui program to those users who have already understood the PLS method. If PLS is new to you, please read relevant articles first.
Here are the links to some useful web pages for the PLSgui program:
The PLSgui program runs from MATLAB Version 5.3.1 and above, platform independent. It has been tested up to MATLAB Version 7.4.0 (R2007a). Since PLSgui takes in all the useful information in the raw images, we suggest that you would better add as much memory as your system can support. If you have MATLAB Version 7 (R14) and above, All except ERP module in PLSgui will automatically take advantage of its single precision math operation feature, except you are using Intel 64-bit machine. According to MATLAB Bug Report ID 268001, MATLAB will give completely wrong result when performing single precision math operation on an Intel 64-bit machine. Therefore, when PLSgui detects that the MATLAB is running on a 64-bit computer, it will confirm that whether this system is a 64-bit machine. If you don’t know, the program will treat it as an Intel 64-bit machine, and will not perform single precision math operation.
If you do not have powerful system with lots of memory, you might want to consider re-sampling the raw images to a larger voxel size. When you increase the voxel size, the total amount of voxels reduces, and the dataset size also reduces.
In the MATLAB command window, type plsgui (make sure that the PLSgui program is in the MATLAB searching path), and you will see the start window (Figure 1).
Figure 1
As you can see in this start window, there are 5 buttons on top row, which stand for 5 PLS modules: PET, ERP, E.R.fMRI, Blocked fMRI, and Structural MRI. You must first select which module you would like to run. Below this top row, you will find 4 more buttons that indicates the basic flow of an experiment: Session Profile, Run PLS Analysis, Show PLS Result, and CLOSE, where clicking CLOSE button will close this start window. This User's Guide uses this basic flow as a thread for further introduction. Please follow the flow from top to bottom.
There are two submenus under Tools menu. One is Save GUI Positions. It is used to save size & location of all PLSgui windows. Uncheck it if you do not want size & location of GUI windows to be saved. The other one is Save Display Setting for PET/MRI. This is used to save the panel parameters (like threshold etc.) in the result windows for PET, E.R.fMRI, Blocked fMRI and Structural MRI.
Caution: Please remember that all the PLSgui generated files (like session file, datamat file, result file, etc.) must be kept in the same directory. The reason that we made the program to behave this way is that we would like to move those PLSgui generated files across the platforms without having to store individual folders in those files.
Please follow the steps below to learn how to use the PLSgui program.
We need session / datamat file pairs to run PLS analysis. For PET, ERP and Structural MRI module, session file is only used for creating datamat file, and only datamat file is used for displaying results. However, for E.R.fMRI and Blocked fMRI module, session file and datamat file must exist in pair, and both will be used for displaying results.
In order to create session / datamat file, raw data (scan image, ERP data etc.) must be saved in following ways before launch plsgui:
PLSgui can take scan image that is either in ANALYZE format (Mayo Clinic) or in NIfTI format (National Institutes of Health) to create PET, E.R.fMRI, Blocked fMRI, and Structural MRI datamat. It can also take some of the binary data directly, such as NeuroScan average data, ANT's average data, EGI's simple-binary data, as well as delimited text files from any system to create ERP datamat.
All raw data must be properly pre-processed (registered to the same brain template, smoothed with some filters, etc.) prior to launch plsgui.
In the PLSgui start window, click PET button and the button will be highlighted. Then click Session Profile for PET data button below, the session window will open (Figure 2).
Figure 2
In the session window, Session Description is an optional field, which reminds you what this session is for.
Datamat Prefix is used to compose a file name for datamat file. For example, if you put demo in this field, the datamat file will become demo_PETdatamat.mat.
Click Input Conditions button, and add condition names one by one into the Edit Condition window. When you click DONE, Number of Conditions will show how many conditions you have selected.
As we mentioned above, all PET scans for each subject should be kept in one directory, and all subjects for one analysis should be under a single directory. If a PET file is in NIfTI image and contains multiple-scans, it must be expanded to multiple single-scan files with MATLAB program expand_nii_scan.m that is included in PLSgui.
Now, click Select Subjects button, and Edit Subject Directory window will open (Figure 3).
Figure 3
There is an edit box called Number of character for subject initial in the Edit Subject Directory window. Change the value from -1 to the length of subject initial if your subject files follow the following Consistent Naming Across Subjects rule:
Click Add button, and Subject Directory Detail window will open (Figure 4).
Figure 4
If your subject files follow the Consistent Naming Across Subjects rule, follow the steps below:
If your subject files do not follow the Consistent Naming Across Subjects rule, you can still follow the steps above. However, you will have to go to Edit Subject Directory window, click Edit button, and select correct subject files to match the inputted conditions for each single subject.
In PET session window, click Create Datamat button to open Create PET Datamat window.
There are two ways to define brain region:
If Normalize data with volume mean is checked, datamat value will be the stacked volume intensity divided by the average intensity for each volume; otherwise, datamat value will just be the stacked volume intensity. Please be aware that by default Normalize data with volume mean is checked for PET data.
Click Merge Conditions button to combine two or more conditions together to a new condition by averaging them.
Now, click Create button to generate PET datamat file.
In the PLSgui start window, click ERP button and the button will be highlighted. Then click Session Profile for ERP data button below, the session window will open (Figure 5).
Figure 5
In the session window, Session Description is an optional field, which reminds you what this session is for.
Datamat Prefix is used to compose file names for ERP datamat file and ERP data file. For example, if you put demo in this field, demo_ERPdatamat.mat will be ERP datamat file name and demo_ERPdata.mat will be ERP data file name.
Digitization Interval is the inverse of sampling rate. It is in millisecond (default is 2ms).
Prestim Baseline shows how early the time points start before stimulus is applied to a subject. It is also in millisecond (default is 0), and the value should be less than or equal to 0.
Click Input Conditions button, and add condition names one by one into the Edit Condition window. When you click DONE, Number of Conditions will show how many conditions you have selected.
As we mentioned at the beginning of Session / Datamat file pairs section, all ERP data for each subject should be kept in one directory, and all subjects for one analysis should be under a single directory. Now, click Select Subjects button to select and edit subjects in subject directory. The steps are the same as those in PET.
If ERP data is a delimited text file, each row usually stands for an electrode channel and each column usually stands for a time point. However, column can be used for channel if Channel in column check box is selected.
In order to match row (or column) of ERP data with electrode channel name, you need to click Edit Channel Order button. If your ERP data are binary files, an additional Select an EEG format window will popup, and you can select the proper vendor name and machine format. No matter your ERP data are binary files or plain text files, you will end up with an Edit Channel Order window (Figure 6).
Figure 6
What on the left panel of Edit Channel Order window is a complete channel name list based on the two system boxes below that panel. You can either manually select and add them to the right panel (you only need to do this once), or load from an existing channel list text file that you have saved before through File menu (much more conveniently). Click DONE when finish, and Number of Channels will show how many channels you selected.
In the lower left corner of the Edit Channel Order window, you can select different scalp electrode location systems and sub-systems. When you change the system or sub-system, you can notice that channel name list on the left panel of Edit Channel Order window changes.
What if you have a scalp electrode system can not be found in the system boxes (e.g. Standard 10-20 EEG System with 19 cap electrodes)? Please follow the steps below to add your own system:
chan_nam=[
'Fp1'
'Fp2'
'F7
'
'F3 '
'Fz '
'F4 '
'F8
'
'T7 '
'C3 '
'Cz '
'C4 '
'T8 '
'P7 '
'P3 '
'Pz '
'P4 '
'P8
'
'O1
'
'O2
' ]
chan_loc=[
-3 10
3 10
-8 6
-5 7
0 8
5 7
8 6
-10
0
-7 0
0 0
7 0
10 0
-8 -6
-5 -7
0 -8
5 -7
8 -6
-3 -10
3 -10
]
save erp_loc_besa148 chan_loc chan_nam
Now you have your own system in Edit Channel Order window if you are under ERP/BESAThetaPhi system, and you can also pick channels that is used in the ERP data. Here, obviously, the ERP/BESAThetaPhi is now representing your own system instead of the ERP/BESAThetaPhi system in PLSgui program. If you want to restore the original ERP/BESAThetaPhi system from PLSgui program, simply remove erp_loc_basa148.mat from your current directory.
ERP module is very different from the others. Since its data is very small, you can put all subjects with all conditions into one file, which we call it ERP data file. Then you can have several ERP datamat files point to one ERP data file, and each of those ERP datamat file is part (or all) of the ERP data. ERP data is generated at the same time when you create ERP datamat.
In ERP session window, click Create Datamat button and it opens Create Datamat window (Figure 7).
Figure 7
In this window, you can deselect Channels, Subjects and Conditions. The Select All button below let you easily reset to be all selected.
Edit Channel Order here can also let you modify the channel name, but we suggest that you had better to do it in the session window, since any change here will not be saved in the session file.
Click Merge Conditions button to combine two or more conditions together to a new condition by averaging them.
You can also specify time-points range for ERP datamat, which must be within Prestim Baseline and End of Epoch.
Now, click Create button to generate ERP datamat file and ERP data file.
In ERP session window, click Modify Datamat button, and select an ERP datamat file that you are going to modify. The Modify Datamat window opens with ERP Amplitude plot window. As you can see that ERP Modify Datamat window is very close to ERP Create Datamat window. There are only two differences, which are:
Click Modify button to save the modified datamat file, and ERP Amplitude plot will immediately reflect the new datamat file.
In the PLSgui start window, click E.R.fMRI button and the button will be highlighted. Then click Session Profile for E.R.fMRI data button below, the session window will open (Figure 8).
Figure 8
In this window, Session Description field is an optional, and it reminds you what this session is for.
Datamat Prefix is used to compose a file name for datamat file. For example, if you put demo in this field, the datamat file name will become demo_fMRIdatamat.mat.
Datamat can be merged across all runs or within each run only. If Across All Runs is selected (by default), data will be averaged together across all runs for the same condition names. If Within Each Runs is selected, the same condition name in different runs will be treated as different conditions. So the actual conditions will be automatically expand to something like Run1Cond1, Run1Cond2, Run2Cond1, etc.
Click Edit Conditions button, and add condition names one by one into the Edit Condition window. Besides Condition Name field, there are two more fields: Relative Ref. Scan Onset and Number of Reference Scans. They are only used if you select Normalize data with ref. scans check box in Generate ST Datamat window. Relative Ref. Scan Onset refers the offset of the first reference scan from the first scan of each onset. Negative value means that reference scan starts before the first scan of each onset. By default, it is 0. Number of Reference Scans means how many scans after the first reference scan will be averaged together to become a reference scan. By default, it is 1, which means that only 1 scan is used for reference scan. When you click DONE, Number of Conditions will show how many conditions you selected.
Number of Runs field must be entered first before click Edit Runs. It indicates how many runs of data you have, and each run of data must be kept in a separate directory.
Click Edit Runs button to open Run Information window (Figure 9):
Figure 9
Click >> button to go to next run, and repeat the steps above for all the runs.
In E.R.fMRI session window, click Create ST Datamat button to open Generate ST Datamat window (Figure 10).
Figure 10
There are two ways to define fMRI brain region, and they are the same as two ways to define PET brain region. Since any intensity of voxel that is less than the threshold of maximum intensity will be treated non-brain region, we require that the minimum of image intensity should be no less than 0.
Temporal window size refers to the length of hemodynamic period, and unit is TR or scan. e.g. If the length of hemodynamic period is 16 seconds and each TR is 2 seconds, then window size is 8 TRs.
If Normalize data with volume mean is checked, datamat value will be the stacked volume intensity divided by the average intensity for each volume; otherwise, datamat value will just be the stacked volume intensity. Please be aware that by default Normalize data with volume mean is not checked for both E.R.fMRI and Blocked fMRI data. Don't select this check box unless you have good reason to do so.
If Normalize data with ref. scans is checked, datamat will be normalized by the selected ref. scans. Please be aware that by default Normalize data with ref. scans is selected for both E.R.fMRI and Blocked fMRI data to prevent huge DC offset (low frequency noise).
Single subject analysis is only used to analyze single subject with very few onsets. If this check box is selected, each onset block will be stacked as a separate volume. So, datamat will only be averaged within each onset block, rather than within each condition. In this case, the number of onsets must be the same for all conditions, since we require that the number of subjects (or onsets in this case) must be the same for all conditions.
Single reference scan will use this reference scan for all the scans in the datamat, which will replace whatever Relative Ref. Scan Onset and Number of Reference Scans that you set in the Edit Condition window. It is also only used when you select the Normalize data with ref. scans check box. In Single reference scan onset edit box below, you should enter an absolute reference scan onset, instead of a relative reference scan onset.
Now, click Create button to generate E.R.fMRI datamat file.
In the PLSgui start window, click Blocked fMRI button and the button will be highlighted. Then click Session Profile for Blocked fMRI data button below, the session window will open (Figure 11).
Figure 11
This window is very similar to the regular E.R.fMRI session window, except that there is a check box called Use HRF instead of Blocked Length. If you check this box, your session file is for E.R.fMRI with user defined HRF; if you uncheck this box, your session file will become Blocked fMRI, which will be described below. Once you made the decision, this cannot be changed. If you really want to change, you will have to make a new session file.
Like regular E.R.fMRI session window, click Edit Runs button to open Run Information window (Figure 12):
Figure 12
This is also very similar to the regular E.R.fMRI Run Information window, except that there is one more field under Onsets, which is called Duration, and is used for epoch-related response. If your experiment is only for event-related response, just enter 0.
In above session window, click Create Datamat button to open Generate Datamat window (Figure 13).
Figure 13
The Brain Region section is exactly the same as the regular E.R.fMRI, but the Datamat section is completely different.
If Normalize data with volume mean is checked, datamat value will be the stacked volume intensity divided by the average intensity for each volume; otherwise, datamat value will just be the stacked volume intensity. Please be aware that by default Normalize data with volume mean is not checked for both E.R.fMRI and Blocked fMRI data. Don't select this check box unless you have good reason to do so.
If Use SPM ReML is checked, you are using the feature that is copied from SPM to remove the voxel outliers over the run. It is a temporal whitening function using restricted maximum likelihood estimation.
Degree of Legendre Polynomials for regressors is used to define the baseline regressor(s). By default, it is 0, which provides a single column of all ones.
You must enter the length of TR (in seconds) in order to define the HRF.
Then, you have two options to define the HRF: HRF1 & HRF1. For HRF1, TR will be further divided when calculating design matrix. By default, it will use HRF model from SPM, since most codes are copied from SPM. For HRF2, TR is always the smallest unit when calculating design matrix. By default, it will use GAMMA HRF from AFNI. In both case, you can click Customize HRF to modify the model, and click Save HRF to save the model.
When you click Plot Regressors, the entire hemodynamic response across the run will be displayed. This is actually the convolution result between HRF and event (or epoch), which is sometimes also called design matrix.
Now, click Create button to generate E.R.fMRI datamat file with user defined HRF.
Creating Blocked fMRI session file is almost the same as Creating E.R.fMRI session file with user defined HRF. However, don’t check Use HRF instead of Blocked Length check box, which is for E.R.fMRI with user defined HRF.
Creating Blocked fMRI datamat file is the same as creating E.R.fMRI datamat file, except that you do not need to fill Temporal window size field for Blocked fMRI datamat.
In the PLSgui start window, click Structural button and the button will be highlighted. Then click Session Profile for Structural data button below, the session window will open (Figure 14).
Figure 14
In the session window, Session Description is an optional field, which reminds you what this session is for.
Datamat Prefix is used to compose file names for Structural datamat file and Structural data file. For example, if you put demo in this field, demo_STRUCTdatamat.mat will be Structural datamat file name and demo_STRUCTdata.mat will be Structural data file name.
Dataset Directory is where all subjects with all conditions are kept.
Click Input Conditions button, and add condition names one by one into the Edit Condition window (Figure 15). Besides Condition Name field, there is one more field: Condition Filter. You must enter wildcard (e.g. *wm.nii) to distinguish files with different conditions. When you click DONE, Number of Conditions will show how many conditions you have selected.
Figure 15
Click Select Subjects button, and Edit Subject Directory window will open (Figure 3). Now, click Add button, and Subject Directory Detail window will open (Figure 16). You can select one or more subjects for this datamat group. By default, the program will use the filename without condition filter part as the subject name. If you feel that the subject name is too long, you can change the subject name in the Edit Subject Directory window.
Figure 16
Like ERP module, you can put all subjects with all conditions into one file, which we call it Structural data file. Then you can have several Structural datamat files point to one Structural data file, and each of those Structural datamat file is part (or all) of this Structural data. Structural data is generated at the same time when you create Structural datamat.
In Structural session window, click Create Datamat button and it opens Create Datamat window (Figure 17).
Figure 17
In this window, you can deselect the subjects. The Select All Subjects button below let you easily reset it to be all selected.
In Brain Mask File field, you must provide a pre-defined brain region image file.
Now, click Create button to generate Structural datamat file and Structural data file.
In Structural session window, click Modify Datamat button, and select a Structural datamat file that you are going to modify. The Modify Datamat window opens. As you can see that Modify Structural Datamat window is very close to Create Structural Datamat window. There are only three differences, which are:
Click Modify button to save the modified datamat file.
The purpose of performing PLS analysis on neuroimaging data is to obtain result data that can better interpret the brain activities and other brain statistical information, which can include singular values, singular vectors, etc. The internal procedures of an analysis includes:
In the PLSgui start window, select a module and then click Run PLS Analysis button below, the analysis window will open (Figure 18).
Figure 18
The PLS analysis window is almost identical across all modules. However, there are still some slight differences. e.g. For PET, ERP and Structural module, each group only contains one file, and it is datamat file. For E.R.fMRI and Blocked fMRI module, each group can contain more than one file, and they are session files. Each session file should correspond a datamat file.
In the analysis window, group files must be added first. For PET, ERP and Structural module, click Add button to select a datamat file for each group. For E.R.fMRI and Blocked fMRI module, click Add button will open a Select Session Profiles window (Figure 19) for a group.
Figure 19
Highlight E.R.fMRI and Blocked fMRI session files for this group, and click >> button to add them into the right panel. You can save this selection by clicking Save to a text file under File menu of Select Session Profiles window. Next time, you do not need to select session files again. You can click Load from a text file under File menu of this window, and those selections you selected will be loaded in the window.
The Group Total in PLS analysis window will display how many groups you selected. The Save Datamats check box is only selected if you want to save the stacked datamat. We advise regular users not to select this check box, since it will make result file huge. After all group files are added, you also have an option to remove some conditions by clicking Deselect conditions under Deselect menu. You do not have to do this unless it is necessary.
Now you have to select one of the PLS options:
If you choose Mean-Centering Task PLS option, the grand mean across tasks is calculated, and all individual data points are subtracted from this value. The newly generated matrix is subjected to singular value decomposition (SVD) to obtain singular values, singular vectors, etc.
If you choose Non-Rotated Task PLS option, priori contrasts are used to restrict the patterns derived from PLS. So you also need to provide a contrast file (in plain text) in order to run this analysis. Click Load button beside Contrast Data File field to select a contrast file. Contrast file can be generated from the Contrast window (Figure 20) by clicking Contrast menu in the analysis window.
Figure 20
In the contrast window, field Contrast 1 stands for 1st contrast, and field Contrast 2 stands for 2nd contrast, etc. The 1st value in each contrast field is for the 1st selected condition, and the 2nd one is for the 2nd selected condition, etc. Click Add button beside contrast field to input the contrast value, and lick Plot button to display bar graph of this contrast. If you have more than 1 group, you also have to fill all contrast fields for all groups. Highlight different group name in Groups panel to switch groups. Finally, Don't forget to save contrasts to a text file for PLS to load.
For Regular Behav PLS, Non-Rotated Behav PLS or Multiblock PLS, you must have at least 3 subjects in order to generate proper correlation matrix and run PLS properly.
If you choose Regular Behav PLS option, behavior measures that correspond to each scan image or ERP data are used to compute the correlation matrix between the measures and the datamat. So you also need to provide a behavior file (in plain text) in order to run this analysis. Each column in the behavior file stands for one measure, and is separated by a space. The rows should be arranged in the order of “subjects in selected conditions in groups”.
For example, let's say you have group1 and group2 with condition1, and condition2. In group1, you have 2 subjects, and in group2 you have 3 subjects. Here is the order of the behavior file:
group1 condition1 subject1
group1 condition1 subject2
group1 condition2 subject1
group1 condition2 subject2
group2 condition1 subject1
group2 condition1 subject2
group2 condition1 subject3
group2 condition2 subject1
group2 condition2 subject2
group2 condition2 subject3
To input behavior data for PLSgui, click Load behavior data button, and the Edit Behavior Data window will open (Figure 21).
Figure 21
In this window, click Load button and select a behavior file we discussed above. You should see all the data in behavior file has been loaded into the Behavior Data text editor. You can then change Behavior name to some meaningful string like RT ACC etc. Click OK button when finish. If you deselect any condition after loading behavior data, you have to click Load behavior data button again. This is because the behavior data should correspond to the selected conditions only.
If you choose Non-Rotated Behav PLS option, priori contrasts are used to restrict the patterns derived from PLS, as well as behavior measures that correspond to each scan image or ERP data that are used to compute the correlation matrix between the measures and the datamat. So you need to provide both contrast file and behavior file (both are in plain text) in order to run this analysis. If you have more than one behavior measure (i.e. behavior file has more than one column), you will also need to provide contrast for all the behavior measures.
For example, let's say you have group1 and group2 with condition1, and condition2, and you have two behavior measures in behavior file. Here is the order of the contrast file:
group1 condition1 measure1
group1 condition1 measure2
group1 condition2 measure1
group1 condition2 measure2
group2 condition1 measure1
group2 condition1 measure2
group2 condition2 measure1
group2 condition2 measure2
If you choose Multiblock PLS option, the program will apply both Mean-Centering Task PLS and Regular Behav PLS to the same datamat. So, a behavior file is required, and is input the same way as Regular Behav PLS does. You can also choose to select only part of conditions for behavior block of Multiblock PLS. To do this, you need to click Deselect behaviorblock conditions for Multiblock PLS under Deselect menu. You do not have to do this unless it is necessary.
You also have opportunities to input number of permutation to test the significance of the singular vectors and input number of bootstrap to test the reliability of the activity area. However, make sure you have enough subjects. Otherwise, it does not make sense to reorder data. This is especially important in bootstrap test, because we reorder bootstrap data with replacement and it contains repeated subjects after reordering. If you choose bootstrap test, the bootstrap result will also contain the upper and lower percentile of correlations. It is determined by the value in Confidence Level field, which is 95 percent by default.
Click Run button to run PLS analysis, and you will need to input a result file name first. If you would like to include bootstrap test, a dialog box of Percentage of minimum different subject number will be prompted with a default value of 50 percent. This is because bootstrap test may contain repeated subjects after data is reordered, and we need to limit the repeat by setting a minimum different subject number. You can slightly adjust this value to include more or less repeated subjects after data is reordered.
Instead of click Run button, you can also click Save to Batch button to save the PLS analysis setting into a batch script file. Then, you can either run PLS analysis by firing the batch with batch_plsgui command, or simply use it to save your PLS analysis setting and click Load from Batch button in the future to bring up the setting.
This User's Guide only describes how to display a PLS result file. If you would like to know how to interpret your result in detail, please read relevant papers.
In the PLSgui start window, click PET button and the button will be highlighted. Then click Show PLS Result for PET data button below, you will be asked to select a result file. Once you have selected the result file, the PET Result window will open (Figure 22). All slices are displayed, and slice indices are equal to X value plus Y value. This kind of labeling is very helpful in zooming.
Figure 22
If the result file contains a bootstrap result, the result window will display a view of Bootstrap Ratio first, and you can switch to a view of Brain LV by clicking View menu. Otherwise, the result window will display a view of Brain LV, and there will be no View menu.
Image Rotation menu provided limited amount of rotations for display only. If you want to change image orientation, you should do so in the Create PET Datamat window.
If the crosshair bothers you, you can turn it off or change its color under Crosshair menu. You can click Zoom on to get a closer look at the region of interest.
Here we use two different thresholds (Pos / Neg Thresh) just in case the distribution of data is extremely biased. Therefore, it is still suggested to use symmetric threshold, and it is not recommended to modify the threshold arbitrarily, unless you know what you are doing.
Most information in result data is rendered in Windows menu.
Singular values are usually checked first (Figure 23).
Figure 23
Click Singular Values Plot under Windows menu, and the Singular Value Plot window will open (blue bar). If the value is very low for certain LVs, you may want to discard those LVs. If permutation test is included, you can also check whether the LVs are trustable by plotting the permuted singular value. Click Permuted Singular Values under View menu of Singular Value Plot window, Permuted Singular Plot window will open (red bar). It is the probability of those permuted singular values that are greater than the observed singular values. If the chance of permuted singular values that are greater than the observed singular values are very high for certain LVs, you may also want to discard those LVs.
To view voxel values in the created datamat, click Voxel Intensity Response under Windows menu, and the response window will open behind the result window. If you click anywhere of the brain in result window, voxel value in the location that is specified by XYZ will be plotted (Figure 24).
Figure 24
Different subjects can be distinguished by legend mark. Subject average for each condition is provided in bar graph. If you have more than one datamat, select the datamat that you would like to watch from the Datamat selection box.
You can use average intensity of the neighborhood voxels for intensity of the clicked voxel by specifying Neighborhood Size field (An edit box in Voxel Intensity Plot window). By default, it is 0, which means no neighborhood voxel is included. Otherwise, neighborhood size represents the distance (number of voxels) from the clicked voxel. In this case, the average intensity will include those voxels:
Do not set neighborhood size unnecessary large, because the maximum number of neighborhood voxels is equal to the cubic of (SIZE * 2 + 1). e.g. Neighborhood Size 1 could have a neighborhood of 27, and Neighborhood Size 3 could have a neighborhood of 343, etc.
To extract voxel values from created datamats to a text file, you should prepare a voxel location text file in advance. This file contains XYZmm positions. It must be voxel location with unit in millimeter, instead of absolute voxel location XYZ. One row stands for each voxel, XYZmm are separated by spaces, like:
32.0 24.0 -20.0
-36.0 -48.0 -4.0
Click Multiple Voxels Extraction under Windows menu, and select the above voxel location file. Input only a prefix of the extracted file name, and you will be prompted to select a voxel neighborhood size to use average intensity of the neighborhood voxels for intensity of the selected voxels in your location file. It works the same way as the neighborhood voxels we discussed above. Click OK button, it will generate two kinds of files:
Columns of the extracted files stand for voxels in the order listed in the voxel location file. For E.R.fMRI, each voxel will take multiple columns which stand for multiple lags (the size of temporal window).
For Mean-Centering PLS, Non-Rotated Task PLS, or Multiblock PLS, you have the option to click Design LV and Design Scores Plot under Windows menu, and the plot window will open (Figure 25).
Figure 25
This window has three views: Brain Scores vs. Design Scores, Design Scores and Design LVs. Click View menu in this window to switch between views. If you have more than one group, highlight the group that you would like to watch in the upper left panel. If the result has more than one LV, highlight the LV that you would like to watch in the lower left panel. Usually the first thing you may want to check is the outlier subject(s) in the Brain Scores vs. Design Scores view. If there are any outlier subjects, you may want to reconsider whether you want to keep them or remove them. If you decide to remove them, you will have to run analysis again without those subjects. The task patterns in Design Scores (or Design LVs) correspond to each task in BrainLV active map for each LV.
For Mean-Centering PLS and Non-Rotated Task PLS, you also have the option to click Task PLS Brain Scores with CI under Windows menu, and the plot window will open (Figure 26).
Figure 26
For Behavior PLS or Multiblock PLS, the following submenu will also be available under Windows menu: Brain Scores vs. Behavior Data Plot, Datamat Correlations Response, and Datamat Correlations Plot.
Click Brain Scores vs. Behavior Data Plot submenu will start with the Brain Scores Plot window (Figure 27).
Figure 27
It displays brain scores vs. behavior data for each condition and each LV. If you have more than one group, select the group that you would like to watch in the upper left selection box. If the result has more than one LV, select the LV radio button that you would like to watch in the left panel. The title of each plot shows which LV is currently selected, and the variable r stands for correlation coefficient between behavior data and datamat.
You can click Show Brain Scores Overview under Plot menu to view all plots of different conditions and behavior measures (Figure 28).
Figure 28
For Regular Behav PLS, the Behavior LV bars should be in proportion with Correlation bars.
Click Show Correlation Plot under Plot menu will display a correlation bar. It reflects the correlations between behavior data and brain scores for each condition and each LV. If bootstrap test is included, correlation bar will come with an error bar specified by upper and lower error range for the correlation. You can also select different groups and LVs in the same way above. Click Show Correlation Overview under Plot menu to view a correlation bar that includes all groups and conditions (Figure 29).
Figure 29
Click Show Behavior LV Overview under Plot menu to view Behavior LV bar for all groups and conditions (Figure 30).
Figure 30
The Datamat correlations are correlation between behavior data and datamats. Click Datamat Correlations Response under Windows menu, and the response window will open behind the result window. If you click anywhere of the brain in result window, correlation value at XYZ will be plotted in bar graph (Figure 31).
Figure 31
Like datamat correlations in the above response window, Datamat Correlations Plot window also reflects the correlations between behavior data and datamats. However, Datamat Correlations Plot gives you a whole view of the correlation values in the entire brain for each condition and each behavior measure (Figure 32).
Figure 32
Instead of selecting the group from a selection box, you enter the group ID, which is ordered sequentially, into the Group Index field. Parameters in the Datamat Correlations frame below that are merely for display purposes. Only those voxels with values that are above the Threshold (and BS Threshold if bootstrap test is included) will be displayed. Voxel's datamat correlation value corresponds to its color that can be referred from the marks on the color bar.
Besides the Axial View that the result window renders by default, you can also select Sagittal View, Coronal View, and 3 Cardinal Plane View under Windows menu.
We define it as a cluster if there are at lease N voxels connected together (5 voxels by default), and we call the one with the highest value as peak voxel. If the distance between the peak voxels of any two clusters is too close (10 mm by default), they will be treated as one cluster. Report menu provides you with capabilities of creating and loading a cluster report. You can also click Set Cluster Report Options under Report menu to change the default setting. Don't change Origin location field unless you have a good reason.
The accuracy of cluster report also depends on the recursion limitation of the MATLAB on your computer. Because of this recursion limit, you may encounter active voxels in the same cluster are separated into two or more clusters, some active cluster are not listed, the result of cluster report are different from one computer (or MATLAB version) to the other. Please refer to the FAQ.txt for more details.
Click Create Cluster Report under Report menu will generate cluster report for the current view (either Brain LV or Bootstrap). The report will display Voxel Mean, XYZ (absolute location), XYZ in mm (MNI location), Brain LV Value or Bootstrap Value, and Cluster Size in voxels for the peak voxels of all clusters that are listed sequentially. It will also display the Source result file name, Current LV index, Current Threshold, Minimum Cluster Size, and Minimum Cluster Distance at the bottom (Figure 33).
Figure 33
There are two Save submenus and two Export submenus under File menu of Cluster Report window.
Select Cluster Mask under Report menu to display only the clustered voxels. However, you must create or load cluster report first. Then you can either close the cluster report window or leave it on.
If you would like to view a brain template underlying the result plot, you can click Load Background Image under File menu and select the brain template image as background image. The background image must have the same dimension as the images that are used in datamats. Usually, brain template image could be an image that is used to register the brain for all images in the datamats.
Save brain region to IMG file takes the coordinates of the common brain region from the result file, and saves it to a brain region image file.
Save Current Display to IMG files saves the result image that is currently displayed to image files, and it also saves the colormap of current figure to a MATLAB file that is ended with "_cmap.mat".
Save the BLV (or BSR) result to IMG files saves the result values (either Brain LV or Bootstrap Ratio) that are currently displayed to image files.
The way to display a Structural MRI result file is the same as the way to display a PET result file.
The way to display a Blocked fMRI result file is the same as the way to display a PET result file.
The way to display an E.R.fMRI result file is a little bit different from the way to display a PET or a Blocked fMRI result file. Here are the differences:
E.R.fMRI displays all lags of temporal window in its result window (Figure 34).
Figure 34
Lag stands for which scan in the temporal window. It is started from 0. Lag is displayed on Y-axis, and each row displays all the slices that are selected. This is very different from Blocked fMRI or PET display, which do not have lag information, and all slices are displayed in the display area row by row (like montage).
Slices are selected from the left panel. When you specify a First Slice index, a Step, and a Last Slice index. It will display the first slice, and slices for every step. If any slices go beyond the last slice, they will not be displayed. When you select a voxel from LagXYZ field instead of clicking on the brain, please make sure that the slice index you entered is currently displayed. Otherwise, it will prompt warning that Invalid number in X, Y, or Z.
Here we use two different thresholds (Pos / Neg Thresh) just in case the distribution of data is extremely biased. Therefore, it is still suggested to use symmetric threshold, and it is not recommended to modify the threshold arbitrarily, unless you know what you are doing.
Response function plot window in E.R.fMRI plots the intensity change of a clicked voxel for the entire temporal window. Its counterpart in Blocked fMRI and PET is Voxel Intensity Response window, which does not have temporal window time series information.
In Response function plot window (Figure 35), all subjects for each condition take a row, with an average plotted at the end. Intensity value is displayed on Y-axis, and Lag number is displayed on X-axis. If bootstrap test is included, special symbols (small circle and diamond) will also be marked at top and bottom of each plot to represent the stable time points for the 1st & 2nd LVs. Click Stable off menu to hide those stable symbols.
Figure 35
There is an Export Data under Data menu of the response window. The row order of st_data variable in the exported data is determined by st_evt_list variable. However, we suggest people to use Multiple Voxels Extraction under Windows menu. This way, you can get all voxels' data at once. In addition, you do not have to worry about the order of rows, which is always in the order of “subjects in conditions in groups”.
You can change the display appearance by selecting submenus under Option menu. For example, to Hide / Show Average Plot; to Combine / Separate plots within conditions; to Enable / Disable Data Normalization; etc.
For Mean-Centering PLS, Non-Rotated Task PLS, or Multiblock PLS, there is a new submenu under Windows menu for E.R.fMRI result. It is called Temporal Brain Scores Plot, and displays the brain scores for the entire temporal window. The appearance and usage of Temporal Brain Scores Plot window is very similar to Response Function Plot window. However, it opens in front of the result window. You need to click Plot button to display, and click LV radio button to select which LV you would like to watch.
For Behavior PLS or Multiblock PLS, there is also a new submenu under Windows menu for E.R.fMRI result. It is called Temporal Brain Correlation Plot, and displays the correlations between behavior data and brain scores for the entire temporal window. Since brain scores in result file do not contain time series information, we have to generate it from a subset of Datamats and Brain LV on fly for each lag of temporal window. The appearance and usage of Temporal Brain Correlation Plot window is very similar to the Temporal Brain Scores Plot window, and both windows open in front of the result window.
Datamat Correlations Response window in E.R.fMRI plots the correlations between behavior data and datamats of a clicked voxel for the entire temporal window. Its counterpart in Blocked fMRI and PET does not have time series information. The appearance and usage of Datamat Correlations Response window is very similar to the Temporal Brain Correlation Plot window. However, it opens behind the result window. If you click anywhere of the brain in result window, correlation value for the entire temporal window at XYZ will be plotted.
The way to display an ERP result file is much different from the way to display a Blocked fMRI, E.R.fMRI, or a PET result file.
In the PLSgui start window, click ERP button and the button will be highlighted. Then click Show PLS Result for ERP data button below, you will be asked to select a result file. Once you have selected the result file, the Electrode Salience waveform window will open (Figure 36). It plots the salience on each electrode, and uses menu to control the display. If you click on any waveform, an pink information box that contains channel name and wave name will be popped up.
Figure 36
Under Tool menu, there is a Display Options submenu. If bootstrap test is included, there is also a Bootstrap Options submenu.
In Display Options window, you can select which waveform(s) to be displayed. If you click Select All Waves button, all waves will be displayed. However, the more waves you selected, the longer it will take to display. You can also change axis intervals and font size by selecting the proper values beside them. If electrodes are distributed too sparse (or too crowded), you can also adjust the Wave Size scroll bar to change the wave size for every electrode.
Bootstrap stability is displayed in small circles or diamond. A circle will be marked at the time point that the bootstrap value exceeds the threshold. Bootstrap from different LV will take different horizontal lines. In Bootstrap Options window, there are 2 panels. The left panel displays the LV to be edited. You can only select 1 LV at a time to edit it. The parameters below that panel (Threshold etc.) can be edited and are all for the LV that you selected in the left panel. Click Reset to default value will reset those parameters to their default values. The right panel displays the LV to be displayed in Electrode Salience window. You can select one or more LVs to be displayed at the same time.
Click Legend On under Legend menu to display color legend for the wave and bootstrap displayed in the waveform window. Click Legend Off will remove the color legend. Because the limitation of MATLAB, it will be very slow if this is your first click of Legend On. Especially when there are a lot of waveforms displayed. After you click Legend Off, the subsequent clicks of Legend On will be quick.
Click Zoom on to have a closer look at a few electrodes. Click Zoom off to cancel the zooming status. Actually, we have another way to do it using Plot Detail under the View menu.
There are 3 submenus under Edit menu. They are: Select Electrodes with Rubberband, Select All Electrodes, and De-Select All Electrodes. As is known by the submenu names, they are used to select or deselect electrodes. The other way to select an electrode is to click the electrode name directly and make it bold. After an electrode is selected, its detail can be plotted using Plot Detail under View menu.
The reason that we call this menu Edit is because we can visually screen out some bad subjects and/or electrodes in ERP Amplitude window immediately after creating ERP datamate. In ERP Amplitude window, you can select a bad subject by clicking on the bad subject waveform, and select bad electrodes by clicking their names and making them bold. Then click Modify Datamat under Edit menu, the Modify Datamat window opens, and the selected subject and all selected electrodes are preliminary un-highlighted. Once you click Modify button in Modify Datamat window, the bad subject and electrodes will be removed from the datamat file.
This is the main menu to get information from the result data. There are several submenus under View menu, they are: Subject Amplitude, Average Amplitude, Spatiotemporal Correlation (only for Behavior PLS and Multiblock PLS), Plot Detail, Plot Singular Values, Plot Design Scores (not for Behavior PLS), Plot Temporal Scores (not for Behavior PLS), Plot Scalp Scores (only for Behavior PLS and Multiblock PLS), Plot Temporal Correlation (only for Behavior PLS and Multiblock PLS).
Click Subject Amplitude under View menu will open Group Subject Amplitude waveform window. It plots the ERP amplitude of all subjects in all conditions and all groups that are used by this result.
Like Electrode Salience window, you can open Display Options window under Tool menu to select which waveform(s) to plot. However, this Display Options window is different from that from Electrode Salience window. In this Display Options window, you can easily select all subjects in a certain condition or all conditions in a certain subject by selecting the proper pull down menu.
Average Amplitude
Click Average Amplitude under View menu will open Grand Average Amplitude waveform window. It plots the average ERP amplitude of all subjects in a particular condition and a particular group.
It also has its own Display Options window under Tool menu to select which one to plot. If bootstrap test is included, you can also open Bootstrap Options window, and the Bootstrap Options window is exactly like what you see in the Electrode Salience window.
Under Tool menu of Grand Average Amplitude window, there are 2 more submenus: Display Condition Average and Display Condition Difference.
Display Condition Average allows you to display the average of the existing average waves. You can select several conditions from the left panel, give a name for the newly averaged condition, and click ->> button to make the averaged condition. The default averaged condition name will be the one with plus signs inserted among selected conditions.
For Display Condition Difference, it allows you to display the waveform of one condition subtracted by the other. Once you open the Condition Difference window, click Add button first. Then, select two conditions from the pull down menu.
Spatiotemporal Correlation
If it is a result of Behavior or Multiblock PLS, you can click Spatiotemporal Correlation under View menu to display the correlation waveform between behavior data and datamats. The usage is very similar to the Subject Amplitude waveform window, and its counterpart in other modules is called Datamat Correlation Plot.
It also has its own Display Options window under Tool menu to select which one to plot. If bootstrap test is included, you can also open Bootstrap Options window, and the Bootstrap Options window is exactly like what you see in the Electrode Salience window.
Plot Detail
If you only want to plot some of those electrodes, you can open Plot Detail window once you have selected one or more electrodes. You know the electrodes are selected if their names become bold. Click on the names can toggle the electrode select or deselect. You can also select or deselect electrodes using the tools provided under Edit menu.
In Plot Detail window (Figure 37), it only displays the waveforms of the selected electrodes, with detail grid and units. If you click on any waveform, an pink information box that contains wave name, channel name, X & Y locations will be popped up at upper right corner.
Figure 37
Subject Amplitude for Given
Timepoints
It looks like Plot Detail window (Figure 37) with two more menus: Response Plot and Multiple Extraction, and you can plot the response of datamat value and extract multiple time points from this window.
To plot the response, click Response Plot menu in this window, and the Response Plot window will pop up and then stay behind the current window. The Response Plot window looks exactly the same as the Voxel Intensity Response window in PET (Figure 24).
To extract multiple time points, you need to prepare a time points file in advance. The time points file contains a single column of data, and each row represents a time point in milliseconds. When you click the Multiple Extraction menu, you will be prompted for this file. The behavior is the same as its counterparts in all other modules.
Other Submenus
The rest of submenus under View menu are very similar to the ones under Windows menu in E.R.fMRI module. For example, Plot Singular Values is equivalent to Singular Values Plot; Plot Design Scores is equivalent to Design LV and Design Scores Plot; Task PLS Scalp Scores with CI is equivalent to Task PLS Brain Scores with CI; Plot Temporal Scores is equivalent to Temporal Brain Scores Plot; Plot Scalp Scores is equivalent to Brain Scores vs. Behavior Data Plot; Plot Temporal Correlation is equivalent to Temporal Brain Correlation Plot.
We can use correlation between datamat value from a detected voxel and entire brain datamat to run Regular Behav PLS analysis, and call it Seed Voxel PLS analysis.
(This one includes all subjects in all groups)
(Each of these files will correspond to each session/datamat pair.)
Instead of using mouse click, messages can also be loaded from a batch script file and sent automatically to PLSgui program in batch with batch_plsgui command. The first advantage of the batch process is that it dramatically reduces the Human-Computer Interactions. So, you can fire batches at the end of a day, and the computer will create all datamats one by one and run all analysis for you. When you come back next day, the PLS result file(s) is ready for you to display. The second advantage is that it is very easy to modify the batch script file to re-run the analysis with or without re-create the datamat. The third advantage is that the session files, datamat files, and result files that are generated by batch_plsgui are fully compatible with those that are generated by PLSgui, since batch_plsgui command is part of PLSgui program and is actually running PLSgui in batch. The disadvantage is that batch script files must be checked carefully, especially when firing batches to run overnight.
There is a completely different program called PLScmd, which is basically a command-line version of PLS. PLScmd program is totally separate from PLSgui, and they are not compatible each other. PLScmd will be introduced in Appendix B.
In order to create datamats or run analyses in batch, you will first need to prepare corresponding batch script files. Batch script files are simply text files, and we will discuss them in detail in the following sections.
Coming with PLSgui program, you will find several demo batch scripts:
batch_demo_fmri_data1.txt %
batch file to create E.R.fMRI datamat
batch_demo_fmri_data2.txt % batch file to create E.R.fMRI datamat
batch_demo_fmri_data3.txt %
batch file to create E.R.fMRI datamat
batch_demo_fmri_analysis.txt % batch file to run E.R.fMRI PLS analysis
batch_demo_bfm_data1.txt %
batch file to create Blocked fMRI datamat
batch_demo_bfm_data2.txt %
batch file to create Blocked fMRI datamat
batch_demo_bfm_data3.txt %
batch file to create Blocked fMRI datamat
batch_demo_bfm_analysis.txt % batch file to run Blocked fMRI PLS
analysis
batch_demo_erp_data1.txt % batch
file to create ERP datamat
batch_demo_erp_data2.txt %
batch file to create ERP datamat
batch_demo_erp_analysis.txt % batch file to run ERP PLS analysis
batch_demo_pet_data1.txt %
batch file to create PET datamat
batch_demo_pet_data2.txt %
batch file to create PET datamat
batch_demo_pet_analysis.txt % batch file to run PET PLS analysis
Once you follow the instructions discussed in the following sections and create your own batch scripts, you can run batch script files using batch_plsgui command.
batch_plsgui batch_demo_erp_data1.txt batch_demo_erp_analysis.txt
batch_plsgui batch_demo_fmri_data1.txt
batch_plsgui batch_demo_fmri_data2.txt
batch_plsgui batch_demo_fmri_data3.txt
batch_plsgui batch_demo_fmri_analysis.txt
The easiest way to get started is to copy a demo batch script file that come with PLSgui program, and then modify it according to your situation:
Instead of filling the fields in the Session Information or Create Datamat window manually, we can put them as the values of keywords in a batch file (see batch_demo_fmri_data1.txt):
Instead of filling the fields in the Run PLS Analysis window manually, we can put them in a batch file (see batch_ demo_fmri_analysis.txt):
It is very similar to Batch file to create E.R.fMRI datamat. Here are some differences:
It is very similar to Batch file to run E.R.fMRI analysis. The only difference would be that all the file names containing fMRI are now replaced by BfMRI.
ERP datamat is very different from that of E.R.fMRI or Blocked fMRI, since a lot of EEG/ERP parameters have to be added in:
[chan_order, system] = erp_select_chan
It is very similar to Batch file to run E.R.fMRI or Blocked fMRI analysis. Here are the differences:
It is very similar to Batch file to create ERP datamat. Since PET does not use any of EEG/ERP parameters, those keywords can all be removed except prefix, cond_name, and subj_file. However, brain_region keyword needs to be added in, and its value can be either a threshold number or a file name with path information that indicates the brain region binary file.
It is very similar to Batch file to run ERP analysis. The only difference would be that all the file names containing ERP are now replaced by PET.
It is very similar to Batch file to create PET datamat. Here are the differences:
It is very similar to Batch file to run ERP analysis. The only difference would be that all the file names containing ERP are now replaced by STRUCT.
The subjects' data below is only for the purpose of illustration the usage of PLS program:
http://www.rotman-baycrest.on.ca/pls/source/Testdata.zip
After unzip the above data, go to the testdata folder and launch MATLAB from there. Add path to access the PLSgui program, and follow the instructions below for the experiments.
In this experiment, datamat has been created and result file has been generated. By loading the session file and result file, we can see the information that have been entered into the session file, and some meaning from the result file. Since you do not have subjects' raw data (image file) for this experiment, you cannot modify anything.
There are 12 subjects with 8 conditions in this experiment. Click Session Profile for PET data under PLS start window, and load “pet_PETsession.mat” file. Click Input Conditions button to see what are the 8 conditions, and click Select Subjects button to see what are the 12 subjects. Close the Session Information window, click Show PLS Result for PET data button, and open the “pet_PETresult.mat” file. The displayed plot is Bootstrap Ratio Plot. Click View Brain LV under View menu to switch to Brain LV Plot.
Click Design LV and Design Scores Plot under Windows menu to open PLS Scores Plot window. As you can see that all sent conditions (sent enc, sent r1, sent r2, and sent r3) are positive, and all the pict conditions are negative for LV1. This means that the red activation areas in Brain LV Plot correspond to sent conditions, while the blue activation areas correspond to pict conditions.
In this experiment, you only have one subject's data. You can follow the steps below to see how to create session file, generate datamat file, and run PLS analysis to get the result file.
This subject performed 2 tasks with 1 baseline condition (Task1, Task2, and Baseline). There are totally 5 runs that are located in 5 sub-folders (from dataset_001 to dataset_005). Each run lasts 6 minutes with TR of 2 seconds. So this gives us 180 time points (in TR) starting from 0, and each time point is represented by a scan image.
The onsets time points (in TR) of Task1 appeared at: 0 24 48 72 96 120 144 168
The onsets time points (in TR) of Task2 appeared at: 12 36 60 84 108 132 156
The onsets time points (in TR) of Baseline appeared at: 6 30 54 78 102 126 150
In this experiment, all images have been properly spatially and temporally realigned, normalized, and smoothed. In addition, only 5 slices from the entire brain were used. The first step of the experiment is to create a session file:
You can now generate a datamat file that corresponds to this session file:
You can now run PLS analysis using the above session file and datamat file. Usually, you should have more than 1 subject for PLS analysis, and each subject will have 1 session file and 1 datamat file. This is especially required for permutation or bootstrap test. Here we only have 1 subject for illustration purpose, so the following step will run Mean-Centering PLS without permutation or bootstrap test:
As is mentioned earlier, the command-line PLS (PLScmd) is a separate program that is not compatible with PLSgui. The command to run PLS analysis is pls_analysis. Compared with PLSgui, pls_analysis is easier to understand, because there is no fancy data stacking or result rendering issues. In order to run pls_analysis, the following input variables must be assigned properly for its pls_analysis command:
Once the input variables are prepared, you can run PLS analysis with the following command:
result
= pls_analysis(datamat_lst, num_subj_lst, num_cond)
The output result is a structure variable that contains all the necessary items that are generated based on different PLS options that will be asked when running pls_analysis command. It could have items like:
o num_LowVariability_behav_boots: display numbers of low variability re-sampled behavior data in bootstrap test, only available in behavior PLS
o countnewtotal: count the new sample that is re-ordered for badbeh, only available in behavior PLS
Since the result generated by pls_analysis is not compatible with PLSgui and can not be displayed on PLSgui, it can only be interpreted by the advanced users. However, you may find the following simple guidelines helpful:
figure; bar(result.s); % display singular value bar graph
pct=(result.s.^2/sum(result.s.^2)); % calculate eigenvalue percentage
figure;
bar(pct); % notice
that sum(pct) should be 1
figure;
bar(result.perm_result.sprob);
LV =
1; % just an
example. can be 2,3, ...
figure; plot(result.vsc(:,LV),result.usc(:,LV),'*');
LV =
1; % just an
example. can be 2,3, ...
figure; bar(result.v(:,1));
thresh
= percentile(result.boot_result.compare_u(:,1), 95)
idx = find(abs(result.boot_result.compare_u(:,1)) > thresh);
Since command-line PLS requires you to provide a datamat cell array, it doesn’t have to be image data or EEG/MEG data that is required by PLSgui. The following appendix is a tool in PLScmd that allows people to plot the result of command-line PLS using Region of Interest (ROI) data.
When you assign data to datamat_lst variable, it can be ROI values. The plotroi tool in PLScmd plots bootstrap results of ROI analyses on a template image. The color of each region reflects the corresponding bootstrap ratio (salience/salience standard error). Thresholds as well as minimum and maximum bootstrap ratios are shown on the accompanying color bar.
Before plotting any results, you need to make a flood-filled template image. This image can be created each time you use this tool. However, if you saved this flood-filled image, you can save some steps and load it directly.
Three files are required to run this tool, and optional files (below) make it easier to use.
Required files:
This
file should have the following format:
1 252 263 CBM_Left
2 448 262 CBM_Right
3 266 157 AngularGy_Left
4 444 165 AngularGy_Right
The
1st column is ROI number, and would typically be a vector 1:MaxNumberOfROIs.
Use of this module will be most efficient if the order of this file is the same
order that you typically use for analysis.
The
2nd and 3rd colums are the x and y coordinates of a seed point location inside
each ROI (integer). If your favourite drawing program does not provide this
information, you can obtain these coordinates by displaying the image in MATLAB
and using the ginput
or getpts
command to generate the coordinates.
The
4th column is the name of region. If you omit the 4th column, the name of
region will be automatically called Region 1, Region 2 etc.
If
you obtain the bootstrap data using the command-line PLS, it is actually:
result.boot_result.compare_u
You
can save this variable as a text file using this MATLAB command:
save -ascii my_compare.txt
result.boot_result.compare_u
Optional files:
1
3
10
20
Procedures:
Sample data:
The sample data below is only for the
purpose of illustration the usage of
plotroi tool:
http://www.rotman-baycrest.on.ca/pls/source/Plotroi_testdata.zip
Thanks to Prof. A. R. McIntosh, Dr. N. J. Lobaugh, Dr. W. Chau, Jimmy Shen, and many others who made contribution to this PLSgui project.
·
McIntosh, A. R., F. L. Bookstein, J. V. Haxby, C.
L. Grady (1996). Spatial pattern analysis of functional brain images
using Partial Least Squares. Neuroimage 3: 143-157.
·
Lobaugh, N. J., R. West, A. R. McIntosh (2001). Spatiotemporal
analysis of experimental differences in event-related potential data with
partial least squares. Psychophysiology 38: 517-530.
·
McIntosh, A. R., W. K. Chau, A. B. Protzner (2004).
Spatiotemporal analysis of event-related fMRI data using partial least squares.
NeuroImage 23: 764–775.
·
McIntosh, A. R., N. J. Lobaugh (2004). Partial least
squares analysis of neuroimaging data: applications and advances. NeuroImage 23 Supplement 1: S250–263.
· McIntosh, A. R., N. J. Lobaugh, et al. (1998). Convergence of neural systems processing stimulus associations and coordinating motor responses. Cerebral Cortex 8: 648-659.
·
Gargallo,
R., C. A. Sotriffer, et al. (1999). Application of multivariate data
analysis methods to comparative molecular field analysis (CoMFA) data: proton
affinities and pKa prediction for nucleic acids components. J Comput Aided Mol Des 13(6): 611-23.
· Martin, Y. C., C. T. Lin, et al. (1995). PLS analysis of distance matrices to detect nonlinear relationships between biological potency and molecular properties. J Med Chem 38(16): 3009-15.
· Streissguth, A. P., F. L. Bookstein, et al. (1993). The enduring effects of prenatal alcohol exposure on child development: Birth through seven years, a partial least squares solution. Ann Arbor, Michigan, The University of Michigan Press.
· Wold, S., P. Geladi, et al. (1987). Multi-Way Principal Components and PLS Analysis. Journal of Chemometrics 1: 41-56.
· Edgington, E. S. (1980). Randomization tests. New York, Marcel Dekker.
· Good, P. (2000). Permutation tests: A practical guide to resampling methods for testing hypotheses. New York, Springer.
· Efron, B. and R. Tibshirani (1985). The Bootstrap Method for Assessing Statistical Accuracy. Toronto, University of Toronto.
· Efron, B. and R. J. Tibshirani (1993). An introduction to the bootstrap. New York, Chapman & Hall.
· Milan, L. and J. Whittaker (1995). Application of the parametric bootstrap to models that incorporation a singular value decomposition. Royal Statistical Society Journal, Series C: Applied Statistics 44(1): 31-49.