POBE : A Computer Program for Optimal Design of Multi-Subject Blocked fMRI Experiments

For functional magnetic resonance imaging (fMRI) studies, researchers can use multisubject blocked designs to identify active brain regions for a certain stimulus type of interest. Before performing such an experiment, careful planning is necessary to obtain eﬃcient stimulus eﬀect estimators within the available ﬁnancial resources. The optimal number of subjects and the optimal scanning time for a multi-subject blocked design with ﬁxed experimental costs can be determined using optimal design methods. In this paper, the user-friendly computer program POBE 1.2 (program for optimal design of blocked experiments, version 1.2) is presented. POBE provides a graphical user interface for fMRI researchers to easily and eﬃciently design their experiments. The computer program POBE calculates the optimal number of subjects and the optimal scanning time for user speciﬁed experimental factors and model parameters so that the statistical eﬃciency is maximised for a given study budget. POBE can also be used to determine the minimum budget for a given power. Furthermore, a maximin design can be determined as eﬃcient design for a possible range of values for the unknown model parameters. In this paper, the computer program is described and illustrated with typical experimental factors for a blocked fMRI experiment.


Introduction
One of the most prevalent methods for functional neuroimaging and the study of the human brain is functional magnetic resonance imaging (fMRI, Lindquist 2008;Di Salle et al. 1999). It has provided researchers with advanced insight about cognitive processes like perception, language, attention and memory (Chein and Schneider 2003). For a multi-subject fMRI experiment, several subjects are placed one by one in an fMRI scanner and asked to react or attend to certain stimulus types, e.g., listening to auditory stimuli or watching visual stimuli. The measured fMRI signal is caused by changes in the concentration of oxy-to deoxygenated blood in activated brain regions and the magnetic properties of oxy-and deoxygenated blood (Logothetis and Wandell 2004). The fMRI signal is not only measured temporally over the time course of the experiment but also spatially over the brain at so-called voxels. A voxel is a three-dimensional imaging unit, e.g., of size 3 mm × 3 mm × 3 mm, and fMRI signal time courses for whole brain coverage are typically obtained with a sampling frequency of 2 to 4 seconds from around 100,000 voxels.
One main design type for fMRI experiments is the blocked design which is efficient for detection of activation in brain regions (Birn, Cox, and Bandettini 2002;Friston, Zarahn, Josephs, Henson, and Dale 1999;Liu and Frank 2004;Maus, van Breukelen, Goebel, and Berger 2010b). For blocked designs, stimuli of the same type are grouped within blocks and the different block types are repeated cyclically during a time period of several minutes. The block types can be task blocks, where stimuli are presented and the subject performs the corresponding task, and rest or fixation blocks, where no stimuli are presented or the subject simply views a fixation cross. Rest or fixation blocks will also be called null blocks in the following as they relate to null events which are time points with no stimuli (Friston et al. 1999). During an experiment these blocks are ordered in a prespecified manner, e.g., task blocks are alternated with null blocks. A significant difference in fMRI signal between task and control blocks, i.e., another task or rest block type, indicates that the voxel corresponding to this fMRI signal difference is active for the task of interest. In the following, null blocks are denoted by N and task blocks by A 1 , . . . , A Q , where A i denotes the ith stimulus type or ith task block type, and Q represents the number of stimulus types. This paper presents a computer program with a graphical user interface (GUI) which provides a user-friendly environment for researchers to plan a multi-subject blocked design with regard to the optimal number of subjects and optimal scanning time. Design optimality has been commonly defined as efficient estimation of the model parameters of interest based on linear models. The optimal design is then the design which minimizes a function, e.g., the trace, of the covariance matrix for the estimators of the considered model parameters (Friston et al. 1999). For a one-dimensional contrast of the stimulus effects or one stimulus effect of interest, this approach results in the design with maximum statistical power. The methodology of the program is discussed in Section 2 and in Maus, van Breukelen, Goebel, and Berger (2011) in more detail. The program runs within MATLAB (The MathWorks, Inc. 2011). One important reason for choosing MATLAB is that MATLAB is a popular software program within the neuroimaging research community and several other programs for analysis of fMRI data are also MATLAB based, e.g., SPM (statistical parametric mapping, Wellcome Trust Centre for Neuroimaging 2013) and fMRIstat (Worsley et al. 2002). The computer program POBE allows the users to specify various experimental conditions and model assumptions. The GUI facilitates the calculation by an easy to use environment.
Previous research on optimal design of blocked fMRI experiments has focused on the optimal length and order of blocks. The optimal block length recommended in the literature varies between 10 and 20 seconds (Aguirre and D'Esposito 1999;Chein and Schneider 2003;Maus, van Breukelen, Goebel, and Berger 2010a;Maus et al. 2010b), and the optimal block order should present control blocks as often as task blocks (Maus et al. 2010a). This means that block order A 1 A 2 is optimal if the contrast A 1 − A 2 between stimulus type A 1 and A 2 is of interest with either A 1 or A 2 being the control block type. The exact order of stimulus blocks or null blocks in the block order is here not relevant, e.g., A 1 A 2 can be replaced by A 2 A 1 . Otherwise if activation during tasks A 1 and A 2 is of interest, block order A 1 A 2 N is optimal and the null block N is the control block. If the contrasts A 1 − A 3 and A 2 − A 3 are of interest and A 3 is a control block, block order A 1 A 2 A 3 is optimal as A 3 corresponds here to the control condition similarly to the null block in the previous example. Block order A 1 A 2 means that during the experiment task blocks of stimulus type A 1 are presented and followed by task blocks of stimulus type A 2 . This order is repeated several times during the experiment. Order A 1 A 2 N means that task blocks A 1 are followed by task blocks A 2 which themselves are followed by null blocks during the experiment. Further studies about the choice of block order can be found in ? and Nakai, Matsumura, Nose, Kato, Glover, and Matsuo (2003). However, to plan a multi-subject fMRI experiment, the researcher also needs to determine the optimal number of subjects and scanning time per subject to obtain efficient experimental results within the given budget.
Typically, 10 to 20 subjects are scanned during a continuous scan period of up to 15 minutes. Given the block length and block order, the scanning time for a blocked design is determined by the number of cycles (repetitions) of the block order. Results for the optimal number of subjects and cycles for efficient estimation of the effects of interests within a given cost budget are presented in Maus et al. (2011). The methods in Maus et al. (2011) are extended in this paper by the maximin procedure which helps users to find an efficient design within a possible range of values for unknown model parameters. Because of the high costs for fMRI experiments, it is highly relevant that researchers possess tools like the one presented in this paper to plan their studies and use their budget efficiently. One effect of the high costs for fMRI is that fMRI studies often only have small numbers of subjects. However, the choice of the number of subjects for an experiment should be based on the design efficiency which is achieved for this number of subjects.
The software presented here will help and educate fMRI researchers about the optimal choice for the number of cycles and for the number of subjects. So far, no tools have been provided for researchers to calculate the optimal multi-subject blocked designs taking costs into account. Kao, Mandal, Lazar, and Stufken (2009) developed MATLAB code to determine the optimal stimulus sequence by the use of a genetic algorithm. The optimal stimulus sequence for blocked designs would refer to the optimal block order and length of blocks. Their code is described in Kao (2009). In contrast to our program, they did not consider multi-subject experiments or provide a GUI. Mumford, Poldrack, and Nichols (2007) provide a useful MAT-LAB based application and GUI, called fMRIpower tool, to calculate power for future group fMRI experiments. Previous fMRI analyses within the fMRI software packages SPM and FSL are needed for the fMRIpower tool restricting it thus to users of SPM or FSL (Jenkinson, Beckmann, Behrens, Woolrich, and Smith 2012;Smith et al. 2004;Woolrich et al. 2009). The program fMRIpower is based on the power calculation methodology presented in Mumford and Nichols (2008) while our methodology involves minimizing the average variance of the estimators which results in maximum power for a single effect of interest. Another tool for power analysis of fMRI studies is PowerMap (Joyce and Hayasaka 2012) which performs statistical power calculation based on non-central random field theory. In contrast to Joyce and Hayasaka (2012) and Mumford and Nichols (2008), costs are taken into account in the program POBE which can also be used to find the minimum budget for a desired level of power.
The paper is organized as follows. In Section 2 the methodology is outlined. The first-level (within-subject) and second-level (between-subject) model, the cost function, the optimality criteria and the maximin design are explained. Section 3 describes the computer program and its input values. An illustration of the computer program with a practical example is provided in Section 4. Finally, a discussion and conclusion are presented in Section 5.

Model
To describe the hierarchical structure of multi-subject fMRI data, the measured fMRI signal is commonly expressed in a first-level model on the subject level and a second-level model combining the first-level parameters from all subjects (Mumford and Nichols 2006;Penny and Holmes 2007). Each subject is measured at T time points with a given repetition time (TR). The following first-level model is used to express the fMRI signal Y i at a given voxel for subject i: where the T × Q matrix Z models the expected fMRI signal to the Q different stimulus types due to their presentation during the experiment. The matrix Z is calculated by convolution of the stimulus sequence, which indicates the stimulus presentations, with the hemodynamic response function (HRF, Kao, Mandal, Lazar, and Stufken 2007). The HRF corresponds to the fMRI signal after one short stimulus duration. The parameter vector β i corresponds to the stimulus effects for subject i. The nuisance parameter vector γ i represents the effect of the nuisance terms in matrix S which models low frequency noise. The error i captures all variation in the fMRI signal which is not described by the stimulus or nuisance effects. The error i = ( i1 , . . . , iT ) is assumed to be normally distributed, that is i ∼ N (0, σ 2 Σ) with expectation 0 and covariance matrix σ 2 Σ for all i = 1, . . . , N .
Furthermore, it is assumed that the error i follows an autoregressive error of order 1 (AR1) structure. The AR1 structure is a common and realistic model for the error in fMRI data analysis (Gautama and Hulle 2005). It means that the error variance is stationary over the different time points t = 1, . . . , T , i.e., VAR( it ) = σ 2 for all t ∈ {1, . . . , T }, and that the correlation between two errors at different time points t 1 and t 2 decreases with increasing time lag between these two time points, i.e., COR( it 1 , it 2 ) = ρ |t 1 −t 2 | for all t 1 , t 2 ∈ {1, . . . , T }. The parameter ρ is called the AR1 autocorrelation parameter.
The HRF is commonly modeled by the double gamma function, a difference of two gamma distributions: The first gamma distribution models the positive peak of the HRF and the second gamma distribution models the negative peak, the undershoot, of the HRF. Standard values for the time to peak parameter a 1 and the positive dispersion b 1 are a 1 = 5 and b 1 = 1. The time to undershoot parameter a 2 , the negative dispersion b 2 , the positive to negative ratio parameter c 2 are commonly chosen by a 2 = 15, b 2 = 1 and c 2 = 6. The onset parameter d is normally set to 0. Using these parameters, the so-called standard or canonical HRF is obtained (Henson and Friston 2007) which is normally sampled between 0 s (minimum of HRF sampling range) and 32 s (maximum of HRF sampling range). If only the peak is modeled, the single gamma HRF suggested by Boynton, Engel, Glover, and Heeger (1996) is used. Furthermore, a scaling parameter c 1 is specified here to model a saturation effect under nonlinearity of the HRF (Boynton et al. 1996;Huettel and McCarthy 2000;Wager and Nichols 2003). Under linearity of the HRF, the scaling parameter c 1 is assumed to equal 1.
The first-level subject-specific parameters β i are combined in a second-level model to describe the group parameter vector β G of interest: where b i is the vector of random subject-specific stimulus effects which are expected to be normally distributed with expectation 0 and covariance matrix σ 2 q D. The matrix D corresponds to the correlation matrix of the random-effects vector b i .
The aim of a blocked fMRI experiment is mostly the localization of active regions for certain tasks, e.g., viewing faces. It is common to consider the differential activation between different tasks to localize specific cognitive sub-processes. For example, the contrast between viewing faces and viewing houses can be of interest to localize regions responsible for face recognition. To localize active voxels, the stimulus effect vector β G or a contrast vector Cβ G of the stimulus effects is estimated at each voxel and tested for zero effect. The matrix C is a matrix where each row contains one contrast of interest. If C equals the identity matrix I, the stimulus effects β G are of interest. In this paper, designs are presented which are efficient to estimate the effect vector Cβ G . The efficiency of a design is evaluated here by the A-or D-optimality criterion based on the covariance matrix of the estimator Cβ G for Cβ G (Atkinson, Donev, and Tobias 2007;Wager and Nichols 2003). Strictly speaking, the applied A-optimality criterion explained in Section 2.2 is called C-optimality criterion in optimal design literature and reduces to the A-optimality criterion when C equals the identity matrix I. However, in consistency with fMRI literature the term A-optimality criterion will be used. The covariance matrix is given by where P V S is the projection matrix onto the space spanned by the matrix V S and I is the identity matrix (here of size T × T , Maus et al. 2011). The matrix V = Σ −1/2 is the inverse square root matrix of the error correlation matrix Σ. The covariance of Cβ G is thus an averaged sum of the within-subject covariance matrix σ 2 C Z V (I − P V S )V Z −1 C and the between-subject covariance matrix σ 2 q CDC .

Optimality criteria
Two different optimality criteria, the A-and D-optimality criteria, can be specified in POBE to find the optimal design for which a function of the covariance matrix of the parameter estimators is minimized. The A-optimality criterion selects as optimal the design which minimizes the trace of the covariance matrix COV(Cβ G ), that is the sum of the individual variances for the (contrast) effect estimators in Cβ G , over all designs ξ in the design space Ξ. The D-optimality criterion chooses as optimal design the design which minimizes the determinant of the covariance matrix COV(Cβ G ) over all designs in the design space. As a consequence, the confidence ellipsoid for the parameter estimators of interest is minimized.
For our program and approach, designs ξ are compared which differ in the number of subjects and the number of cycles. Other experimental factors, e.g., the block order or number of stimulus types, are expected to be chosen by the researcher depending on the research question of interest. Therefore, the design space Ξ, from which the optimal design is chosen, contains blocked designs ξ with different number of subjects and cycles: Given the total experimental costs, the number of subjects and cycles are restricted to certain combinations which do not exceed the costs. The cost function describing the experimental costs is explained in Section 2.3. The A-optimal design ξ * is the design with values for N and N C which minimize the sum of the variances for the (contrast) effect estimators over all designs ξ ∈ Ξ subject to a linear cost function. In other words, the A-optimal design ξ * minimizes the trace of the covariance matrix COV(Cβ G ) over all designs ξ in the design space Ξ within a given budget. For the D-optimality criterion, we consider the expression where c is the number of contrasts in the c × Q matrix C. Without any budget restriction, the higher the number of subjects and cycles, the better the experiment for both optimality criteria, and no recommendation for the optimal number of subjects and cycles is possible. The budget constraint limits the possible combinations of N and N C so that the calculation of the optimal number of subjects N opt and the optimal number of cycles N C opt is possible. In the following section, it is described how the total budget is expressed by a linear cost function.
It can be seen from Equation 6 and Equation 7 that it is sufficient to focus on the variance ratio of within-subject variance to between-subject variance σ 2 /σ 2 q to determine the values N C and N for which the minimum of Equation 6 or Equation 7 is obtained. The betweensubject variance σ 2 q does not influence the values of N C and N for which the minimum of Equation 6 and Equation 7 is obtained because it is only a multiplicative factor in Equation 6 and Equation 7.

Cost function
The total experimental costs C T are the sum of the basic costs for all subjects and the costs for the effective functional scanning time of all subjects. The basic cost for each subject is denoted by C 1 and consists of the subject fees, recruitment and equipment costs per subject, costs due to preparation of a subject or the scanner before the subject's session and costs for the scanner time to obtain structural T1-weighted images. The costs for the effective scanning time (functional imaging) per hour are given by C 2 . The scanning time of all subjects equals N · N C · T C , where T C is the scanning time in seconds per cycle. The linear cost function is given by the following expression: The scanning time T C per cycle depends on the block order, the number N BL A of trials per task block, the number N BL 0 of null events per null block and the stimulus onset asynchrony (SOA). The SOA gives the time between trials in a task block or between null events in a null block. In general it is recommendable to choose the SOA as small as possible so that the HRF successive trials sums up to a strong fMRI signal per task block. However, it has to be taken into account that for small SOAs, e.g., lower than 2 s, a nonlinear saturation effect takes place so that the hemodynamic response to successive trials is lower than expected. A nonlinear saturation can be modeled in POBE by specifying a scaling parameter smaller than 1 for the HRF.

Maximin criterion
Using one of the optimality criteria described in Section 2.2 and the cost function in Equation 8, the optimal design with N opt subjects and N C opt cycles can be determined. However, knowledge about the values for the AR1 autocorrelation parameter ρ, the variance ratio σ 2 /σ 2 q and the offdiagonal elements of the random-effects correlation matrix D is needed. These values can be determined from previous studies or pilot studies. If a specification of these values is not possible, the maximin criterion can be applied which suggests a design with relatively high efficiency over the whole possible range of parameter values. The software focuses on the calculation of maximin designs for a possible range of the autocorrelation and/or a possible range of the variance ratio. The random-effects correlation which is equal to the off-diagonal elements of the matrix D is only relevant under certain circumstances, i.e., if more than one stimulus type is considered and C is unequal to the identity matrix or the D-optimality criterion is used. In contrast, the autocorrelation and the variance ratio are relevant for any situation.
The maximin criterion uses the relative efficiency (RE) to compare designs to each other. The RE of design ξ 1 versus another design ξ 2 is given by where ψ denotes the trace or the determinant depending on whether the A-or the Doptimality criterion is used. The covariance matrix COV Cβ ξ j G denotes here the covariance matrix for Cβ G obtained when design ξ j (j = 1, 2) with its values for the number of subjects and cycles is applied. The RE is a value between 0 and ∞ with values smaller than 1 indicating that design ξ 1 is less efficient than design ξ 2 . REs higher than 1 indicate that design ξ 1 is more efficient than design ξ 2 . The maximin design is given by the following expression The unknown parameter is here denoted by p which corresponds either to the autocorrelation parameter ρ of the AR1 error structure, the variance ratio σ 2 /σ 2 q or to a two-dimensional parameter p = (p 1 , p 2 ), where p 1 corresponds to the autocorrelation parameter ρ and p 2 corresponds to the variance ratio σ 2 /σ 2 q . The possible range of values for this unknown parameter p is given by P , e.g., P = [0, 0.3] and p is the autocorrelation parameter ρ.
Firstly, the maximin criterion calculates the REs of a given design ξ versus the locally optimal designs ξ * p for a given value of p in P . Secondly, the minimum of these REs is determined over all values of p in P . This minimum value of the RE over all possible values of p is the worst RE for a design ξ. Thirdly, the design ξ with maximum minimum RE over all designs ξ in Ξ is chosen to be the maximin design ξ MMD . If the maximum minimum RE corresponding to this design is high, the maximin design is efficient over the whole possible range of values for the parameter p.

Code
In this section the procedure and MATLAB code to find the optimal number of cycles and subjects is described. A flowchart of the procedure is given in Figure 1. The computation is complicated by the fact that the optimal number of subjects N opt and cycles N C opt need to be positive integers. For simplification and to explain the general procedure without too many technical details, the explanation is restricted here to finding an optimal positive integer value of N C but not necessarily an optimal integer value for N . Furthermore, we will focus below on the A-optimality but the same explanation and argumentation can be used for the D-optimality criterion.
To find the A-optimal design, we want to minimize trace(COV(Cβ G )) with respect to N C and N . The number of subjects N can be expressed by the number of cycles N C using the cost function in Equation 8 as all other factors are given: By replacing N in Equation 6 by the expression above, one can focus on minimizing the trace of the covariance matrix COV(Cβ G ) with respect to N C . The optimal number of cycles N C opt is the number of cycles for which the trace of the covariance matrix is minimized. When the optimal number of cycles N C opt has been determined, the optimal number of subjects N opt can be calculated using Equation 11. To find the optimal number of cycles, the value of N C is increased from the minimum possible value, e.g., 1, in steps of 1 during a loop until a minimum value for Equation 6 is obtained (see Figure 1).
This procedure assumes that there is only one minimum value of Equation 6 in dependence of N C . If there is more than one minimum value of Equation 6 in dependence of N C , our procedure would only find the minimum, for which the number of cycles is the lowest and for which as a consequence the number of subjects is the highest. In the following, it will be explained why the assumption that there is only one minimum of Equation 6 in dependence of N C is justified.
For uncorrelated errors and the A-optimality criterion, it has been shown analytically that only one positive value for N C exists where a minimum is obtained (Maus et al. 2011). or Equation 7 would be achieved for N C equal to 1. For simplification, we will focus again in the following explanation again on the A-optimality criterion but the explanation also holds for the D-optimality criterion.
The first part σ 2 q /N of the A-optimality criterion in Equation 6 is (after replacing N by its expression in Equation 11) a linear function of N C and increases thus linearly for increasing N C . The second part σ 2 · trace(C Z V (I − P V S )V Z −1 C + CDC ) of Equation 6 decreases for increasing N C as every new cycle provides new information about the effects Cβ G of interest so that the trace of the within-subject covariance matrix plus the between-subject covariance matrix decreases. However, the gain of information is higher for lower number of cycles and decreases with an increasing number of cycles N C . Therefore, the decrease of There are two possibilities for the behavior of the product of the first term σ 2 q /N with the second term in Equation 6. The first possibility is as follows. For lower number of cycles the first term σ 2 q /N in Equation 6, which linearly increases for increasing N C , is overruled by the second term in Equation 6, which has a more than linear decrease for increasing N C . For higher number of cycles the first term σ 2 q /N in Equation 6, which always increases linearly for increasing N C , overrules the second term in Equation 6, which decreases now weaker than linear for increasing N C . It follows that Equation 6 firstly decreases and then increases for increasing N C . Thus, Equation 6 is a convex function for any positive N C . Based on the fact that Equation 6 is a convex function of N C , an integer value for N C can be found using the procedure as described in Figure 1, where N C is increased within a loop until a minimum of Equation 6 is found.
The second possibility is that the first term σ 2 q /N , which always increases linearly for increasing N C , overrules the second term in Equation 6 for all N C . For this possibility, Equation 6 is an increasing function for increasing N C and the minimum value of Equation 6 is obtained for N C = 1, the minimum possible value of N C . The loop would be stopped for N C = 2 as a minimum value of Equation 6 has been found for N C = 1 (see Figure 1).

The computer program
The computer program POBE (program for optimal design of blocked experiments) provides an easy method for researchers to design their fMRI experiments. This section describes the GUI of the program POBE which determines the optimal number of subjects and cycles for a blocked fMRI experiment. It is also possible to run the desired computations for an optimal design and maximin designs using the example files"POBE_script_example_power.m" and "POBE_script_example_ratio_fixed.m" (in the "code_examples" subdirectory of the source code). The program is available at http://www.nitrc.org/projects/pobe/ and as supplementary material from the journal web page. The program was developed and tested on Windows XP and Windows 7 operating systems.

Main menu
To start the main menu, the user types pobe in the command window of MATLAB and presses the enter key. The current directory in the MATLAB desktop should be the directory containing the POBE program. Alternatively, the user can add the directory containing the POBE program to the search path of MATLAB, e.g., using addpath. The main menu has seven different panels (see Figure 2) which are explained below.
The first panel "Specify your design and contrasts" is used to specify design characteristics and the matrix C in Equations 6 or 7 for estimation of the effects of interest. The entries here are chosen by the user depending on the research question of interest. In the second panel "Optimality criteria" the researcher can choose the A-optimality criterion, which is commonly applied for fMRI studies, or the D-optimality criterion based on his preference. In the third panel "Specify your costs" the user can indicate the costs for subjects, for the scanning time and for the whole experiment. The costs are specified by the resources and facilities which are available for the researcher. In the fourth panel "Specify your HRF" the user can specify whether he wants to use the standard double gamma HRF or specify his own HRF parameters, e.g., to handle nonlinearity of the HRF.
In the fifth panel "Specify your variance and correlation parameters" the model parameters for the error covariance structure, e.g., the autocorrelation parameter, are entered. The variance and autocorrelation parameters in the fifth panel can be based on knowledge from previous studies or a pilot study. It is also possible to specify an interval of possible values for the variance ratio of within-subject variance to between-subject variance and/or an interval of possible values for the autocorrelation parameter. If such a range is specified, the optimal design is calculated for several values in this range with steps of 0.01 for the autocorrrelation and steps of 0.1 for the variance ratio. Additionally, maximin designs can be determined when indicated in the seventh panel. If the option "Range for correlation and ratio (nothing fixed)" is chosen, a maximin design will be calculated automatically since a two-dimensional graph for the optimal number of subjects or cycles based on the already two-dimensional space for the variance ratio and autocorrelation parameter is not possible.
The sixth panel "Specify your nuisance terms" is used to describe the nuisance terms in the nuisance matrix S. The nuisance terms in the sixth panel depend on the low frequency noise which a researcher wants to use in his model. In the seventh panel "Specify additional outcome results" the user can choose the calculation of maximin designs or power as additional outcome results. To perform power calculations, the MATLAB statistical toolbox stats is necessary.
In the following the buttons, options and data entry fields in the main menu are described in more detail. The user has to specify these options and the values for the entry fields in order to determine the optimal design.

General buttons:
Exit: Pushing the button Exit will lead to exiting the program POBE after asking a confirmation from the user about leaving the program.

Reset:
The button Reset can be used to clear all entered values in the entry fields in the main menu of POBE.
Help: After clicking this button, reference to more information about POBE is provided.

Input in first panel "Specify your design and contrasts"
Task block length (seconds): The length of task blocks is entered here in seconds.

Null/Rest block length (seconds):
The length of null blocks is entered here in seconds. Null block length can also be equal to 0 seconds.

Stimulus onset asynchrony (seconds):
The stimulus onset asynchrony is entered here in seconds. The stimulus onset asynchrony gives the time between two trials in a block.

TR (seconds):
The repetition time (TR) is entered here in seconds. The TR gives the time between two successive measurement time points, i.e., scans. A measurement refers here to an fMRI brain scan.
Number of stimulus types: The number of stimulus types (also commonly called tasks or conditions) can be entered here. Block order : The user can choose in the pop-up menu between two block orders, that is ABN or ANBN. These block orders, which for simplicity indicate two stimulus types A and B, are notations for two different types of block order and are irrespective of the number of stimulus types. Block order ABN means that a cycle of all task blocks is followed by a null block. If block order ANBN is chosen, each task block will be alternated with a null block in the design. If the null block length is equal to 0 seconds, both options ABN and ANBN will result in block order AB.
Choose effects: Two options can be chosen in the pop-up menu, that is "Individual stimulus effects" or "Enter specific contrast matrix". For the first option "Individual stimulus effects", the matrix C in Equation 6 will be set to the identity matrix I Q of size Q, where Q is the number of stimulus types. When the second option is chosen, the sub-menu in Figure 3 opens for input of the contrast matrix. One row of the matrix corresponds to one stimulus contrast. The sub-menu contains the push buttons Save, Reset, Cancel and Help. Pushing the button Save saves the entered contrast matrix and returns to the main menu of POBE. The button Reset is useful for clearing the entered contrast matrix and entering a new contrast matrix. If the user does not want to enter a specific contrast matrix and wants to return to the main menu, the user can click the button Cancel. Clicking the Help button provides more information for the user on how the contrast matrix should be entered.

Input in second panel "Optimality criterion":
The user can choose between the A-or D-optimality criterion in the menu.

Input in third panel "Specify your costs":
Subject costs: The subject costs correspond to the fixed costs per new subject, e.g., recruitment fees, participation fees and time for use of the scanner to obtain structural images, and can be entered here. Any costs which are related to a subject but not to the effective functional scanning time should be summarized in the subject costs.
Scanner costs: The user can enter the costs for use of the fMRI scanner for one hour. Total study budget: The total budget for the experiment can be entered here.

Input in fourth panel "Specify your HRF":
Choose HRF: Two options can be chosen in the pop-up menu for the HRF, that is "Standard HRF (double gamma)" or "Enter user defined HRF". For the first option "Standard HRF (double gamma)", the HRF will be set to the standard double gamma function. When the second option is chosen, the sub-menu in Figure 4 opens for input of the HRF parameters. More information on the HRF is provided in Section 2.1. The sub-menu contains the push buttons Save, Reset, Cancel and Help. Pushing the button Save saves the entered HRF parameters and returns to the main menu of POBE. The button Reset is useful for clearing the entered HRF parameters and specifying new parameters. If the user does not want to enter a specific HRF parameter and wants to return to the main menu, the user can click the button Cancel. Clicking the Help button provides more information for the user.
Input in fifth panel "Specify your variance and correlation parameters": Specify whether fixed values or ranges are assumed: The user can choose between five different options in this pop-up menu, i.e., "Fixed values (no ranges)", "Range for correlation (ratio fixed)", "Range for ratio (correlation fixed)","Range for correlation (ratio fixed) and ratio (correlation fixed)" and "Range for correlation and ratio (nothing fixed)". The fourth option combines the output from the second and third option in one result window. Depending on the choice the user has to indicate different values for the autocorrelation parameter and variance ratio.
Autocorrelation parameter (AR1): The user can firstly specify whether he wants to use a cross-correlation vector from a previous study so that an autocorrelation matrix from a previous experiment is applied. This can be done in the pop-up menu with the options "Specify" or "Previous study". If the option "Specify" is chosen, the user has to specify values for the autocorrelation, e.g., fixed, minimum or maximum values depending on the choice in the pop-up menu "Specify whether fixed values or ranges are assumed". If the option "Previous study" is chosen the user has to specify a MATLAB file called "autocorr.mat", which contains a vector called "myscannerxc" with the observed crosscorrelations from a previous study over several time points, e.g., 51 time points. Some example files are given in the folder autocorr_files of POBE.
Variance ratio (within-subject variance to between-subject variance): Based on the choice for the pop-up menu "Specify whether fixed values or ranges are assumed", the user has to specify a fixed value and/or a minimum and a maximum value for the variance ratio σ 2 /σ 2 q .
Correlation between random effects: The user can specify a correlation between the random effects. If the A-optimality criterion and the option "Individual stimulus effects" for the matrix C are chosen, the random-effects correlation will not influence the optimal design as the offdiagonal elements of the random-effects correlation matrix D in Equation 6 are not taken into account for calculation of the A-optimality criterion. For one stimulus type, there is only one random stimulus effect and the random-effects correlation is also irrelevant.
Input in sixth panel "Specify your nuisance terms": Model nuisance: The user can check the box if he wants to specify the type of nuisance terms and the nuisance order. An unchecked box will result in the default nuisance terms which are a constant signal baseline modeled by the default nuisance matrix S = 1 T . The vector 1 T denotes here the T × 1 column vector with only 1 as entries. The default nuisance terms and default nuisance matrix S = 1 T are equivalent to Legendre polynomials of order 0 or discrete cosine transforms of order 0.
Type of nuisance terms: In the pop-up menu the user can choose between "Legendre polynomials" and "Discrete cosine transforms".
Nuisance order: The user can indicate the nuisance order which corresponds to the number of Legendre polynomials or discrete cosine transform modeled in the columns of the nuisance matrix S in Equation 6.
Options to obtain output in seventh panel "Specify additional outcome results": Maximin design for autocorrelation range: Depending on the choice in the pop-up menu "Specify whether fixed values or ranges are assumed", the user can indicate by clicking the box whether a maximin design for the autocorrelation range will be calculated.
Maximin design for variance ratio range: Depending on the choice in the pop-up menu "Specify whether fixed values or ranges are assumed", it can be specified by the user whether a maximin design for the variance ratio range should be calculated.
Calculate power: If only a one-dimensional contrast between stimulus effects or only one stimulus effect is estimated, the user can indicate here whether a power calculation for the optimal design should be performed. This option can also be used to determine the minimum budget for a given desired power level. For example, if the obtained power for the given total costs is too low, the user can raise the total costs until he finds the costs which guarantee the desired power level. On the other hand, if the obtained power for the given total costs is higher than necessary, the user could lower the total costs until he finds the minimum costs to guarantee the desired power level. If a user ticks this box, a new window will be opened and the user has to enter the effect size, within-subject variance, between-subject variance and the significance level. The effect size corresponds here to the expected value for the group level effect Cβ G of interest.
Buttons to obtain output: Calculate optimal number of subjects and cycles: When this button is pressed, the optimal number of subjects and cycles will be calculated for fixed values of the autocorrelation and of the variance ratio or for the ranges of possible values for the autocorrelation and for the variance ratio.
It is not necessary to specify the calculation of a maximin design if the option "Range for correlation and ratio (nothing fixed)" is chosen in the fifth panel. For this choice, a maximin design will be calculated automatically.

Output
Depending on the choice in the pop-up menu "Specify your variance and correlation parameters", a certain output window is obtained for the results. The results figures can be saved as MATLAB figure file, and a file name, e.g., ResultsFigure692011-1142.fig, will be automatically created by using the date and time of file creation. Furthermore, input values and the corresponding results for the optimal design or maximin design can be saved as an Excel file (Micrsoft Corporation 2013). Please note that the option to save Excel files is implemented using the command xlswrite which might not be functional on non-Windows operating systems. The different result windows will be discussed in Section 4 by means of an application example of POBE.

Input
In this section, the program POBE is illustrated by one example. It is assumed that the block length of task and null blocks is 15 seconds which is in the common range of 10 to 60 seconds for block lengths. Furthermore, the SOA and TR are set equal to 2.5 s. The number of stimulus types is 1 and the block order is chosen to be ABN which is for one stimulus type equivalent to block order ANBN. The menu "Choose effects" is set to individual stimulus effects which means that the parameter β G in Equation 3, the group effects of the stimuli, is estimated. Furthermore, a total study budget of EUR 6000 is chosen with subject costs of EUR 200 and costs per hour scanner time of EUR 400. Furthermore, the A-optimality criterion and the standard HRF are chosen.
To specify the variance and correlation parameters, information from previous studies is needed. For this purpose, the group analysis results in Mumford and Nichols (2008) are  chosen as all necessary parameter estimates for the model parameters, that is between-subject variance, within-subject variance and autocorrelation parameters, are presented. Mumford and Nichols (2008) used the FIAC single subject block design data to estimate these parameter values. Details about the experiment can be found in Mumford and Nichols (2008) and Dehaene-Lambertz et al. (2006). Transferring their SPM estimates into an AR1 structure, leads to the following values. The estimated parameters for the AR1 autocorrelation varied from 0.12 to 0.33 with a mean of 0.25. The within-subject to between-subject variance ratio was between 2.06 and 13.69 with a mean of 6.16. The random-effects correlation is not relevant as only one stimulus type is assumed. For the nuisance terms, discrete cosine transforms as implemented in SPM with order 3 are used. The input values can be seen in Figure 5a. To calculate the power of the optimal design, we will assume an effect size in percent signal change ∆ = 0.5%, σ 2 = 2.464, σ 2 q = 0.4 and a significance level (type I error) of 0.005 (Figure 5b.)

Output
Depending on the option chosen in the pop-up menu "Specify whether fixed values or ranges are assumed" a different type of result window appears (see Figure 6). As the result windows for option "Range for correlation (ratio fixed)", option "Range for ratio (correlation fixed)", option "Range for correlation (ratio fixed) and ratio (correlation fixed)" and option "Range for correlation and ratio (nothing fixed)" are very similar, only the result window for option "Range for correlation (ratio fixed)" is presented here.
When option "Fixed values (no ranges)" is chosen, the result window in Figure 6a appears which shows the optimal design for the given input in Figure 5a. The optimal number of subjects and cycles, the exact experimental costs and the scanning time per subject in minutes are all indicated in Figure 6a. For the option "Fixed values (no ranges)", a fixed autocorrelation of 0.25 and a fixed variance ratio of 6.16 are used for calculation of the optimal number of subjects and cycles. Given the input as shown in Figure 5a, the optimal number of subjects equals 26 and the optimal number of cycles equals 9. This results in total experimental costs of EUR 5980 and in a scanning time of 4.5 min per subject. The power of the design is almost 90%. The user can save the results by clicking the button "Save results". An Excel file will be created in the current MATLAB folder. This Excel file contains the input factors and the results for the optimal design (see Figure 7).
If the option "Range for correlation (ratio fixed)" and the calculation of a maximin design for the autocorrelation range are specified by the user, the result window in Figure 6b is displayed. The window "POBE 1.2: optimal results for autocorrelation range" contains two graphs which show the optimal number of cycles and subjects for the given autocorrelation range. In Figure 5a the range 0.12-0.33 was indicated by specifying the minimum value of autocorrelation equal to 0.12 and the maximum value equal to 0.33. It can be seen in Figure 6b that for a lower value of autocorrelation the optimal number of cycles is 6 and the optimal number of subjects is 27. For a higher value of the autocorrelation the optimal number of cycles is 9 and the optimal number of subjects is 26. The panel in Figure 6b below the graphs shows the maximin design which has 6 cycles and 27 subjects resulting in total experimental costs of EUR 5940 and a scanning time of 3 minutes for each subject. The maximin value is almost 1 (0.9954) which indicates that the maximin design is efficient over the whole range of autocorrelation. A similar result window as in Figure 6b is obtained when the option "Range for ratio (correlation fixed)" is chosen. The graphs for this option will differ from the graphs  in Figure 6b by display of the variance ratio range on the x-axis instead of the autocorrelation range as in Figure 6b. Furthermore, when option "Range for correlation (ratio fixed) and ratio (correlation fixed)" is chosen, four graphs are shown with the autocorrelation or the variance ratio on the x-axis and the optimal number of subjects or the optimal number of cycles on the y-axis. For the option "Range for correlation and ratio (nothing fixed)" a result window similar to Figure 6a is displayed and the maximin design is given. No graphs are given since the presentation is complicated by the need to display a three-dimensional graph. The user can decide to save the figures or to save the maximin design by pressing the button "Save figures" or "Save maximin design" (see Figure 6b). These buttons are also displayed in the result window after choosing a range for the variance ratio or in the result window after choosing a range for the autocorrelation and for the variance ratio. When the user saves the figures, a MATLAB figure file with file extension .fig is created containing the same graphs as in Figure 6b and the maximin design if applicable but not the push buttons "Save figures" and "Save maximin design". The MATLAB figure file can be found in the current folder of MATLAB. When saving the maximin designs, an Excel file is created in the current MATLAB folder. This Excel file is similar to the Excel file shown in Figure 7 except that for the input this Excel file contains minimum and maximum autocorrelation instead of autocorrelation and for the results it contains the maximin design instead of the optimal design. For the options "Range for ratio (correlation fixed)", option "Range for correlation (ratio fixed) and ratio (correlation fixed)" and option "Range for correlation and ratio (nothing fixed)" in the pop-up menu "Specify whether fixed values or ranges are assumed", the user can also create Excel files with the relevant input factors and obtained maximin designs.

Discussion and conclusion
Multi-subject blocked fMRI experiments are expensive. Huettel (2012) assumes that in future event-related designs will be more popular than blocked designs for fMRI experiments.
However, the author also indicates that blocked designs will remain useful for applications where maximal detection power is needed. Furthermore, blocked designs are in general recommended for clinical studies with neurologically impaired patients who might not be able to handle the complexity of rapid event-related designs (Chein and Schneider 2003). For clinical studies cost effectiveness will be in particular relevant. Therefore, it is important to determine optimal designs which maximize design efficiency within given costs. Our program is based methodologically on linear modeling and thus not relevant for other fMRI data analysis methods, e.g., multivariate techniques. To our knowledge, however, the general linear model approach is popular for analysis of fMRI data (Lindquist 2008).
This paper explains the use of the program POBE which helps researcher to determine the optimal number of cycles and subjects for a blocked experiment. The user can specify the characteristics of the design and indicate values for model parameters. If the researcher is uncertain about the specific value of a model parameter, a maximin design, which is robust against misspecification of the model parameter, is determined. An example is provided for illustration of the program.