Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

The "Vertex Analysis: requires you to prepare two files: the individual segmented structures combined into one file, and a design matrix to indicate which file belongs to which group. 

Combining individual files: concat_bvars

In a terminal, navigate to the directory with all the bvars files, e.g., [user@localhost temp]$ cd /mnt/hgfs/LinuxShare/temp

Create the single file with this command: concat_bvars output_name.bvars [list of ".bvars" files]. You most likely will use a wildcard "*" rather than typing each filename. For example, to combine all the left hippocampus files in the directory: [user@localhost temp]$ concat_bvars L_Hipp_all.bvars con*-L_Hipp_first.bvars dis*-L_Hipp_first.bvars 

This command will combine ALL individuals' L_Hipp  files. Therefore, if you want to exclude a subject, you need to move the files out of the folder, and re-run concat_bvars. You may want to name the output file with the number of subjects, e.g., "L_Hipp_all_N35.bvars" for 35 subjects. 

The files will be ordered alphabetically; knowing the order is required for the later steps (specifically, creating the design matrix).

Design matrix and contrast files

The design matrix is common to FSL statistical routines, and is the same as created in SPM. However, for FIRST there are some differences (see "Create a design matrix" in guide). Specifically, the group should be in one rather than two columns, and F tests should be used. Follow these steps:

1) Open Glm

Either start from the FSL GUI, or from a terminal "cd" to the directory, and type Glm (case sensitive).

2) Enter the total number of subjects, and the number in the first group (if using a two-group design)

Select "Higher-level / non-timeseries design" from the pull-down menu, enter the number of subjects (# inputs), click Wizard, select "two groups, unpaired", enter the number of subjects in group 1, click Process.

 

3) Adjust the design to have one column for group

Go the to General Linear Model window, and set to 1 EV; the Group B column will disappear.

4) Change the second group EV value from 0 to "-1" 

Scroll down to the second group (where values change from 1 to 0 in EV1 column); change all the "0"'s to "-1" (tedious).

5) Set one T contrast and one F contrast

From the top of the General Linear Model window select the "Contrasts & F-tests" tab, and set to one Contrast, one F-test, and select the C1 contrast for the F1 (click on the small square).

6) Save the file

Under the GLM Setup window click Save, navigate to the directory with the files, and choose a descriptive name ("des_2sample" for example). You can ignore the warning.

This will save a number of files, as in the example below (where "des" was chosen as the name). These files are used as input to several of the following procedures.

Moving the files to a separate folder

Because the stats only needs the design matrix and combined all.bvars files, these can be copied to subfolders for the next stages; this helps keep everything organized. Since you will likely be doing multiple models and statistical analyses, you can create as many well-named folders as you like, and copy the same set of design matrix & all.bvars files.

Background on design matrix

The design matrix is a text file with header information and numbers in columns. By tradition, the file is saved with a name like "design.mat". Each row represents a subject, in the order stored in the concatenated bvars file. The simplest design matrix (for a two group dataset) is a two columns, with the first +1 for rows in group 1 and 0 otherwise, and similarly +1 in the second column for rows in the second group. There is also header information which includes the number of columns (I think), the number of subjects, and the maximum value of each column. For example, here is a two-group, 5 subjects/group design matrix:

Glm from FSL GUI

Type "fsl" to start the FSL GUI, click "Misc " then "GLM Setup".

 

 

  • No labels