Mask images are generated by an algorithm consisting of a sequence of equations. Each equation is composed of a resultant destination, an operator and a set of operands. The result of each operation is a 3D volume with the same spatial dimensions as the currently loaded stim volume. The resultant destination, specified by the Dest field (37-5), is an index into the 4D mask image. Thus the output of executing an algorithm is a 4D image consisting of the resulting 3D volume images from the individual equation operations.
In order to generate a mask, an algorithm must first be specified in the Algorithm (37-2) list. By pressing one of the six Category choices (37-4), the corresponding operators are displayed in the Operation choice (37-9), as listed in Table 8. Dependent on the operator selected, a group of widgets are displayed (37-6) for specifying the required operands. The following subsections detail the operators and operands.
Table 8: Mask Operator categories
Once the operator and associated operands have been specified, an equation can be entered into the Algorithm list (37-2) using one of the menu items under the Insert Op button (37-3). The four menu items allow for insertion into the algorithm list at the Top, Bottom and Before or After the currently selected equation. Similarly, the Delete button (37-11) has two menu items to remove All the equations or just the Selected one. Whenever an equation is selected from the list, its operator and operands are displayed. This makes it convenient to edit the equation by modifying the parameters and pressing the Modify Op button (37-10) to change the equation.
The algorithm equations can be stored as a file by pressing the Save button (37-12) which will popup the file browser (See Section 5). The Load button (37-1) can be used to retrieve previously saved algorithms.
Once an algorithm is specified, pressing the Execute All button (37-8) will initiate its execution. If the ``Last'' option is selected from the Retain choice (37-13), only the last image volume in the mask algorithm will be saved. Otherwise, selecting the ``All'' option will result in all of the image volumes in the mask algorithm being saved. Upon successful execution, the current mask will either be replaced by or appended with the resultant image volume(s) dependent on whether the Append option (37-7) is selected. The mask can be viewed as described in Section 7. Note that the Volume offset field (14-4) and the display range (Display Min (15-3) and Display Max (15-2)) will be set to display the last volume in the 4D image. Mask images are unlike Stim files which have a relatively consistent display range as different volumes are indexed temporally with the Volume offset field (14-4). When different mask volumes are indexed for display, the pixel value ranges can be drastically different. Hence, the display range will often need to be adjusted (See Section 8).