Using Conditions

Condition (Conditions > Condition (If)) is a great tool useful in all sorts of laboratory situations where we define which parameters influence the task execution. Condition tasks need to be defined using expressions (see Using Expressions). For example: If Expression is TRUE, run the contained tasks...

Deciding whether the condition is TRUE or FALSE is called evaluation and it is computed by NIS-Elements on job runtime.

Almost every task produces number of variables which are then available within the System > Expression task.

Condition use case 
Let us show you the usage of an condition on a simple job. We will capture a large image in low resolution and measure its mean intensity. Only if the mean intensity is above the defined threshold (which may indicate that there is something interesting on the scene), we will capture the large image again this time using a high magnification objective.

  1. Create two capture definitions

    Define two Acquisition > Capture Definition tasks, each using a different optical configuration. Assign some simple names to the tasks.

  2. Capture the preview image

    Insert the first Acquisition > Capture task and set it so that it will use the low magnification capture definition - choose the Preview Capture definition from the Using combo box. Since purpose of this task is to decide whether to capture the high-magnification image or not, there is no need to save the images, so leave the Save Image to Database pull-down menu set to Never or Later.

  3. Analysis Definition

    Insert the Analysis > Intensity Analysis task and double-click on it to specify its parameters.

    Because intensity of the whole frame will be measured, just select the Full frame option and click OK.

  4. Conditional Capture

    By now, everything is prepared to make the decision whether to capture the high-resolution image or not. We captured a preview image, measured its intensity and now we can set the resulting value into the Conditions > Condition (If) task and add another Acquisition > Capture task within.

    Specify the conditional expression (Condition). If evaluation (result) of this expression is TRUE (i.e. 1), the capture will be performed. Use the Define button to specify the conditional expression as described in (Using Expressions). The resulting job could look like this: