AUTOMATOR REFERENCE MANUAL

Similar documents
Graphing Reference Manual

X-Y Stage Reference Manual

Openlab and Openlab Darkroom User Reference Manual

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2010

Welcome to Introduction to Microsoft Excel 2010

DataMaster for Windows

Using Microsoft Word. Text Editing

Mach4 CNC Controller Screen Editing Guide Version 1.0

You ll notice at the bottom of the file menu there is a list of recently opened files. You can click a file name in the list to re-open that file.

Windows XP. A Quick Tour of Windows XP Features

Introduction to Windows

Excel Select a template category in the Office.com Templates section. 5. Click the Download button.

Anima-LP. Version 2.1alpha. User's Manual. August 10, 1992

Click Here to Begin OS X. Welcome to the OS X Basics Learning Module.

With ClaroIdeas you can quickly and easily create idea maps using a combination of words, symbols and pictures.

USER GUIDE DESIGN LAYOUTS

COPYRIGHTED MATERIAL. Making Excel More Efficient

Part 1: Basics. Page Sorter:

IMAGE STUDIO LITE. Tutorial Guide Featuring Image Studio Analysis Software Version 3.1

Microsoft How to Series

ABOUT THIS COURSE... 3 ABOUT THIS MANUAL... 4 LESSON 1: MANAGING LISTS... 5

Using Windows 7 Explorer By Len Nasman, Bristol Village Computer Club

Section 6: Dreamweaver

FastTrack Schedule 10. Tutorials. Copyright 2010, AEC Software, Inc. All rights reserved.

TI-SmartView Emulator Software for the TI-84 Plus Family (Windows and Macintosh )

To learn how to use Focus in Pix:

EXCEL BASICS: MICROSOFT OFFICE 2010

AgWare ClickFORMS 7.0 Introductory Tutorial

Chapter 7 Inserting Spreadsheets, Charts, and Other Objects

Building TPS Web Pages with Dreamweaver

OU EDUCATE TRAINING MANUAL

EXCEL BASICS: MICROSOFT OFFICE 2007

KMnet Viewer. User Guide

ARIS Architect QUICK START GUIDE. Version Service Release 7

ECE 202 LAB 1 INTRODUCTION TO LABVIEW

Excel 2016 Basics for Windows

Using Microsoft Excel

FSA Geometry EOC Practice Test Guide

Quick Start Guide. ARIS Architect. Version 9.8 Service Release 2

Introduction to Microsoft Excel 2010

4 TRANSFORMING OBJECTS

The Fundamentals. Document Basics

RenameMan User Guide. ExtraBit Software

Software User's Guide

FSA Algebra 1 EOC Practice Test Guide

In this section you will learn some simple data entry, editing, formatting techniques and some simple formulae. Contents

HOW TO USE THIS MANUAL

Software User's Guide

Keyboard Shortcuts & Hints

Grade 8 FSA Mathematics Practice Test Guide

Ancient Cell Phone Tracing an Object and Drawing with Layers

Screen Designer. The Power of Ultimate Design. 43-TV GLO Issue 2 01/01 UK

Science. Getting Started Guide

Section 3 Formatting

Basic Concepts. Launching MultiAd Creator. To Create an Alias. file://c:\documents and Settings\Gary Horrie\Local Settings\Temp\~hh81F9.

Quark: tech notes - Troubleshooting: System Failures and Unexpected Quits in QuarkXPress (Mac OS)

EE261 Computer Project 1: Using Mentor Graphics for Digital Simulation

On the Web sun.com/aboutsun/comm_invest STAROFFICE 8 DRAW

Contents. Foreword. Examples of GeoGebra Applet Construction 1 A Straight Line Graph... 1 A Quadratic Graph... 6 The Scalar Product...

FSA Algebra 1 EOC Practice Test Guide

Excel 2016 Basics for Mac

WINDOWS NT BASICS

Add Photo Mounts To A Photo With Photoshop Part 1

NETWORK PRINT MONITOR User Guide

User Guide. Web Intelligence Rich Client. Business Objects 4.1

CPM-200 User Guide For Lighthouse for MAX

DDDA User Guide Version 1.5

Excel Macros, Links and Other Good Stuff

Excel 2007 Fundamentals

AppleWorks Tips & Tricks

Part 1: Understanding Windows XP Basics

Introduction to Microsoft Windows

Microsoft Word 2007 on Windows

This is a structured tutorial demonstrating the features of the GEdit system. The tutorial guides the designer through three structured examples.

Optimizing ImmuNet. In this chapter: Optimizing Browser Performance Running Reports with Adobe Acrobat Reader Efficient Screen Navigation

MagniLink imax. User Manual. Version User Manual d MagniLink imax 1

Software User's Guide

v SMS 11.1 Tutorial Overview Time minutes

Cmpt 101 Lab 1 - Outline

Computer Project: Getting Started with MATLAB

KIMOTO K I M O S E T T E R R I P. Kimosetter RIP User Guide 1. Revised: February 2015 U SER GUID E (FOR W INDOWS 7 )

Learning Worksheet Fundamentals

2. Write Your Test Questions & Create Interactions Page 12

Cloze Wizard Version 2.0

Stamina Software Pty Ltd. TRAINING MANUAL Viságe BIT VIEWER

Designer Reference 1

Contents. Launching Word

SketchUp Tool Basics

Graphical User Interface Canvas Frame Event structure Platform-free GUI operations Operator << Operator >> Operator = Operator ~ Operator + Operator

Microsoft Excel 2007

Boardmaker 5.0 (Macintosh) Creating a Story Response Board. Introduction. Case Study. Learning Objectives

PUB. DIE A. Canon XF Utility. Instruction Manual. Macintosh. Version 1.2

Word 2013 Quick Start Guide

SQL Studio (BC) HELP.BCDBADASQL_72. Release 4.6C

Horizon Launcher Configuration Guide

Microsoft Access XP (2002) Reports

MICROSOFT OFFICE. Courseware: Exam: Sample Only EXCEL 2016 CORE. Certification Guide

Creating a Spreadsheet by Using Excel

Introduction to Microsoft Publisher

Transcription:

AUTOMATOR REFERENCE MANUAL Improvision, Viscount Centre II, University of Warwick Science Park, Millburn Hill Road, Coventry, CV4 7HS Tel: +44 (0) 24 7669 2229 Fax: +44 (0) 24 7669 0091 e-mail: admin@improvision.com Internet: http://www.improvision.com

Printing History Document Edition Software Version Date Edition 1 June 1996 Edition 2 August 1996 Edition 3 April 1997 Edition 4 December 1997 Edition 5 Openlab 2 September 1998 Edition 6 Openlab 3 February 2001 Improvision believes the information in this manual to be correct at the date of issue. However, it is subject to change at any time and does not represent a commitment on the part of Improvision. Improvision shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this manual. Improvision has a policy of continual development and reserves the right to change information within this manual without notice to reflect changes in the system's design and specification. 1996-2001 Improvision, Image Processing & Vision Company Limited. All rights reserved. Copyright Notice Apple, Finder and Macintosh are registered trademarks of Apple Computer, Inc. Other brands or product names are the trademarks of their respective holders.

THE AUTOMATOR The Automator Overview The Automator is a visual programming language which allows you to create a schedule of tasks which you can then run automatically. This schedule is known as an automation. You use the Automator icons to build up a picture of the task flow in the Automator Window, and then link the icons together to define the sequence for the automation. The Automator combines the visual clarity of a flowchart for planning and structuring the sequence of an automation, with the power of a programming language for implementing the automation and controlling the task flow. The Automator is available as an additional menu command in the Openlab menu bar. There are two versions of the Automator: Automator Lite, which supports all the Openlab core modules but does not allow you to use variables when creating automations. Automator Lite is provided with the full Openlab software and is documented in Section 4 of the Openlab User Reference Guide. Automator, which provides the same features as Automator Lite plus full support for variables. This makes it much more powerful than Automator Lite. The Automator is a separate module, which must be purchased separately. This is the reference guide for the full Automator. You can ignore Section 4 of the Openlab User Reference Guide. This guide covers the same information and has been expanded to provide information and examples about using variables. The guide is split into two main parts: the Automator Tutorial and the Automator Reference Manual. We recommend that you browse both sections before writing automations. The Automator Tutorial is for new users. It provides step-by step examples of working with the Automator. The Automator Reference Manual contains reference material and troubleshooting information. You will find it useful once you start to create your own automations. Updated February 2001 3

OPENLAB Contents The Automator...3 Overview...3 Automator Tutorial...7 Overview...7 The Automator Window...8 Creating Simple Sequences - Tutorial 1...10 Adding a Delay Task -Tutorial 2...16 Creating a Loop - Tutorial 3...18 Variables...21 Creating a Loop - Tutorial 4...23 Expressions...25 Creating an If task...27 Tutorial 5...29 The Variables Window...32 Variable Controls Palette...35 Automator Reference...43 Overview...43 Guidelines on Creating an Automation...44 The Automator Window...44 Creating automations...44 Saving automations...45 Working with links...45 Working with variables...46 Working with array variables...47 Working with expressions...54 4 Openlab Version 3

CONTENTS Task Setup Dialogs... 56 Overview... 56 Essential tasks... 57 Extra tasks... 63 Window Targeting Tasks... 73 File Tasks... 74 Layer Selection Tasks... 76 Layer Tasks... 79 Filter Tasks... 87 IP Tasks... 89 State Saver Tasks... 93 User Notes Task... 94 Clipboard Tasks... 95 Video Manager Tasks... 102 Density Calibration... 109 Image Arithmetic... 110 Binary Operation Tasks... 113 Linear Interpolation Task... 116 Automator menu commands... 117 Overview... 117 Automator menu... 117 View menu commands... 118 Options menu commands... 118 Trace menu commands... 119 Label menu commands... 120 Operators for Automator Expressions... 121 Number variables... 121 String variables... 124 Questions and Answers... 125 Updated February 2001 5

OPENLAB Trace Messages...127 General messages...127 Task-specific messages...130 Index...133 6 Openlab Version 3

AUTOMATOR TUTORIAL Automator Tutorial Overview The tutorial describes the Automator and includes simple examples of working with the standard Automator tasks. These examples also illustrate the basic concepts behind the major programming features. If you are new to the Automator, we recommend that you work through this section sequentially. If you are already familiar with programming concepts, you may like to miss out some of the sections which explain terminology. The Tutorial part of this manual includes: A description of the Automator Window. How to run a simple sequence of tasks. How to create a loop to repeat a sequence of tasks for a defined number of times. A detailed explanation of Variables. How to create a loop using a loop count variable. A detailed explanation of Expressions - you will already have seen how to use these in the automation examples. How to create If tasks. A description of the Variables Window. A description of the Variable Controls Palette. Updated February 2001 7

OPENLAB The Automator Window Select New Automation from the Automator menu. The Automator Window is displayed. Local menu bar Control buttons Task list Trace area Click to expand task group Option click to expand all task groups Click and drag to increase/decrease work area Work area Task information area Trace Area This is the section of the Automator Window where trace messages are displayed. Trace messages enable you to keep track of the progress of an automation when you run it. They are particularly useful when you are creating an automation and need to be able to test that it is working correctly. You can trace different aspects of your automation, depending upon its complexity. You select Trace options from the Trace menu. Work Area This is the section of the Automator Window where you create your automation. See the next section for step-by-step instructions on creating an automation. 8 Openlab Version 3

AUTOMATOR TUTORIAL Task List These are the tasks that you can include in your automation. You create an automation by dragging tasks from the Task List, dropping them onto the Automator Window and linking them together. See the next section for step-by-step instructions. For ease of use and to make the best use of the available display area, tasks are displayed in the Task List under task groups. You can expand or collapse the group by clicking on. Note: Option-click expands or collapses all task groups. You can also use the commands under the View menu. Some tasks are general, others are linked to specific modules, such as the Microscope or Filter Assembly modules. If you have not purchased the module, the tasks will not appear in the Task List. We describe the standard tasks in this manual. Module-specific tasks are described in the manual which accompanies the module. Control buttons The control buttons allow you to run the automation. They work in the same way as a video recorder, allowing you to run, stop, pause and step through an automation. Runs the automation Stops the automation Pauses the automation Steps through the automation, task by task Task information area Once you have moved a task from the Task List to the Automator Window, you can rename it. However, you may still need to know the original name of the task. Move the pointer over the task icon in the Automator Window. The Task Information area displays the original name of the task, as it appears in the Task List. Local menus The local menus are described in detail in the Reference section of this manual. For the most part they provide commands which control how information is displayed in the three main display areas of the Automator Window: the Task List, the Work Area and the Trace Area. There is also a menu which provides various commands for adding and editing labels in the Automator Window. Updated February 2001 9

OPENLAB Creating Simple Sequences - Tutorial 1 The example in this section illustrates how you can use the Automator to create an automation which consists of a simple sequence of tasks. When you run the automation, each task will be completed one after the other. We will build up the example gradually. Initially we will concentrate on displaying an alert message and speaking the text of the message. Then we will add a time delay before the message is spoken. The description will consist of several stages: Stage 1 assembles the tasks required to display and speak a message in the Automator Window. Stage 2 sets up the contents of the message. Stage 3 links the tasks. Stage 4 saves the automation. Stage 5 runs the automation and checks the contents of the Trace Area. Stage 6 adds a delay task to the automation. We recommend that you follow the instructions described below to create the automation yourself on your Macintosh. 10 Openlab Version 3

AUTOMATOR TUTORIAL Assembling the tasks 1. 2. 3. Select New Automation from the Automator menu. Make sure that the Essential tasks are displayed. (Click on.) Click and hold on the Start task. Drag and drop it onto the Automator Window. Note: When you first move a task into the window, the task s icon is split down the middle. This indicates that it has yet not been linked to another task. 4. Make sure that the Extras tasks are displayed. Click and hold on the Tell task. Drag and drop it onto the Automator Window. Note: Look at the border of the Work Area as you move the icon across from the Task List. You should notice a gray highlight. 5. Click and hold on the End task. Drag and drop it onto the Automator Window. 6. You have now assembled all the tasks. Look at the task icons in the Automator Window. Each one has a jagged line through the middle of it. This indicates that the task has not yet been linked to another one. Updated February 2001 11

OPENLAB Setting up the message content 1. Double-click on the Tell icon to display the Tell Setup dialog. Expression box Start typing here (between the quotation marks) Message display check boxes 2. 3. Click on OK to save the setup Type the following text into the Expression box, so that it is enclosed within the quotation marks: Welcome to the Openlab Automator! We want the message to be displayed in an alert box, and we want the Macintosh to speak the message. Make sure that the In an alert and Actually say it boxes are checked. Your setup dialog should now look as follows: Note: If the Speech Manager is missing from the operating system, the Actually say it feature will be disabled. See page 65 for more information about non-modal alerts. 4. Click on OK to save the setup. 12 Openlab Version 3

AUTOMATOR TUTORIAL Linking the tasks 1. 2. 3. Hold down the Option key and click on the Start icon. It is highlighted. Drag the pointer across to the Tell icon. As you do so, you will notice that you are dragging a line between the two icons. The arrow indicates the direction of the sequence. When both the Start and the Tell icons are highlighted, release the mouse. 4. 5. Look at the Start icon. It is no longer split in half. This is because the link for the Start task is complete. The links to the Tell task, on the other hand, are not complete. The jagged line remains through the icon. Hold down the Option key and click on the Tell icon so that it is highlighted. Drag the pointer across to the End icon. The links for all the tasks are now complete. Look at the icons, there should be no jagged lines. Updated February 2001 13

OPENLAB Saving the automation 1. Select Save from the File menu. Enter a name for the automation file in the Save File As: box, and select a different folder, if required. 2. Click on the Save button. Note: We are only creating a very simple automation. If you have a complex automation, make sure that you save it at regular intervals, while you are creating it. Don t wait until you are ready to run it! To open a saved file 1. Select Open... from the File menu. 2. Select the required automation file and click on the Open button. 14 Openlab Version 3

AUTOMATOR TUTORIAL Running the automation 1. 2. Click on the Run Control button. The Automation will run quite quickly, but will stop when it displays the Tell message. This is because we checked the In an alert box. The Macintosh convention is that it will wait for an alert message to be acknowledged before it allows the application to continue. 3. 4. Click on OK to acknowledge the message and allow the automation to complete. You may like to repeat the automation a few times and look out for the following features: As each task is run, the task icon is highlighted with a gray border in the Automator Window. The icon in the top right-hand corner of the Automator Window is animated until the automation finishes. As each task is run, you will see various messages appearing in the Trace Area. 5. You may also like to experiment with the Stop, Pause and Step Control buttons. Updated February 2001 15

OPENLAB Adding a Delay Task -Tutorial 2 1. Click and hold on the Delay task. Drag and drop it onto the Automator Window, just above the link joining the Start task to the Tell task. 2. Double-click on the Delay icon to display its setup dialog. Type in the number of seconds here Select when the delay is counted from Click on OK to save the setup Note: The delay task also allows you to put the remaining time into a variable to which you can then assign a variable control, such as the Digital Clock. In this way, you can easily track remaining time during an automations. See page 46 for further details. 3. 4. Type 5 into the Expression box and click on OK to save the setup. Double-click on the Tell icon and change the message so that it only appears in an alert, and it reads: This automation waits 5 seconds before displaying this alert box. 16 Openlab Version 3

AUTOMATOR TUTORIAL 5. Click once on the link between the Start and the Tell icon. It is highlighted in red. 6. 7. 8. 9. Click on the Delete key or the Backspace key to remove the link. Notice what happens to the Start and Tell icons as you select the link and delete it. Hold down the Option key and click on the Start icon. Drag the pointer across to the Delay icon and release it. Repeat to drag a link between the Delay icon and the Tell icon. You have now completed the automation, but you may like to tidy up the window before you run the automation. Click and hold on the Delay icon, and move the icon down so that it lines up with the other icons. Notice how the Automator retains the links as you move the icon. 10. Save the amended automation to a different file and click on the Run Control button to run it. Updated February 2001 17

OPENLAB Creating a Loop - Tutorial 3 Loop sequences are extremely useful if you have a task, or series of tasks, which must be repeated several times. You need to know exactly how many times the tasks are to be repeated. Loop icon The loop icon is different to the other icons we have looked at so far, because you need to create two links from it. One link loops back to the task that is to be repeated. The second link exits the loop and continues with the rest of the task flow. Option-click here for link that enters loop Option-click here for link that exits loop Tutorial 3 In this example we are going to build on our simple sequence, so that the alert message is shown three times. We are also going to change the text of the message and include it in the trace. 18 Openlab Version 3

AUTOMATOR TUTORIAL 1. Click and hold on the Loop task. Drag and drop it onto the Automator Window, just above the link joining the Start task to the Delay task. Note: The Loop task must be at the beginning of the loop sequence. 2. 3. Double-click on the Loop icon to display its Setup dialog. Type 3 into the Expression box and click on OK to save the setup. 4. Double-click on the Tell icon and amend its setup so that the message appears in an alert and in the trace, and it reads: This alert will be shown 3 times. Updated February 2001 19

OPENLAB 5. 6. Delete the link between the Start and the Delay icon, and between the Tell and the End icon. Create a link between the Start and the Loop icon, and between the Loop and the Delay icon. Make sure that you select the correct part of the Loop icon for the loop link. (Note how the pointer changes to indicate which link you are creating.) Option-click here for link that enters loop Option-click here for link that exits loop 7. 8. Create a link between the Tell and the Loop icon. This completes the loop. Create the exit link from the loop by connecting the Loop icon to the End icon. Make sure that you select the correct part of the Loop icon for the exit link. Note: The arrows on the links indicate whether this is a loop or an exit link. 9. Save the amended automation to a different file and click on the Run Control button to run it. Notice the messages that appear in the Trace Area. 20 Openlab Version 3

AUTOMATOR TUTORIAL Variables In our previous example, our message tells us how many loops the automation will execute. It would be useful sometimes if the message also told us which loop the automation was currently executing. This is quite simple to achieve. The Automator keeps a count of the loops, and you can ask it to put the loop count into what is known as a variable. What are variables? Variables are a powerful feature of all programming languages. They allow you to set aside a storage area in the computer s memory to hold a value, which you know will change. The simplest example is a counter which is incremented, or decremented, each time a particular action takes place. However, the contents of a variable are not restricted to numerical values; you can use them to store text strings as well. In future you will also be able to use them to store images and graphs. You may like to think of variables in terms of a series of storage boxes. Each box has a name and a type. The name is unique, but there may be several boxes of the same type. There is only ever one item in the box at any given time, but the value of that item may change many times during the course of an automation, as different tasks use or replace the contents of the variable. Name: Result Type: Number Name: x Type: Number Name: Loopcount Type: Number Name: Message Type: String Name: Experiment1 Type: Image Name: Analysis1 Type: Graph Updated February 2001 21

OPENLAB The simplest way to create a variable is to click on the Create New Variable button from any of the Setup dialogs which allow you to enter an expression. This is illustrated in the next tutorial where we create a loopcount variable so that we can keep track of how many times the loop has been completed. Note: Openlab also supports array variables for sets of related values. See page 47 for more information about creating array variables and an example automation. Once you have created a variable, Openlab provides you with various options for monitoring it. For example, you can opt to trace variables so that they appear in the Trace Area. You can also use the Variables Window or the Variables Control Palette to control and edit variables when an automation is running. These options are described in the Variables Window and the Variable Controls Palette sections at the end of this tutorial. 22 Openlab Version 3

AUTOMATOR TUTORIAL Creating a Loop - Tutorial 4 We are now going to amend the Loop and the Tell Setups so that the automation displays its current position in the loop. We do this by creating a Loopcount variable. The Loop task puts the loop count into the Loopcount variable, updating the value at the start of each loop, and the Tell task reads the current value of the variable and includes it in its message. You will also notice some changes to the way that we type in the message for the Tell task. This is because we are combining a text string with a numerical variable, and we need to make sure that the Automator is aware of this. The Automator is like all programming languages, there are various syntax rules which you must follow. These are described in more detail when we talk about Expressions in the next section. Setting up the Loop task 1. Double-click on the Loop icon to display its Setup dialog. 2. Click on the New Variable button to display the New Variable dialog. Type in variable name Click and select variable type Click on Create. The variable is added to pop-up menus 3. Enter the name loopcount for the variable in the Name: box. Note: Variable names must contain no spaces and must start with a letter. The name may contain a mixture of letters, numbers and the underscore (_) character. 4. Select the type number for the variable from the Type: pop-up menu. Updated February 2001 23

OPENLAB 5. Click on Create to create the variable and close the New Variable dialog. 6. You are now back at the Loop Setup dialog. Check the Put the loop count into box. 7. Notice how the pop-up menu becomes active. Select loopcount from the pop-up menu. 8. Click on OK to save the Loop Setup. Setting up the Tell task 1. Double-click on the Tell icon and amend its setup so that the message reads: "This alert will be shown 3 times. This is number "+ str(loopcount)+"." Note: The syntax for the message is explained on page 25. 2. Click on OK to save the Loop Setup. 3. Save the amended automation to a new file. 4. Click on the Run Control button to run it. Notice how the Tell message changes on each loop. 24 Openlab Version 3

AUTOMATOR TUTORIAL Expressions You will have noticed the term Expression box, as you worked through the examples. These are simply areas on a Setup dialog where you can type in an expression. The rules for constructing an expression are based upon BASIC syntax. If you are familiar with programming in BASIC, you may like to miss out this section and go straight to the next tutorial. Constructing an expression An expression may be built up from literals and variables. A literal is: A number which is written as a number, for example 10. A string which is enclosed in quotation marks, for example "hello". You may also include operators in your expressions. These may be simple arithmetic operators, such as add, subtract, divide (written as /) or multiply (written as *). Functions are also operators, for example sin() if you want to find the sine of an angle. The following examples may help illustrate how to use literals and the two types of operators within an expression. Expression Result 1 + 5 6 This adds two numbers. "Hello " + "world" Hello world This concatenates two strings. "This is number " + str(5) This is number 5 This tells the Automator to treat 5 as a string and concatenates the two strings. "This is number " + str(5) + "." This is number 5. (This is similar to the previous example, but note the syntax for the full stop.) 5 + "items are required." NAN (the result of this expression was not a number) The Automator cannot evaluate this expression because you have tried to add a string to a number. It should be: str(5) + "items are required." Updated February 2001 25

OPENLAB Arithmetic operators operate on the two elements, each side of the operator. For example, + can be used to add two numbers or to concatenate two strings. Functions operate on the next element which is enclosed in brackets, for example str(5). There is a wide range of operators that you can use within your Openlab expressions. These are described in more detail on page 121. As you become more confident about using the Automator, you will find that the Expression boxes provide you with a great deal of flexibility, particularly when you include variables within the expressions. For example, we created a fixed time delay in our examples. If we had used a variable instead of a number in the expression, we could have changed the value of the variable on each loop, thereby varying the length of the time delay. Similarly, you will be able to use variables to good effect when you run the Automator with some of the other modules. For example: If you have the FilterWheel module, you can use a variable within a Loop sequence to select a different filterwheel on each loop. If you have the Video Control module, you can use the Automator to capture a sequence of frames and set up a variable to control the number of frames captured at different times in an experiment. 26 Openlab Version 3

AUTOMATOR TUTORIAL Creating an If task The If task supports two links: a True link and a False link. These links allow you to split the task flow within an automation into two paths. Option-click here for True link Option-click here for False link You enable the Automator to choose which path to follow, by creating a statement which compares two expressions. For example, are the two expressions equal? Is one greater than the other? The comparison returns either a True or a False result. If the result is True, the Automator follows the True link(s). If the result is False, the Automator follows the False link(s). The If task is clearly linked with variables. If the values of your expressions are never going to change, then there is no point comparing them. Also, because you are asking the Automator to compare values, you must make sure that the variables always contains sensible values. You may need to assign an initial value to the variable before you execute the If task. If Setup dialog You create the statement from the If Setup dialog. Type the two things to compare: one in each expression box Click and select comparison operator from pop-up menu The expressions may be as simple or as complex, as you require. For example, if you have two variables, x and y, and you want to compare whether they are equal: Select x from the pop-up menu in the first expression box. Select y from the pop-up menu in the second expression box. Updated February 2001 27

OPENLAB Select = from the operator pop-up list. This creates the statement : x = y. In the next tutorial, we are going to include an If task in the loop sequence, so that we can check whether the current loopcount value is an odd number or an even number. In order to do this, we need to use some additional operators in one of the expressions, so that it reads: floor(loopcount/2) * 2. The Automator processes this expression as follows: Divide the loopcount by 2. loopcount/2 Round the result down to the nearest whole number. floor() Multiply the result by 2. *2 We can then compare the result with the original loopcount and see if the two values are equal. To do this, we create the statement: floor(loopcount/2) * 2 = loopcount If the statement is true, we have an even number and the True link will lead to a Tell task which displays the message: "The loop count number is even. This is loop <number of loop>." If the statement is not true, we have an odd number and the False link will lead to a Tell task which displays the message: "The loop count number is odd. This is loop <number of loop>." Note: If tasks and Loop sequences can often be used to perform the same function, for example: Loop - Repeat a task 3 times and then do something else. If - Create a counter, perform a task, update the counter and check how many times the task has been completed. If the value is greater than 3, do something else. If you are not confident about working with variables, it s always worth checking whether you can achieve the same result with a Loop task. 28 Openlab Version 3

AUTOMATOR TUTORIAL Tutorial 5 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. We are going to add an introductory message, explaining what will happen during the loop. Delete the link between the Start and the Loop icon. Drag a Tell icon across to the Automator Window and double-click on it to display its Setup dialog. Add the following message: "This loop will execute three times. On each loop it will display the loop count and state whether the loop count number is odd or even." Rename the Tell task so that it is called Intro Message. Delete the links between the Delay icon and the Tell icon, and between the Tell icon and the Loop icon. Drag an If icon across to the Automator Window and position it after the Delay icon. Double-click on the icon to display its Setup dialog. Create the first expression to read: floor(loopcount/2) * 2 = loopcount Choose the = criterion. Create the second expression to read: loopcount Updated February 2001 29

OPENLAB 11. Double-click on the existing Tell task to display its Setup dialog and edit it to read: 12. 13. Click on OK and rename the Tell task to Odd Message. Make a copy of the Tell task and edit the message to read: "The loop count number is even. This is loop " +str(loopcount)+"." 14. 15. 16. 17. Click on OK and rename the Tell task to Even Message. Use Option-click to select the True link on the If task and link it to the Even Message Tell task. Use Option-click to select the False link on the If task and link it to the Odd Message Tell task. Link both the Odd and the Even Message Tell tasks to the Loop task. 30 Openlab Version 3

AUTOMATOR TUTORIAL 18. Tidy up the Automator Window, so that it looks something like the following: 19. Save the automation and run it. Updated February 2001 31

OPENLAB The Variables Window Whenever you create a new automation, Openlab also creates a Variables Window for the automation. This window allows you to monitor, edit and control all variables in your automation. When an automation is running, you will be able to see how the values of the variables are changing. You can edit the variable name, type and value. You can create and delete variables. To view the Variables Window You can see which windows are available from the Windows menu. Select the required Variables Window from the pop-up menu to display it. You can also select Variables Window from the Automator s View menu. This always displays the Variables Window that is appropriate to the current automation. 32 Openlab Version 3

AUTOMATOR TUTORIAL To create variables 1. Click on the New button to add a new variable to the list in the Variables Window. Note: Openlab also supports array variables for sets of related values. See page 47 for more information about creating array variables and an example automation. 2. You can now edit the variable s name and value, and change its type. To edit the variable's name 1. Double-click on the name section of the required entry to highlight it. 2. Overtype the name to change it. (You can also use the standard Cut and Paste commands from the Edit menu.) Updated February 2001 33

OPENLAB To edit the variable's value 1. Double-click on the value section of the required entry to highlight it. 2. Overtype the value to change it. (You can also use the standard Cut and Paste commands from the Edit menu.) To delete variables 1. Click on an entry to highlight it. 2. Click on the Delete button to delete it. (Or use the Backspace key, or the File menu Clear command.) To change the variable's type 1. Click on an entry to highlight it. 2. Click on Change Type to display a new dialog. 34 Openlab Version 3

AUTOMATOR TUTORIAL Note: You can also double-click on the type section of the required entry to display the Change variable type dialog. 3. Select the new type from the pop-up menu and click on OK. Variable Controls Palette The Variable Controls Palette allows you to assign controls to variables, so that you can monitor and control the values directly from the palette. For example, if you have set up a variable that controls a delay task, you can change the delay time as the automation runs by changing the value of the variable. click on New button to create controls name of automation To assign a control 1. Click on the New button. 2. Select the variable from the Control the variable: pop-up menu. 3. Select a type of control from the Using a: pop-up menu. Updated February 2001 35

OPENLAB When you run the automation, the variable control changes automatically when the value of the variable changes during the automation. It gives you an idea of how often the value of the variable is changing, and you can always see the current, exact value of the variable next to the variable name. To setup a variable control Different types of controls are available. Some only allow you to monitor a variable. Others allow you to interact with the automation. For example, you may be able to toggle a preset value or use the slider control to adjust the value when the automation is running by dragging the slider. All controls have an edit button. Click on this to display a Setup Controller dialog. Different types of control have different setup dialogs; each is described below. drag and drop control onto trash to delete it click on New button to create control edit button 36 Openlab Version 3

AUTOMATOR TUTORIAL To delete a variable control If you need to delete a variable control, just click and drag onto the trash icon at the top of the Variable Controls palette. Slider Control Use the slider control to control and monitor a number variable, such as the number of images captured or loopcount, during an automation. If you select "Live" slider, you will be able to interrupt the automation. 1. Enter the Minimum value and the Maximum value. These values define the range of the slider control, not the variable. 2. Enter a value for the Step size. When you move the slider control, the Automator rounds the value that it displays for the variable to the nearest multiple of the Step size. (When an automation is running, the variable value is always displayed accurately, regardless of the Step size specified in the Setup dialog.) 3. The Extend range automatically box is normally checked. This extends the range of the slider control automatically if the value of the variable moves outside the range that you have specified, and means that you will still be able to use the slider control. 4. The Non-linear scaling box is normally unchecked, but if you want to vary the sensitivity of the slider control, you may like to check it. For example, if your range is from -1 to 1, you may want maximum control around the 0 value. Non-linear scaling will make the slider control more sensitive around the extremes of the scale and less sensitive around the zero value. Updated February 2001 37

OPENLAB 5. The "Live" Slider box allows you to control the value by moving the slider on the Variable Controls palette. 6. Click on OK to save the Setup definition. Digital Display The digital display provides another means of monitoring a number variable during an automation. You cannot edit the variable value. 1. Select the variable to monitor from the pop-up menu. 2. Click on OK to save the Setup definition. Digital Clock The digital clock provides a means of monitoring a time variable during an automation. You cannot edit the variable value. 1. Select the variable to monitor from the pop-up menu. 2. Click on OK to save the Setup definition. 38 Openlab Version 3

AUTOMATOR TUTORIAL Threshold Indicator The threshold indicator control allows you to set up a number variable, so that when the value passes a certain value, an LED lights up on the Variable Controls palette. For example, if you are carrying out ongoing measurements of images, you may interested in knowing when a certain number of images have been captured. 1. Select the variable to monitor from the pop-up menu. 2. Select a display type from the pop-up menu. 3. Enter the required value for the threshold. 4. Click on OK to save the Setup definition. LED Array The Led array control allows you to display number variables as binary and provides up to 8-bit binary (on/off) output signals. For example, the Orbit II has a number of LEDs on the front of the unit. 1. Select the variable to monitor from the pop-up menu. Updated February 2001 39

OPENLAB 2. Select a display type from the pop-up menu. 3. Enable Allow clicking, if you want the user to be able to set the LED status. 4. Click on OK to save the Setup definition. Preset Button The preset button control allows you to set up a button on the Variable Controls palette that you can press to set a variable to a specific value. For example, you could use it in conjunction with an If task that states that if the result of the If expression is not equal to 1, then an image is captured. It provides a way of inputting information into the automation. 1. Select the variable to monitor from the pop-up menu. 2. Enter a preset value. 3. Click on OK to save the Setup definition. Checkbox The checkbox control allows you to set up two preset values and toggle between them For example, you may have an experiment which uses a 10-second delay and a 20- second delay. Once you have set up the variable, you can use the checkbox on the Variable Controls palette to toggle between the two values. 40 Openlab Version 3

AUTOMATOR TUTORIAL 1. Select the variable to monitor from the pop-up menu. 2. Enter a value that will apply when the checkbox is checked. 3. Enter a value that will apply when the checkbox is not checked. 4. Click on OK to save the Setup definition. String The string control provides a useful way of displaying text messages during an automation. For example you may be running an experiment during which a calculation is carried out. You can use the Automator to work out the percentage of green cells at any point in the experiment and display that value using the string text variable control. It provides an alternative to displaying text information in an alert or in the trace. 1. Select the variable to monitor from the pop-up menu. 2. Click on OK to save the Setup definition. Updated February 2001 41

OPENLAB Progress Bar The progress bar control is similar to the slider bar control. It allows you to monitor the progress of an automation but does not allow you to change the value. For example, if you are capturing a Z-series that is within a time lapse (so you would not normally want to change the number of slices), you can use the progress bar to monitor the number of z-slices within a section. You could also use it to monitor a variable that you set from the Delay task (see page 64). This is useful if you want to adjust something within your experiment and need to know you have sufficient time to do so. You cannot edit the variable value. 1. Select the variable to monitor from the pop-up menu. 2. Enter the minimum value (Min:) and the maximum value (Max:). These values define the range of the slider control, not the variable. 3. Click on OK to save the Setup definition. 42 Openlab Version 3

AUTOMATOR REFERENCE Automator Reference Overview This is the Reference section of the Automator Manual. It includes the following sections: Guidelines on creating an automation. Setup tasks. Automator menus. A summary of operators for Automator expressions. Troubleshooting information. Updated February 2001 43

OPENLAB Guidelines on Creating an Automation Refer to the Tutorial section of this manual for step-by-step instructions on creating an automation. This section summarises the main features that were described in the tutorial. You may like to use it as a quick reference tool. The Automator Window Local menu bar Control buttons Task list Trace area Click to expand task group Option click to expand all task groups Click and drag to increase/decrease work area Work area Task information area Creating automations 1. Drag tasks from the Task List onto the Work Area. The tasks are represented as icons on the screen. Each automation must contain a Start task and should contain an End task. Most tasks also allow you to define setup parameters. 44 Openlab Version 3

GUIDELINES ON CREATING AN AUTOMATION 2. Set up any parameters that are required for each task, by double-clicking on the task icon to display the Setup dialog. See the Task Setup Dialogs chapter for a more detailed description of the Setup dialogs for each task. 3. Link the tasks together by dragging a line between them. Hold down the Option key and click on an icon. Drag across to the next icon. When both icons are highlighted, release the mouse. A line links the two icons. 4. Use the Control buttons to run your schedule. As an automation is executed, the individual tasks are normally highlighted with a gray border and the animation icon is activated. (Animation may be disabled for better performance, if required. See page 117 for further details.) 5. Use the Trace Area to monitor the automation as it runs. You can also print out the trace, if required. 6. Hold down the Shift key to select more than one task icon. Note: You can rename any of the tasks in your automation. Click on the task name to select it and type in the new name. (You can still see the original name of the task in the Task Information area.) Similarly, you can use most of the Openlab Edit menu commands, for example copy, paste and clear. Saving automations Once you have created an automation you can save it and open it as you would a normal file. If this is an automation that you are likely to run frequently, save it to the Automator Menu Items folder. Any files that you save to this folder will appear as commands at the end of the Automator menu when you restart Openlab. Select the appropriate command in the menu to run the automation automatically. To open the automation without running it immediately, hold down the Option key when you select it. Note: The Automator Menu Items folder is created for you automatically when you install Openlab. Working with links You can move an icon without breaking existing links. The Automator re-arranges the linked icons. Updated February 2001 45

OPENLAB Click once on a link to select it. It is highlighted it in red. Click on the Delete key to remove a highlighted link. You can also use backspace or Clear from the Openlab Edit menu. Double-click on a link to select the tasks at either end of the link. Triple-click on a link to select all tasks that are logically linked. When you link from an If task, make sure that you click over the right part of the icon to select the True or False section, as appropriate. The pointer changes to indicate which link you are creating. Option-click here for True link Option-click here for False link When you link from a Loop task, make sure that you create a loop link and an exit link. The pointer changes to indicate which link you are creating. Option-click here for link that enters loop Option-click here for link that exits loop Working with variables Variables allow you to set aside a storage area in the computer s memory to hold a value, which you know could change. Within the Openlab Automator, you can use variables for any number of purposes, for example: to set a variable time delay, to specify a number of frames for image acquisition (if you have the Video Control module), to switch to different filters (if you have the Filter Assembly module). You can also create array variables for related sets of unique variables, see next section for an example. The easiest way to create a variable is from the New Variable button on the Setup dialogs, as shown below. (You can also use the New button on the Variables Window.) 46 Openlab Version 3

GUIDELINES ON CREATING AN AUTOMATION Type in variable name Click and select variable type Click on Create. The variable is added to pop-up menus You must use the New Array button on the Variables Window to create array variables. Variables must be assigned a variable type, such as number or string, so that the Automator knows how to handle them. There is a naming convention for variables. They must start with a letter, but the name itself may be a mixture of alphanumeric characters and the underscore (_) character. No spaces are allowed in a variable name. Once you have created a variable, you can include it in any of the Expression boxes that appear in the Setup dialogs. You can also drag and drop a Variable task onto an automation from the Task List. Use the Variables Window and the Variables Control Palette to monitor and edit variables, and to control their values while an automation is running. See the Tutorial for a more detailed description of Variables, the Variables Window and the Variables Control Palette. Working with array variables Openlab also supports array variables for sets of related values. For example, you may have an experiment that uses a Focus Drive and X-Y stage and you wish to capture multiple sample points on well plates. You will set up your experiment to go through the well plates and always look at specific cells. These will have different thicknesses and focal points and may not always be a regular distance apart. Therefore, each sample point requires three variables, X, Y and Z. Creating array variables Use the Variables Window to create the array variables. Updated February 2001 47

OPENLAB 1. Click on the New Array button. 2. Enter a name for the array in the Name: box and a value in the Number of elements: box and select a type from the pop-up menu. Click on OK. 48 Openlab Version 3

GUIDELINES ON CREATING AN AUTOMATION Example automation using array variables Setting up the automation You will need the following variables during the automation. You can either create them from the Variables Window or, as you need them, in the task setup dialogs: a string variable for the layer name:"channel1" number variables for the loop count variables in the three loop tasks and the number of time frames specified by the user in the input task: count, count1, count2 and repeat. array variables for x, y (X-Y stage position) and z (focus drive position) for the Z acquisition data Updated February 2001 49

OPENLAB The automation is set up as follows: The Variable task assigns the channel 1 string value to the layer name. The Target Image Window task targets the top-most window. 50 Openlab Version 3

GUIDELINES ON CREATING AN AUTOMATION The first Loop task sets up the automation to run the tasks that move the X-Y stage and store the position of the X-Y stage and focus drive in the X, Y and Z array variables six times. It puts the loop count in the count variable. The Tell task records the current position of the X-Y stage (using the loop count) in both the trace and as a non-modal alert. The Get Stage Position task puts the current position of X-Y stage into the appropriate part of the array. This is done using the Custom... option in the pull down list of variables. The custom variables here are variables x and y with the count variable from the loop task in square brackets. Updated February 2001 51

OPENLAB The Get Position task puts the current position of the focus drive into the appropriate part of the array. This is done using the Custom... option in the pull down list of variables. The custom variable here is variables z with the count variable from the loop task in square brackets. Once the six focus drive positions have been stored in the z array variable, the loop completes and the Input task asks the user to define the number of time frames. It stores the response in the repeat variable. The next Loop task uses the repeat variable to loop for the number of time frames specified by the user and puts the loop count into the count2 variable. 52 Openlab Version 3

GUIDELINES ON CREATING AN AUTOMATION It is followed immediately by another Loop task that sets up the Z acquisition to run six times and stores the loop count in the count3 variable. The Move X-Y Stage task moves the X-Y Stage to the x, y position (the x and y array variable using the count3 variable from the loop task). The Move To task moves the focus drive to the z position (the z array variable using the count3 variable from the loop task). Updated February 2001 53

OPENLAB The Capture Layer task captures the layer and uses the count2 variable to identify the time frame and the count 3 variable to identify the x, y and z values. Once the Z acquisition has run six times, the loop task completes. The Delay task waits one second and then returns to the second loop task that controls the number of time frames. It repeats the Z acquisition loop until the number of time frames (specified by the user in the Input task) have completed. Working with expressions Most of the Setup dialogs contain expression boxes where you can type in an expression, which may be built from a combination of literals (strings and numbers), variables and operators. Strings must be enclosed in quotation marks: "Hello" Numbers on their own do not require additional syntax: 2 54 Openlab Version 3

GUIDELINES ON CREATING AN AUTOMATION Operators may carry out simple, arithmetic tasks such as add, subtract, divide (written as /) and multiply (written as *). They operate on the two elements each side of the operator, for example 5*6. The + operator can be used to add two numbers or to concatenate two strings. If you want to concatenate a number onto text, you should first convert it to a string: "Hello Number "+ str(2)+ "." Functions are also operators - they operate on the next element which is enclosed in brackets (), for example sin(). When you use the pop-up menu to select a variable in an expression box, you will also see a list of operators that you can use with the variable if you want to build a more complex expression. If an expression contains an error, you will get an error message in the Automator Trace. Refer to page 127 for further details. Refer to page 121 for a complete listing of all Openlab operators. Updated February 2001 55

OPENLAB Task Setup Dialogs Overview Available tasks are displayed in the Task List. Standard task groups include: Essential tasks, which provide the main process control functions for your automation. These are the Start, End, If and Loop tasks. They are also described in some detail in the Tutorial section of this document. Extra tasks, which provide additional process control functions. There are several of these tasks, including the Delay and Tell tasks that are also described in the Tutorial section of this document. The Compact Memory task allows you to optimise and maintain consistent system performance in your automation when you are carrying out memory-intensive tasks. Window tasks, which allow you to define the image window to which a task should be applied. Files tasks, which allow you to carry out standard File operations, such as Save. Layer Selection tasks, which allow you to select Layers by name, type and index position. Layer tasks, which allow you to carry out various Layer operations. IP Tasks, which allow you to merge and subtract layers. Video tasks, which allow you to set up and control a video camera. Density Calibration task, which allows you to apply a predefined calibration to the current layer in the automation. State Saver task, which allows you to restore a lab state that you have previously saved. User Notes task, which allows you add to the notes saved with the image document that is active at the time the notes task is run. Filter tasks, which allow you to apply kernel and median filters. Image Arithmetic tasks, which allow you to apply an arithmetic operation to all pixels in the current layer. 56 Openlab Version 3

TASK SETUP DIALOGS Binary Operations tasks, which allow you to apply a boolean operation to two layers in the current document. Linear Interpolation task, which allows you to apply a linear interpolation between two layers in the current document. You may have other task groups, if you have additional modules installed. For example, if you have the Microscope module, you will have a series of tasks that relate to the functions that are available on the Microscope Palette. These tasks are described in the manual that accompanies the module. This section describes the standard tasks and associated setup options. Double-click on the icon once you have dragged it into the Automator Window to display its Setup dialog. Essential tasks Start Task The Start task marks the beginning of the automation. Every automation must have a Start task. There is no Setup dialog. Updated February 2001 57

OPENLAB End Task Every automation should have an End task. The End task allows you to mark the end of an automation by displaying a message or by playing a sound. The sound is the default system beep. The message is an expression that will be displayed when the task completes and the normal syntax rules apply. If this automation is to be used as a sub-routine, you can also close the automation. See page 75 for more information about sub-routines. Check to play a sound when automation completes Check and type in message for display on completion Check to close automation (used mainly with subroutines 58 Openlab Version 3

TASK SETUP DIALOGS If Task The If task supports two links: a True link and a False link. These links allow you to split the task flow within an automation into two paths. Make sure that you click over the correct part of the icon to select the True or the False link. The pointer changes to indicate which link you have selected. Option-click here for True link Option-click here for False link You enable the Automator to choose which path to follow, by creating a statement in the Setup dialog which compares two expressions. For example, are the two expressions equal? Is one greater than the other? Type the two things to compare: one in each expression box Click and select comparison operator from pop-up menu The comparison returns either a True or a False result. If the result is True, the Automator follows the True link. If the result is False, the Automator follows the False link. You can also group together a selection of If tasks, if you want the Automator to make several comparisons before deciding on the task flow. Multiple If tasks You can set up multiple If tasks if you want to check that: Each of several statements is True - an "And' sequence. Either of two statements is True - an "Or" sequence. You will need to experiment with these sort of constructions, but in general terms the automation in the Automation Window will look similar to the following. Updated February 2001 59

OPENLAB "And" sequence In this sequence the Automator checks whether two If statements are true. If they are, it captures a layer frame and ends, but if either statement is false it displays a message and then ends. "Or" sequence In this sequence the Automator checks whether two If statements are true. It then carries out a second check. If either of these statements is true, it captures a layer frame, otherwise it displays a message and then ends. 60 Openlab Version 3

TASK SETUP DIALOGS Loop Task The Loop task allows you to repeat a sequence of tasks. You use the Setup dialog to define how long you will wait for the loop to complete. A special feature of the Loop setup is the option to put the loop count into a variable. For example, this allows you to use it in a Tell expression and keep track of exactly how many loops the automation has completed so far. Enter an expression for the number of times you want the automation to loop Check and select from pop-up menu to put the loopcount into a variable Make sure that you click over the correct part of the icon to select the loop or the exit link. Option-click here for link that enters loop Option-click here for link that exits loop Updated February 2001 61

OPENLAB The Loop task should be at the start of the loop, in front of the first task in the loop task sequence. If it is not, tasks will execute once too often. The Automator allows you to make two types of link from a Loop task: loop links and exit links. Loop links cause the automation to repeat the tasks that form part of the loop: exit links define which task it should execute when the loop is finished. You will find that Loop tasks tend to form a distinctive pattern in the Automator Window, for example: 62 Openlab Version 3

TASK SETUP DIALOGS Extra tasks Variable Task This task allows you to assign values to variables. You can use it to initialise variables or to assign different values to them at different stages in an automation. The value of the variable only changes when the Variable task is executed. Click and select variable from pop-up menu Enter expression for variable value Updated February 2001 63

OPENLAB Delay Task This task allows you to set a time delay so that your automation waits before going on to the next task. The Setup dialog allows you to specify the delay in seconds (fractions are allowed). You can type in any sensible expression. You also specify whether the delay is since the task started or last finished. You can also put the remaining time into a variable that you can monitor using one of the controls on the Variable Controls palette (see page 35). Type in the number of seconds here Select when the delay is counted from Select variable to store remaining time Click on OK to save the setup 64 Openlab Version 3

TASK SETUP DIALOGS Tell Task The Tell task allows you to show a message in the trace or in an alert box. If you have the Speech Manager installed on your Macintosh, you will also be able to set up the Tell task to actually speak the message. If the automation shows the message in an alert, you can check Use a nonmodal alert, which allows the user to carry out other tasks on the Macintosh while the alert is displayed. For example, the user can work with the image in the Document Window. This is useful if the alert includes an instruction to do something. If you elect to put the message in an alert box, the automation will pause until you click on OK or Continue. This is a standard Macintosh feature with alerts. If the automation speaks the message, you can make it pause and Wait until finished speaking. Type in message expression Displays messages in trace window Displays alert dialog and waits for OK Speaks message (grayed-out if Speech Manager not installed Tell tasks are particularly useful when you create an automation, as they allow you to include comments so that you can check easily whether the automation is running as you expected. Make sure that you apply the correct syntax to message expressions. Text must always be within quotation marks. If you concatenate a number onto a string, you must convert the number to a string. For example: "This is number" +str(5)+ "." This is number 5. Updated February 2001 65

OPENLAB Input Task The Input task allows the user to enter something directly from the keyboard in response to a question that appears on the screen. Use the Setup dialog to enter an expression for the question, select a variable for storing the answer and specify a default answer. (Select Use output variable as default answer, if you want to use the last value entered as the default. If you want to provide a specific default value, select Use this: and enter a default value, as appropriate. ) When the automation is run, it will prompt the user with the question and wait for a response from the keyboard before it continues. Enter the question that the user will see on the screen Select a variable to store the answer Select what the default answer will be Example: In the following example we have set up the Input task to provide a value which we can use as a loop count variable. We have also selected Use this: and provided a default value of 3. 66 Openlab Version 3

TASK SETUP DIALOGS When Openlab reaches the Input task in the automation, it prompts the user as follows: The user can then accept the default, by clicking on OK, or enter a different value and click on OK. Null Task The Null task does nothing. You can use it to tidy up diagrams by putting bends in the links. Updated February 2001 67

OPENLAB Get Automator Time Task This task gets the current time from the automator trace and puts it into a variable. You need to specify the variable in the Setup dialog. Reset Automator Time Task This task resets the automator trace time to zero. There is no setup dialog. You can use the two automator time tasks as a stopwatch within your automation, for example if you want to record the time between events. Start Critical Section Task This task marks the beginning of a critical section in your automation and allows you to dedicate all computing resources to the current task. Normally, other activities will occur, such as the Finder being refreshed. Use this task when you want to carry out activities, which require maximum speed or where exact, regular timing of tasks is required. Be aware, however, that certain activities still occur, for example Virtual Memory and AppleTalk both slow the machine down. You can disable these if required from the Apple Menu. There is no setup dialog. End Critical Section Task This task marks the end of a critical section in your automation. There is no setup dialog but, during a critical section, a dialog is shown on the screen explaining that a critical section is running. 68 Openlab Version 3

TASK SETUP DIALOGS Keywait Task This task allows you to pause the automation until the user enters something on the keyboard. Keyboard input may be any key or a key that you specify in the setup dialog. Click on the appropriate button. To select This Key: click on Set and press the appropriate key on the keyboard. Select the appropriate Wait until: key To select a specific key, click on Set and press the required key on the keyboard Compact Memory Task This task writes the current contents of RAM directly to the system cache. There is no setup task. The Compact Memory task is only available within an automation. The Compact Memory task allows you to optimize and maintain consistent system performance in an automation when you are carrying out memory-intensive tasks, such as capturing a series of images. The task essentially clears the RAM of all image data by writing it to the hard disk cache. Your computer uses RAM, Random- Accessed Memory, to process and temporarily hold information. RAM is part of the electronic circuitry the chips on the computer s main circuit board so RAM processing is fast, but it can only hold a certain amount of information. One of the many benefits of Openlab is the disk cache system, which allows the user to acquire image files larger than the available Random-Accessed Memory (RAM). Image capture is initially carried out to RAM. Therefore, the Openlab capture task Updated February 2001 69

OPENLAB checks the RAM before acquisition to see if there is sufficient space to acquire the images. If not, the capture task will initiate a cache operation to clear sufficient space for the RAM. This operation writes the image data to an area on the hard disk. But, whereas RAM processing is fast because you are not accessing the disk; writing to disk is relatively slow. The Compact Memory task allows the user to design an experiment which utilizes the RAM to best effect whilst taking the hard disk time penalty at a convenient place in the experiment. If your experiment requires a consistent, level performance, use the Compact Memory task to control when the computer writes the contents of the cache to the hard disk. For example, if available RAM is 100 MB and you are capturing a series of I MB images, you know that RAM will be full after the hundredth image and the computer will need to write the contents of RAM to the hard disk cache. If a level performance is critical, use the Compact Memory task to write the contents of the cache to hard disk at regular intervals during the experiment, perhaps every tenth image. Similarly, if you are just about to start a part of the experiment where performance is critical, use the Compact Memory task to empty RAM before you start that stage. Each image cached still has to use a small amount of RAM space so, eventually, experiments capturing many hundreds of images will fill RAM. 70 Openlab Version 3

TASK SETUP DIALOGS Example Compact Memory Automation In the following automation, we are capturing a series of a 1000 images and, to ensure a consistent performance, we use the compact memory task after every hundredth image. Setting up the automation The automation is set up as follows: The Target image window task targets the image window for the captured image. Updated February 2001 71

OPENLAB The Loop task sets up the automation to capture 1000 images and keeps track of the loop count in a number variable, c. The Capture Layer task captures the image. The If task uses the % operator to check the loop count. If the current value of c is exactly divisible by 100, with 0 decimal points (i.e. every hundredth capture), the automation carries out a Compact Memory task before continuing the loop. The Compact Memory task writes the contents of RAM to the hard disk cache. 72 Openlab Version 3

TASK SETUP DIALOGS Window Targeting Tasks Target Image Window Task When you work on an image window manually, the window to which you apply the action is always the active window. This is not necessarily the case in an automation. The currently active window may not contain the image with which you want to work. You use the Target Image Window task to tell the Automator which image window you want the following tasks to use. You can also use it to create a new Image Window. Automations that are to capture layers will not work without at least one Target Image Window task at the start to tell the software where to put all its images. Click to create a new target window Click and select an image window from pop-up menu Click to select the image window that is top-most Check to bring target image window to front when task executes The Setup dialog allows you to specify whether a new image window should be created or whether an existing image window should be used - either the top-most one or a specific one that is already open on the desktop. Check the Bring the target window to the front box, if you want the target image window to be brought to the front when the task executes. For example, you may want to watch each image as it is captured. Once you have created a target image window, any task that changes an image window works on the targeted window until you specify another one. Updated February 2001 73

OPENLAB File Tasks Close Image Window Task This task allows you to close the window that is currently targeted. There is no Setup dialog. Save Image Document Task This task allows you to save the document that is currently targeted. The Setup dialog allows you to define the file name for the document. If you choose to use the current name, but none exists, the Automator will prompt you for a file name when this task executes. You can also specify that the Automator should always prompt you for a file name at run time. The With this name option is particularly useful. You can use it to specify an exact name, or you can include a variable in the name expression box, so that you can increment file names as tasks are executed on an image window. For example: Create a new target window. Do something to the window. Save the window as test +str(x), where x is a variable whose initial value is 1. The file name is test1. Increment the variable x, by using a Variable task to set it to x+1. Do something else to the image window. Save the window again. The file name will now be test2. In this way you can easily build up a batch of related image documents and only have to set up the name once. Click to save under current name Click and type in new name Click to select folder. (Only available if With this name selected.) Click to prompt for new name at run time 74 Openlab Version 3

TASK SETUP DIALOGS Run Subroutine Task This task allows you to select an automation that you have already created to run as a subroutine within the current automation. For example, you may already have created an automation to capture one brightfield image. You could then use this automation as a sub-routine within an automation to capture fluorescence images. Subroutines should always be complete, free-standing automations that can be run independently of other routines. They are not just building blocks within a larger automation. Variables from an automation running as a subroutine do not apply to the calling automation and vice versa. The setup task allows you to select an automation to run as a sub-routine. Click on the Choose Automation button and select the appropriate automation file from the standard Macintosh File Open dialog. Click here to select the automation from the Open Files dialog Updated February 2001 75

OPENLAB Layer Selection Tasks Select Layers by Type Task This task allows you to select layers within a document according to layer type. Use the pop-up menus to specify search criteria for the layer type. Use the checkboxes to restrict the search to layers currently selected, or to all layers within the document. These checkboxes allow you to set up multiple searches. For example, you may want to select all General Image Layers which contain DAPI in the layer name. You need to create and set up two layer selection tasks Select Layers by Type and Select Layers by Name. First create and set up the Select Layers by Type task to select General Image Layers. Then create and set up the Select Layers by Name task. You need to set up the task to select layers whose name contains the text "DAPI" and check the Search only within current selection box. When the automation runs, the first task will select all General Image Layers and the second task will select DAPI layers from the original selection. Select type criteria from pop-up menus Check appropriate box 76 Openlab Version 3

TASK SETUP DIALOGS Select All Layers Task This task allows you to select all layers in the document. There is no setup task. Select Layers by Index Position Task This task allows you to select layers within a document according to index position. For example you may want to select the last 3 layers in the document. Use the pop-up menu to specify search criteria for the layer type and enter the index position into the expression box. Use the checkboxes to restrict the search to layers currently selected, or to all layers within the document. These checkboxes allow you to set up multiple searches, but you need to set up a separate task for each search. See page 76 for an example. Select name criteria from pop-up menu and enter index position in expression box Check appropriate box Updated February 2001 77

OPENLAB Select Layers by Name Task This task allows you to select layers within a document according to layer name. Use the pop-up menu to specify search criteria for the layer type and enter the name in the expression box. Use the checkboxes to restrict the search to layers currently selected, or to all layers within the document. These checkboxes allow you to set up multiple searches, but you need to set up a separate task for each search. See page 76 for an example. Select name criteria from pop-up menu and enter name in expression box Check appropriate box 78 Openlab Version 3

TASK SETUP DIALOGS Layer Tasks Get Layer Info Task This task allows you to get the layer information from the current layer. Layer information is generated by Openlab, but you can also use the Set Layer Info task to set a layer s name. The Setup dialog allows you to define what information you require and the variable which will be used to store the information. Check the boxes to select the information that you require Use the popup menus to tell Openlab where to store the information Set Layer Info Task This task allows you to change certain properties for layers. The Setup dialog allows you to select and define the properties. Check the boxes to select the properties for the layer Enter an expression or use the popup menus to define the property Updated February 2001 79

OPENLAB Delete Current Layer Task This task allows you to delete the current layer. There is no Setup dialog. Set Layer User Data Task This task allows you to create your own user data which will be stored with the current layer. The Setup dialog allows you to enter two expressions: one which will create the user data and one which will provide a name for the data that is created. The name of the user data item is stored with the current layer. Enter the expression that will create the user data item Enter an expression to create a name for the user data item 80 Openlab Version 3

TASK SETUP DIALOGS Get Layer User Data Task This task allows you get the user data for the current layer. You use the Set Layer User data task to create user data. The Setup dialog allows you to specify which item of user data you want and where you want Openlab to store it. Enter an expression to identify the user data item Select a variable from the pop-up menu to tell Openlab where to store the data Get No. of Layers Task This task allows you to get the number of layers and assign it to a variable. You use the Setup dialog to select the variable for the layer count. Select a variable from the pop-up menu to hold the layer count Updated February 2001 81

OPENLAB New Layer Task This task allows you to create a new layer. You use the Setup dialog to select a name for the new layer and to specify if you want the new layer to become the top-most layer. Enter an expression to create a name for the layer Check if you want Openlab to bring the layer to the top ROI To Binary Task This task converts the current ROI of the targeted document into a new binary layer. Use the Setup dialog to: Enter an expression for the name of the new binary layer. Enter an expression for the name of the new binary layer 82 Openlab Version 3

TASK SETUP DIALOGS Apply Wavelength LUT Task This task applies a color table that corresponds to a particular wavelength to the current layer of the targeted document. Use the Setup dialog to: Enter an expression for the wavelength. Enter a numerical value for the wavelength Apply Wavelength LUT (Selected) Task This task applies a color table that corresponds to a particular wavelength to selected layers of the targeted document. Use the Setup dialog to: Enter an expression for the wavelength. Enter a numerical value for the wavelength Updated February 2001 83

OPENLAB View Layer Task This task allows you to view a layer. The Setup dialog allows you to specify which layer you want to view - the first, next or previous layer in the targeted image document. You can also refine this selection by specifying a property for the layer. The property can be Name, ID or Sort Position. Select the layer that you want to view Check the box if you want to specify a property for the view layer Select the property from the pop-up menu and enter an expression for that property 84 Openlab Version 3

TASK SETUP DIALOGS Using Layer Tasks The following simple example illustrates how you can use the Layer tasks to create an automation that tells you something about every layer in the current image window. It has been set up as follows: The Target image window task targets the topmost image document and brings it to the front. The Get no. of layers task finds how many layers are in the document and we create a new variable called layercount to store the count. The View layer task selects the First layer in the target document. The Get layer info task selects the layer information that we require, and we create variables to store the information. Updated February 2001 85

OPENLAB The Talk about the layer task is a Tell task, which speaks the layer information provided by the previous task. The automation waits until the Tell task finishes speaking. The If task checks whether we have now reached the last layer in the image by comparing the position of the current layer with the number of layers in the image document. If the numbers are equal, the automation ends; if not, the View layer task selects the Next layer in the target document. 86 Openlab Version 3

TASK SETUP DIALOGS Filter Tasks Median Filter Task This task allows you to apply a median filter to the current layer or ROI on the layer. Use the Setup dialog to: Specify the Height of the matrix. Specify the Width of the matrix. Apply the filter to either the image or an ROI on it. Enter an expression for the number of rows in the matrix Enter an expression for the number of columns in the matrix Click to apply to the whole image or to an ROI Median Filter Selected Layers Task This task allows you to apply a median filter to selected layers or ROI on the selected layers. The Setup dialog is identical to the Median Filter task. Enter an expression for the number of rows in the matrix Enter an expression for the number of columns in the matrix Click to apply to the whole image or to an ROI Updated February 2001 87

OPENLAB Kernel Filter Task This task allows you to apply a kernel filter to the current layer or an ROI on the layer. Use the Setup dialog to: Select the required Filter. Apply the filter to either the image or an ROI on it. Select a filter from the pop-up menu Click to apply to the whole image or to an ROI Kernel Filter Selected Layers Task This task allows you to apply a kernel filter to selected layers or ROI on the layers. The Setup dialog is identical to the Median Filter task. Select a filter from the pop-up menu Click to apply to the whole image or to an ROI 88 Openlab Version 3

TASK SETUP DIALOGS IP Tasks Subtract Images Task This task allows you to apply background subtraction to a specified layer. Use the Setup dialog to specify: An expression which identifies the background layer. An expression which identifies the layer to which you want to apply background subtraction. Check one of the subtraction type buttons to apply Brightfield Subtraction or Darkfield Subtraction. Check one of the result boxes to put the subtracted image into The original layer or into A new layer. If you create a new layer, enter an expression to define the name of the new layer. Identifies the background layer Identifies the layer to which you want to apply background subtraction Check button to select type of subtraction Check button to select where to put the result If you create a new layer, define how to name it Updated February 2001 89

OPENLAB Subtract from Selected Images Task This task allows you to apply background subtraction to the layers that are currently selected in the target document. Use the Setup dialog to: Specify an expression which identifies the background layer. Check one of the subtraction type buttons to apply Brightfield Subtraction or Darkfield Subtraction. Check one of the result boxes to put the subtracted images into The original layers or into New layers. If you create new layers, enter an expression to define the name of the new layers. Identifies the background layer Check button to select type of subtraction Check button to select where to put the result If you create a new layer, define how to name it 90 Openlab Version 3

TASK SETUP DIALOGS Merge Images Task This task allows you to specify a layer for merging during the automation. It creates a new, merged layer. Use the Setup dialog to specify: An expression which identifies the first layer for merging. An expression which identifies the second layer for merging. If you want to merge a third layer, check the box and enter an expression which identifies the third layer. The appropriate merge command. RGB Merge compares each color component for each pixel in each layer and gives the brightest precedence. Averaging averages each color component for each pixel in each layer. An expression that will be used to name the new, merged layer. Identify at least two layers for merging Check the box and select a third layer for merging, if required Check one button to select type of merge Enter an expression for naming the new, merged layer Updated February 2001 91

OPENLAB Merge Selected Images Task This task allows you to merge the layers that are currently selected in the target document. It creates a new, merged layer. Use the Setup dialog to specify: The appropriate merge command. RGB Merge compares each color component for each pixel in each layer and gives the brightest precedence. Averaging averages each color component for each pixel in each layer. An expression that will be used to name the new, merged layer. Check one button to select type of merge Enter an expression for naming the new, merged layer 92 Openlab Version 3

TASK SETUP DIALOGS State Saver Tasks Restore Lab State Task This task allows you to restore a lab state that you have previously saved. Select the name of the state from the pop-up menu. Or, use the first expression box to select the state. For example, the state name may include one or more variables, such as Fluor State 1, Fluor State 2, Fluor State 3 and Fluor State 4. If you set up a loop task with a loopcount variable, you can enter an expression in this box ("Fluor State "+loopcount) that causes the automation to step through the different states. Or, type its Function key into the F key expression box. If you want the appropriate Restore button in the State Saver palette to be highlighted when the lab state is restored, click on the check box. Note: The expression box below the pop-up menu allows you to include variables with the state name. It is not described in this guide. Select name of the state from the pop-up menu Or enter expression for state name Or enter its function key Check to highlight Restore button on palette Updated February 2001 93

OPENLAB User Notes Task Write to User Notes Task This task allows you to add user notes to the targeted document. Type in the appropriate text. If you are adding notes at several points in your automation, you may like to make sure that there is a line between each block of text. To add a line at the end of the text, make sure that the Append a new line as well box is checked. Type in text Check to insert a blank line at the end of the text block 94 Openlab Version 3

TASK SETUP DIALOGS Clipboard Tasks The clipboard tasks support the subroutine feature. They allow you to copy variables between automations. For example, if you have created and used a variable in a subroutine, the current value in that variable will not exist in the automation that uses it. Copy Variable Task This task allows you to copy the value of a variable used in the current active part of the automation to the Macintosh clipboard. It is always used in conjunction with a Paste Variable task in a subroutine within the automation. Enter an expression for the variable. Updated February 2001 95

OPENLAB Paste Variable Task This task allows you to paste the value from the expression that was entered in the Copy Variable task from the Macintosh clipboard into a variable in the current active part of the automation. Select the appropriate variable from the pop-up menu. Example Automation using Subroutine and Copy/Paste Variable tasks In the following example, we use two automations. The calling automation sets up a simple time lapse and generates a loopcount variable to represent time points. The subroutine is for Z acquisition. It controls a focus drive and captures the images and also generates a loopcount for position in Z (1-10). We want to name images according to both time and position in stack, but the two loopcounts do not know about each other. Therefore, we need to copy the time point loopcount in the calling routine and paste it into the subroutine. 96 Openlab Version 3

TASK SETUP DIALOGS Calling automation Setting up the automation The automation is set up as follows: The Loop task sets up the automation to run the Z acquisition 60 times and keeps track of the loop count in a number variable, count. The Loop task sets up the automation to run 60 times and keeps track of the loop count in a number variable, count. The Null task just makes the automation look tidy on the screen. Updated February 2001 97

OPENLAB The Copy Variable task copies the current value of the loop count variable onto the clipboard. The Run Subroutine task runs the Z acquisition automation. The Delay task allows the Z acquisition automation 60 seconds to complete. Then the whole process is repeated until the subroutine has run 60 times. 98 Openlab Version 3

TASK SETUP DIALOGS Z Acquisition Subroutine Setting up the automation The automation is set up as follows: The Target Image Window task targets the top-most window and brings the target window to the front. The Set Zero task sets the focus drive to position 0. Updated February 2001 99

OPENLAB The Paste Variable task copies the contents of the clipboard (which is the current value of the count variable in the calling routine) and puts it into a different variable in the subroutine, called time_point. The Loop task sets up the automation to run the Z acquisition 10 times and keeps track of the loop count in a number variable, count1. The Move To task moves the focus drive to the required position. It uses the count1 variable to define the position. 100 Openlab Version 3

TASK SETUP DIALOGS The Capture layer task captures the layer and uses the time_point variable and the count1 variable to identify the time point and Z-position in the stack. The final Move To task runs after Z acquisition has run 10 times and returns the focus drive to the zero position. Updated February 2001 101

OPENLAB Video Manager Tasks Capture Layer Task This task allows you to capture a layer frame. The Setup dialog allows you to specify: An expression which will create a name for the captured layer. Whether the captured layer should be brought to the top so that you can see it in the Document Window. Whether the screen is to be updated. Disable screen updates to make the automation run more quickly. Whether asynchronous captures are allowed. This option is normally disabled. Only use it when recommended to do so by Openlab Technical Support. That layers are to be numbered automatically. A number is added sequentially to the layer name. For example, if you are using a loop task to capture images and want to name them IMAGE:1, IMAGE:2, and so on, you would type "IMAGE:" in the expression box and check Automatically number layers. A target layer depth. The default setting is the one that you have set up in the Video Manager Setup dialog. Enter an expression to create a name for the layer Check to disable screen updates Check to bring new layer to top Check to enable asynchronous captures Check to number layers automatically Select layer depth 102 Openlab Version 3

TASK SETUP DIALOGS Capture Multiple Layers Task This task allows you to capture multiple video frames as layers. This is normally faster than repeatedly capturing a single layer, as long as your camera supports this function. The Setup dialog allows you to specify: An expression which defines how many layers will be captured. A depth for the captured layers. A name stub. This is used as the common name stem for all layers.. A start number for layer naming. Openlab adds a sequential number to the name stem, ensuring that each layer has a unique name. You can define where the numbering is to start. Enter an expression for the number of layers to be captured Select a layer depth from the pop-up menu Defines the common stem to be used in name for all layers Define the start number for layer naming Updated February 2001 103

OPENLAB Get Video Control Task This task gets the value of a specified video control and stores it in a variable. Use the Setup dialog to: Enter an expression for the name of the video control. You must enter sufficient information to identify the video control. It is not case sensitive and you can shorten the name. as long as it is still uniquely identifiable (for example: expos will select Exposure ). Select a variable to hold the current value of the video control. If the control is an on-off checkbox, as some camera modes are, the value will be 1 for on (checked) and 0 for off (unchecked). Enter an expression for the video control Select a variable to hold the value of the video control 104 Openlab Version 3

TASK SETUP DIALOGS Set Video Control Task This task allows you to assign a specific value to a video control during the automation. Before you use this task, you must set up the video control on the Video Control Palette. The Setup dialog allows you to specify: The name of the video control. You must enter sufficient information to identify the video control. It is not case sensitive and you can shorten the name, as long as it is still uniquely identifiable (for example: "Exp", "expos" or "exp"). An expression which will assign a value to the video control. If the control is an on-off checkbox, as some camera controls are, set the value to 1 for on (checked) and 0 for off (unchecked). Set Video Controls setup dialog If you are setting up an on-off camera control, just enter 1 (on) or 0 (off) in the expression box. Enter the name of the video control Enter an expression to assign a value to the control Updated February 2001 105

OPENLAB Synchronise Camera Task This task allows you to time other tasks to coincide with particular points in the camera acquisition cycle. The Setup dialog allows you to specify: Whether the automation is to wait while or until an action is completed. An appropriate option to qualify the While/Until selection. For example, you could set up the task so that the automation waits until the camera is idle. Click on the While or the Until button Select one of the options from the pop-up menu The While/Until options are: The camera exposes The camera waits for an external trigger The camera is idle The computer reads the image data from the camera Automatic Exposure Task This task allows you to apply automatic exposure if your camera supports this feature. The automator estimates the exposure value according to the gray levels detected. There is no setup task. 106 Openlab Version 3

TASK SETUP DIALOGS Example Video Manager Automations The following example captures layers at two different exposures: 100 ms and 200 ms. Setting up the automation The automation is set up as follows: The Target image window task targets the top-most window. The Loop task sets a value for the number of loops and puts the loopcount into a variable, called loopcount. The Set 100ms exposure task sets the first exposure value. The Capture Layer task captures the layer as 100 ms exposure and uses the loopcount variable to identify the layer within the loop. Updated February 2001 107

OPENLAB The Set 200ms exposure task changes the exposure value. The second Capture Layer task captures the layer as 200 ms exposure and uses the loopcount variable to identify the layer within the loop. Automator and High-Speed Capture Some cameras may be quite slow to switch into the mode required to carry out highspeed capture, because the camera takes a little time to set itself up before it captures the frames. You may like to incorporate the following routine into your automation to resolve this problem. It captures a dummy single frame from the camera. This sets up the camera so that it is ready to capture a sequence of high-speed images for real. 108 Openlab Version 3

TASK SETUP DIALOGS Density Calibration Density Calibration Task This task allows you to apply a predefined calibration to the current layer in the automation. Use the Setup dialog to: Select the calibration from the pop-up menu. You can only select from predefined calibrations. If you need to set up a new calibration for the automation, you must first use the Density Calibration option from the Layers menu. Select the calibration Updated February 2001 109

OPENLAB Image Arithmetic Image Arithmetic is an Automator task that that allows you to apply a simple arithmetic operation to every pixel in the selected layer.. For example, the subtract operation can be used to subtract a fixed value from all images, thereby carrying out a form of background subtraction. Note: The recommended, empirical method is to use images of background and background subtraction as described in Section 1 of the Openlab User Reference Guide ("Working with the Layer Manager"). Image Arithmetic Task This task allows you to apply an arithmetic operation to all pixels in the current layer in the automation. The operation overwrites the current layer, so if you need to save a version of the image before the arithmetic operation is applied, include the Save Image Document task in your automation before you apply this one. Use the Setup dialog to: Select the type of operation: Add increases each pixel value by a specified number. Subtract decreases each pixel value by a specified number. Divide divides each pixel value by a specified number. Multiply multiplies each pixel value by a specified number. Enter an arithmetic value or select a variable from the pop-up menu. Enter arithmetic value 110 Openlab Version 3

TASK SETUP DIALOGS Example Image Arithmetic Automation In the following automation, we are going to capture a number of images at 340 and 380 wavelengths and apply background subtraction. You could build on this automation to include other tasks, such as ratioing or extracting measurements in the loop sequence, but there would be additional work in setting up the automation, for example to establish the ratio range and threshold values. The Target image window task targets the image window for the captured image. The Loop task sets up the automation for the number of the slides that you intend to capture. The Set Wavelength task moves to the 340 wavelength. (We have used the Polychrome II in this example.) The Capture Layer task captures the image at the 340 wavelength. The Image Arithmetic task subtracts a known value from all the pixels in the layer (10 in our example). Updated February 2001 111

OPENLAB The next Set Wavelength task moves to the 380 wavelength. The Capture Layer task captures the image at the 380 wavelength. The Image Arithmetic task subtracts a known value from all the pixels in the layer. The Tell task asks the user to mount the next slide. 112 Openlab Version 3

TASK SETUP DIALOGS Binary Operation Tasks Boolean Operations Task This task allows you to apply a Boolean operation to two binary layers in the current document. Use the Setup dialog to: Enter an expression for the first layer. Select the Boolean operation. Enter an expression for the second layer. Enter an expression for the new layer. Check the Bring new layer to top box if you want the new layer to become the current layer in the automation. Enter expression to select first layer Select operation Enter expression to select second layer Enter expression for the new layer Check to bring new layer to top Example Boolean Operation Automation In the following automation, we are going to use the OR operator to count the nuclei total for two different cell types on a number of slides. The cell types are stained differently. If we apply a density slice to identify and select both intensities, the search will be too wide and will include a lot of background. Therefore, we need to narrow the search region by selecting the first cell line in a density slice, and the second cell line in a second density slice. We can then apply the Updated February 2001 113

OPENLAB OR operator to combine the results of the two density slice operations before capturing and extracting the measurements. Setting up the automation Before you start, you need to find out the values to enter in the two Density Slice tasks. This is a manual task and not included in the automation. It involves the following steps: Capture a layer and draw an ROI that encompasses the first cell. Density slice, grabbing from the ROI, and make a note of the values. Now draw a second ROI that encompasses the second cell. Density slice, grabbing from the ROI, and make a note of the values. 114 Openlab Version 3

TASK SETUP DIALOGS The automation can now be set up as follows: The Target image window task targets the image window for the captured image. The Clear measurements task clears any measurement values that may exist from previous automations. The Loop task sets up the loop for the number of slides that you intend to capture. The Capture Layer task captures the layer. The Density Slice task picks out the cells at the first intensity and creates a new binary layer. Use the HSI values that you captured manually before you started the automation. The second Density Slice task picks out the cells at the second intensity and creates a new binary layer. Use the second set of HSI values that you captured manually before you started the automation. The Boolean Operations task combines the two new binary layers by applying an OR operator. This will pick up all pixels that appear in both binary layers, i.e. all pixels at the two intensities, and creates a new layer. The Capture One Measurement task captures a measurement from the new layer. The Extract Measurements task extracts the number of cells in the captured measurement. The Tell task displays the number of cells. We recommend that you put it in the trace. The Clear Measurement deletes the measurement. The Tell task asks the user to mount the next slide. The Input task prompts the user to enter y when the slide has been mounted. The If task makes the automation pause until the user enters y. Updated February 2001 115

OPENLAB Linear Interpolation Task Linear Interpolation Task This task allows you to apply a linear interpolation between two layers in the current document. Use the Setup dialog to enter three expressions: The first specifies the number of layers that will be inserted between two existing layers. The second identifies the first layer. The third identifies the second layer. Enter expression for number of layers to be inserted Enter expression to select the first layer Enter expression to select the second layer 116 Openlab Version 3

AUTOMATOR MENU COMMANDS Automator menu commands Overview There are five sets of Automator menu commands: the Automator menu in the Main menu bar, and four menus in the Local menu bar of the Automator Window. Any commands that you choose from the Local menus are only applied to the current automation. The Automator commands in the Main menu bar allow you to open a new Automation Window so that you create a new automation. They also allow you to run the automation and open specific tasks. Any automations that you save to the Automator Menu Items folder will appear at the bottom of this menu. The View commands in the Local menu bar allow you to collapse and expand task groups in the Task List. They also allow you to display the Variables Window. The Options commands in the Local menu bar relate mainly to the Work Area: for example, they control whether gridlines and controls are displayed and whether animation is enabled. The Trace commands in the Local menu bar relate to the Trace Area. They allow you to control the amount of trace information that is displayed and provide various options for saving, copying, printing and clearing the Trace Area. The Label commands in the Local menu bar allow you to add labels to your Automation Window, and to edit the text style and foreground and background colours. Automator menu Opens a new Automator Window Runs the automation Pauses the automation Stops the automation Steps through the tasks Opens the Setup dialogue for the task Updated February 2001 117

OPENLAB There may be additional commands at the bottom of this menu. They are automations that you have created and saved to the Automator Menu Items folder. When you select one of these commands, Openlab opens the automation and executes it. You can also: Use the Control buttons in the Automator Window to run, pause, stop and step through the automation. Double-click on any of the task icons in the Automator Window to open the Setup dialog for that task. View menu commands You can also: Collapses all task groups Expands all task groups Displays Variable Windows for this automation. Use Option-click to expand and collapse all task groups. Display the Variables Window for any automation that is currently open from Openlab s Windows menu (in the Main menu bar). Options menu commands Not available in the current version Snaps task to the grid Shows or hides gridlines Shows or hides Control buttons Disables or enables automation Stops automation if errors occur Gridlines are useful for positioning icons tidily in your Automator diagram. If you select Snap to Grid, they will be aligned to the grid. The animation applies to the animation icon and the task highlighting that become active during an automation. You can improve the speed at which the 118 Openlab Version 3

AUTOMATOR MENU COMMANDS Trace menu commands automation runs by disabling the animation. However, you will not be able to see which task is running. Savesthetracetoafile Copies the trace to the clipboard Prints the contents of the trace Clears the contents of the trace Defines what is included in the trace Scrolls the trace area so that you always see the most recent message The three Trace commands define what level of information you want to include in your trace. You can improve the speed at which the automation runs by disabling these commands. However, they are very useful when you are creating your automation. You may like to disable the trace once you have tested the automation. You can also improve the speed at which the automation runs by disabling the Scroll to new messages command. This means that you will only see messages from the start of the automation in the Trace Area, and will have to use the scroll bar to scroll through the messages manually. Use the Clear command to clear the contents of the Trace Area. If you are experiencing problems with your automation, you may want to send a copy of the contents of the Trace Area to Improvision s Support staff. You can: Print the contents of the Trace Area to the printer that is currently selected in the Chooser. Select Print from the Openlab File menu. Copy the contents to the clipboard where you can paste them into another application. Save the contents as a file. Updated February 2001 119

OPENLAB Select a folder, or create a new one if required. Enter a name in the Save File As: box. Click on Save. Label menu commands Creates a new label in the Automation Window Standard text edit commands Color commands When you create a new label, you can type text directly into it, as long as the box is selected. Click on the box to select it. You can resize and move it, as required. Use the Font, Size and Style commands to achieve the desired appearance of the text. Use the Foreground Colour command to select a colour for the text and the outline of the label. Use the Background Colour command to select a colour for the background. 120 Openlab Version 3