## Module: Iterate Recipe (
)

### Description:

> This is an experimental module from the Xtra Library: https://xtras.amira-avizo.com.
> This module allows you to run a given recipe while varying a parameter value of any module used inside the recipe in a user-defined way. A list of values can be given explicitly or using a loop specifying start, end, and step-size.

> #### Usage

> - Invoke it by right-clicking on Project View's background, select "Create Object ..." -> "Automation" -> "Xtra" -> "Iterate Recipe".
> - Select the recipe you want to use. Multi-input recipes are supported (up to 9 inputs).
> - The input ports of that recipe will appear. Connect them to appropriate data.
> - Select the name of the module of which you want to vary a port's value. The list of modules is representing the modules used in the recipe.
> - Specify the name of the module's port of which you want to modify the value. Not all ports are supported/displayed.
> - Specify the "Value string": Any occurrence of "$" will be replaced by the current value from the list of values. You can use it to create composite values, e.g. expressions for Arithmetic or filters for Analysis Filter.
> - Choose "List definition".
> - Explicitly: define "Value list", i.e. give a list of values to replace "$" in "Value string". In the case of one-word values, they can be separated by space (" "). In the case of more complex strings, they have to be separated by a comma (",").
> - Loop: the calculated values will replace "$" in "Value string". You can specify values for start, end, and step-size. Only positive step-size is supported. Integer or floating-point values are possible.
> Note: When the selected port is changed, "Value list" will be re-initialized using the port value taken from the original recipe, and "List definition" is switching back to "explicitly".
> - Press "Apply". The recipe will be run repeatedly with the values taken from the list of values. The results will be created in Project View. The respective value will be appended to the result's name.

> Note: Not all ports of all modules are supported, only those which set values using either "setValue", "setIndex", or "setState" are supported. (Ports are excluded if they are in the "ignore_list" - see in the pyscro in the "def update(self):" section).

### Connections:

> Input1 `[required]`
> Connect here the data-set you want to connect to the first input port of the recipe.
> This port will appear after the recipe is connected. Its label will be taken from the recipe.

> Input2 .. Input9 `[optional]`
> If the recipe has multiple input ports, the necessary number of connections will appear (max. 9). Their labels will be taken from the recipe.

### Ports:

> Recipe
> Connect the .hxrecipe file here. Once it is connected, the required data connections (inputs) will be shown.

> Module
> Select the module you want to modify a parameter of. The selector will be filled once the recipe has been loaded. The names of the modules are read from the recipe.

> Port
> Select the port of the selected module you want to change the value of. The selector will be filled once the module-name has been selected. Only a selection of all existing ports is supported.

> Note: A port with several entries will be repeated in the list as many times as its number of entries. Each occurence of the port will correspond to an entry. For example, the Resolution port has 3 entries (one per space dimension) and so would be listed 3 times.

> Value string
> Any occurrence of "$" in this string will be replaced by the current value from the list of values, and the resulting string will be used while executing the recipe.

> List definition
> You can choose if you want to give an explicit list of values or use a loop defined by values for start, end, and step-size.

> Value list
> Specify the list of values to be used for the repeated runs of the recipe.
> When a different port is selected, "Value list" will be initialized with its value from the recipe.
> If the list is given explicitly, single-word values can be separated by space, while more complex string values have to be separated by comma (",").

> Loop start, end, step
> If "loop" has been chosen in "List definition", the values iterated over are calculated using the loop definition (start, end, step-size). The values can be of integer or float type. Only positive step-sizes are supported.