Bi184 Homework 3

Homework 3

In this homework you will need to implement the project you proposed in your proposal. To make things easier, we have already implemented a GUI interface that implements the block experimental design. So, if you proposed a block design experiment, you will only have to prepare the images/movies and make sure they work within the existing GUI.

Here is how to interface with the existing code:

1) Download and extract the zip file.

2) Run matlab and change the current directory to where you extracted the zip file (or, alternatively, add that folder to matlab’s path).

3) Prepare four text files with the following structure

3.1) “Experiment.txt” file. This file should contain only three lines. The first should be the name of the text file containing the images. The second should be the name of the text file containing the block description (which images are in which block), and the third line should contain the name of the text file with the block order. You can look at the example provided. The experiment file is called “FaceLocalizerExperiment.txt”.

3.2) The image text file (in the example it is called “StimList.txt”). This file should contain a number, followed by the folder and image.

For example: “1 Bodies\\body1.tif”. Each image should have a unique number.

3.3) The block description file (in the example, it is called “BlockList.txt”). This file contains the list of blocks, and which images are present in each block.

For example:






would mean that the first block is called “Bodies”, and it has the images 1,2,3, which were defined in StimList.txt. Please be extra careful to keep the naming convensions (i.e., semicolum after the block order number, followed by a space, followed by a single word describing the block).

3.4) The block order file (in the example, it is called “BlockOrder.txt”). This file contains the order in which blocks should appear.

for example:




will display the scrambles block, followed by the face block, followed by another scrambled block.

4) Run the GUI. Open matlab, switch to the folder with the code, and type “BlockDesign” in the command window (or open¬†BlockDesign.m and run it). The GUI has several controllers allowing you to specify the TR, the number of TRs per block, the image presentation time, size, etc.

Load the experiment file by clicking on “Load Experiment”. If everything is OK (files are found), you’ll see the blocks in the list. You can then run the experiment by clicking “Start”.

The experiment will start, the program will wait for a trigger key (default to ‘1’), and then images will start playing.


Note that this code allows you to present movies as well. Just put the name of the movie instead of the name of the image (see the provided example).

Please make sure your images and movies work with this GUI before submitting:

1. The four text files

2. The movies/images.

If you submission is too big to be sent over email, please use caltech dropbox.