Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Image Processing with ImageJ

You're reading from   Image Processing with ImageJ Get familiar with one of the world's most highly regarded Digital Image processors, ImageJ. This tutorial takes you through every aspect of viewing, processing, and analysing 2D, 3D, and 4D images, clearly and comprehensively.

Arrow left icon
Product type Paperback
Published in Sep 2013
Publisher Packt
ISBN-13 9781783283958
Length 140 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Installing macros for easy access


When you write a macro and save it to a file, you can run it easily by navigating to Plugins | Macros | Run..., and then select the file that contains it. However, if you are going to run a macro several times, this can get tiresome. Fortunately, you can install a set of macros for easy access by navigating to Plugins | Macros | Install.... In order to use this command, we first have to give our macro a name. This is done in the following way:

macro "Test macro" {
// The macro code goes inside the curly braces. Nothing else changes.
}

You can have several macros in a file using this naming convention. Variables can be shared between different macros if they are defined outside the macro blocks and are preceded by the var keyword. Functions defined outside a particular macro block can be accessed by any macro in the file.

We will further explain these concepts with the following example:

var common = "I'm a common variable";
// This function can be called by...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime