M&M 2010

August 1-5, 2010

Portland, OR

Volume 1, Issue 1, July 2010

Simple Introduction to Macros

Text Box: Newsletter Spotlight

I would venture to say that many, if not most, installations of the cameras and software are used to acquire "repetitive" images. By "repetitive" I mean the same sort of images are acquired a majority of the time - pathology cases, product manufacturing images, images for feature measurements, etc. Often times the images are filed according to product names, lot numbers, or case numbers. A sample image name format may be something like:

CaseNumber_ImageNumber.tif

(example: 12345_1.tif, 12345_2.tif, 12345_3.tif, etc).

My idea in this article is to introduce an easy way to set up this image format then extend it to some basic "automation". The idea is to introduce the concept of macros and how they are used in Olympus software. The interface and techniques are the same whether using Scandium or iTEM.

The first step is to set the image name and image number. To do this, choose the "Special" menu from the menu bar at the top of the program. Select "Preferences" from the drop-down list. You can also

press the shortcut key, F8, to directly open the preferences dialog. This will open a dialog with several tabs along the top. It will probably open with the image tab select, but if it doesn't, then simply click on the tab labeled "image".

You will see several different options in this window but for purposes of this text we will concentrate on the prefix and image number items. Simply enter a name in the "prefix for images" text box and set the "incremental number" to the number desired for the next acquired image. Click OK to set the accept the options. The next image that is acquired will have the prefix and number set in the dialog.

Let's also set a new option so we can see some of the inner workings of the software. Click on the View tab. Towards the bottom left of the dialog you will a set of check boxes. Put a check next to "Show

function names & arguments in status bar". Click OK to close the dialog.

This will activate a feature that will show the macro command names in the status bar at the bottom left of the screen. To see how it works, point the mouse at a toolbar button but do not click it. You will see the command and a short description listed in the status bar. This command is what we would type into our macro to use that program feature. We'll use this to write our simple image name macro.

To see the command we need for our macro, select the Special menu one more time and point the mouse at the Preferences item without clicking to select it. Look to the lower left of the screen and you will see the command to open the preferences dialog. It will look like this

Preferences$(Category): Sets a variety of program response and behavior options.

The first part of this is the command itself and after the colon is a small description of what the command does. We use this to make our macro so let's move on.

Again, we will go to the Special menu, but this time we will choose "edit button bars..." so that we can make a button to directly open the preferences dialog box. You will see the Edit Button Bars dialog box open. It contains an alphabetic listing of all the defined toolbars that are available. Bars that are currently displayed will have a check next to them. Scroll down through the list until Standard is

visible. Click the name, being sure not to uncheck the box, so that "Standard" is highlighted. Click the "Edit" button.

Now the "edit button bar" dialog is displayed. While it may seem daunting, there is a relatively simple design to the layout. There are several sections to this dialog and we will work through them one at a time. First, we need to choose what command to add the toolbar. We do this with the command groups and command boxes in the dialog. We can simply choose the "internal functions" group and select the command we want. Click on "internal functions" in the command group box. An

alphabetic list of commands will be displayed in the "commmand' box in the center of the dialog. Scroll down through this list until you see Prefereces$ displayed. Click on it to select that command.

Next we will choose the icon to add to the toolbar. We can do this from list of icons displayed at the top of the dialog box. Scroll back and forth through the available icons and choose one you like or that you think will be representative of what we want to do. I chose the "smiley face" because it stands out on the toolbar and is easy to see.

Last we have to actually add the icon to the tooolbar and position it where we want it. Click the "add" button to append the icon to the end of the list of toolbar buttons on the left of the dialog. Then you can use the "up" and "down" buttons position the icon on the toolbar

where you want it. You can always come back to this window again to move the button or change the button face if you are not happy with your first choice.

Once you have the button chosen and positioned where you want it, click OK to close the edit button bar dialog then OK again to close the edit button bars dialog. You should see the new button displayed in the toolbar area of the program. Click it to open the preferences dialog and edit the image name and number as before.

The last thing we need to do is to save these new settings so that our new button will be available everytime we open the program. One last time, go to the SPecial menu. This time we will choose configuration...save. A dialog will open asking for the configuration name. We will use the default configuration so the button is there everytime the program opens. Simply click Save to write the new configuration. Click Yes when asked if you want to overwrite the current configuration.

That's it. We are done. It took some time to lay out in words but I think that you will find that by adding a couple of buttons or beginning to write macros, you will truly see how convenient the software is to use. I plan on taking expanding on some of these concepts in future editions to show how to use more complicated macros.

 

Last, if any of the readers have macros that they

have written or would like to try to add, please submit them. We can share them with the user community. Of course, any feel free to submit any questions you may have as well. I would be happy to share any help that I can with you.

 

Back to Newsletter

by Jason Wickersham