FieldIterator

MacroModule
genre Fields
author MeVis Medical Solutions AG
package MeVisLab/Standard
definition helpers.def
see also SettingsManager, FileDirectory, IdleTrigger
keywords Fields, list, sequence, iteration, batch

Purpose

The module FieldIterator iterates through a list of field values and successively assigns these values to a collection of specified fields in a network.

It works similar to the SettingsManager module, except that the field values are taken from a list which is processed sequentially. The iteration through the list can be either controlled interactively or automatically using a timer delay.

The FieldIterator can be used to batch process a number of images, or to perform an operation for a list of parameter values and store the results in different output image files.

Usage

The field value list and the target fields are specified using the parameter fields in the Field Values panel. The string in the Field Values field contains a list of entries separated by a Value Separator expression.

Each value entry is itself a list of individual field values separated by a Field Separator expression.

During the iteration through the list, the value list entries are processed one at a time, the individual field values in each value entry are assigned to the fields in the Field Names list (also separated by a Field Separator expression), and the New Value field is triggered (on the Main panel).

The list iteration is controlled through the fields and controls on the Main panel. The Value Selection section fields and controls are used to select the current value entry (using the Current Index field) or to manually proceed to the next or previous entry (by pressing the Next or Previous button). After a new set of values has been selected, and if the Enable option is checked, the New Value field is triggered. If this field is connected to some other field in a network, an automatic processing sequence can be started.

If the Loop option is activated, the iteration continues with the first entry as soon as the end of the list is reached.

Setting the* Current Index* to -1 puts the FieldIterator in a “waiting” position, prepared to start with the first value list entry when Next or Start is pressed. This can also be achieved by pressing Reset.

The fields in the Automatic Iteration section control the timer controlled iteration through the value list. The Timer Delay field specifies the time delay between the completion of one list entry and the proceeding to the next.

Details

The Field Separator and Value Separator fields in the Field Values panel contain regular expressions which are used to decompose the value list in list entries and individual field values.

If the Use field values header line option in the Field Values panel is checked, the first entry in the Field Values list is interpreted as the list of target field names, overriding the Field Names parameter.

Windows

Default Panel

../../../Modules/Macros/Helpers/mhelp/Images/Screenshots/FieldIterator._default.png

Parameter Fields

Field Index

Auto Reset: Bool Last: Trigger Start: Trigger
Current Index: Integer Loop: Bool Stop: Trigger
Current Values: String maxIndex: Integer Timer Delay: Float
Enable: Bool minIndex: Integer Use field values header line: Bool
Field Names: String New Value: Trigger Value Separator: String
Field Separator: String Next: Trigger Values: Integer
Field Values: String Previous: Trigger Verbose: Bool
First: Trigger Reset: Trigger  
indexTranslation: Integer Running: Bool  

Visible Fields

Field Names

name: fieldNames, type: String

Sets a list of target fields, separated by a Field Separator expression.

Field Values

name: fieldValues, type: String

Sets a list of value entries separated by a Value Separator expression.

Each value entry is itself a list of field values separated by a Field Separator expression. On each iteration step, the field values in the current entry are assigned to the corresponding target fields.

Field Separator

name: fieldSeparator, type: String, default: [,;]

Sets a regular expression specifying how individual field values are separated.

Value Separator

name: valueSeparator, type: String, default: \n\r|\r\n|[\n\r\\]

Sets a regular expression specifying how the value entries in the list are separated.

Use field values header line

name: valueHeader, type: Bool, default: FALSE

If checked, the first entry in the value list defines the target fields, overriding the contents of the Field Names field.

Values

name: numValues, type: Integer, persistent: no

Shows the number of values in the list of Field Values.

Current Values

name: curValue, type: String, persistent: no

Shows the currently active value(s).

First

name: firstValue, type: Trigger

If pressed, the iterator selects the first entry.

Last

name: lastValue, type: Trigger

If pressed, the iterator selects the last entry.

Reset

name: reset, type: Trigger

If pressed, the iterator resets to the ‘idle’ position (index = -1).

New Value

name: newValue, type: Trigger

This field is triggered if the option Enable is checked and a new value has been selected and the according field value has been assigned to the target field.

Enable

name: newValueEnable, type: Bool, default: FALSE

If checked, the New Value field can be triggered from within the module.

Verbose

name: verbose, type: Bool, default: FALSE

If checked, a log message is printed to the console.

Current Index

name: curIndex, type: Integer, default: -1, minimum: -1, maximum: :field:`maxIndex`

Sets the index of the currently selected value entry (starting from zero).

An index of -1 specifies an ‘idle’ position from which the iteration may proceed to the first entry.

Start

name: start, type: Trigger

If pressed, the automatic, timer controlled iteration through the list from the currently selected index is started.

Stop

name: stop, type: Trigger

If pressed, the automatic iteration through the list is stopped.

Timer Delay

name: delay, type: Float, default: 1

Sets the delay in seconds between the completion of one value list entry and proceeding to the next.

Running

name: running, type: Bool, persistent: no

Shows if the automatic iteration is in process.

Auto Reset

name: autoReset, type: Bool, default: FALSE

If checked, the module automatically resets after completing one cycle.

Not available if Loop is checked.

Loop

name: loop, type: Bool, default: FALSE

If checked, the iteration proceeds to the beginning if the end of the list has been reached.

Hidden Fields

indexTranslation

name: indexTranslation, type: Integer, default: 0, minimum: 0

minIndex

name: minIndex, type: Integer, persistent: no

maxIndex

name: maxIndex, type: Integer, persistent: no