Date: 25 Aug 1993 From: huff@mcclb0.med.nyu.edu (Edward J. Huff) Subject: User Macro Extensions beta test 2 uploaded to zippy This release includes a finished 16 bit arithmetic package including convolution, some sample macros, and the Quantile and CrestPathway packages written by Jacques van Helden . I converted them so that they are invoked as XYQuantile(quantile,h,v) instead of UserCode(1,quantile,h,v), etc., without requiring changes to globals.p, macros2.p, or macros1.p, as would have been required before. Image UMX is a beta test copy of modifications to Image 1.51 to support "User Macro Extensions" to the Image macro language. The major goal is to make it easy to merge several separately maintained extension packages into one copy of image. Basically, to add macro commands or functions, you create a new .p module, and make changes in eight well marked places in UMacroDef.p and UMacroRun.p. The result is like the "add-in" functions of Microsoft Excel, in which the added functions appear to be an integrated part of the original. This code also includes the "pidNumber" function I described earlier, which permits use of selectImage/chooseImage with the same number even if an image has been deleted meanwhile. A second goal is to make it easier to write code which accesses the pixels of the current ROI's in several images specified by picNumber of picNumber arguments to a user Macro command. Most of the work required to figure out how to access just the ROI is done in one place and need not be repeated in the user code. I urge people (groups) who add code to NIH Image to examine this package and to consider asking Wayne to make it part of the standard release. I hereby ask for this, but agreement by several parties, and absence of objections from others, will help. Examining the differences between my code and the original 1.51 will require a day or so (nothing takes less than a day, or is that a week? :-) of Wayne's time. The only controversial thing about this package is its philosophy of operating on several images at once rather than using choosepic, copy, choosepic, paste, add. This represents a discordant design feature. However, I think it has several advantages: it is easier to understand, it runs faster, and it permits operations that take more than two images as input. I admit, also, that I have not considered the alternate route of using plug-in filters to do some of the operations. This approach has the advantage of being cleanly integrated into the Image macro language, whereas plugin filters remain obviously "add on." The source code, a compiled copy of Image, and a few macro files are included in NIH-ImageUMX1.51b2.sit.hqx which will be uploaded to zippy.nimh.nih.gov /pub/nih-image/contrib shortly. This package is a second beta release, and it is reasonably complete. An completed version of UMPixel16u.p, a 16 bit image arithmetic package, is also included. Also, Jacques van Helden 's Quantile and CrestPathway packages are included. Examine UMacroDef.p, UMacroRun.p, and UMSample.p for more information. See also function DoUserToken in macros1.p, which contains the code for parsing the argument lists for user macro commands, and support for dealing with image number (picNumber or pidNumber) arguments, including automatic suspension and restart of active ROI's.