Book Image

Image Processing with ImageJ

Book Image

Image Processing with ImageJ

Overview of this book

Digital image processing is an increasingly important field across a vast array of scientific disciplines. ImageJ's long history and ever-growing user base makes it a perfect candidate for solving daily tasks involving all kinds of image analysis processes. Image Processing with ImageJ is a practical book that will guide you from the most basic analysis techniques to the fine details of implementing new functionalities through the ImageJ plugin system, all of it through the use of examples and practical cases. ImageJ is an excellent public domain imaging analysis platform that can be very easily used for almost all your image processing needs. Image Processing with ImageJ will start by showing you how to open a number of different images, become familiar with the different options, and perform simple analysis operations using the provided image samples. You will also learn how to make modifications through ImageJ filters and how to make local measurements using the selections system. You will also find the instructions necessary to record all the steps you perform so they can be saved and re-run on the same image to ensure analysis reproducibility. Finally, you will get to know some different ImageJ plugins and will learn how to implement your own.
Table of Contents (13 chapters)
Image Processing with ImageJ
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a GUI to your macro


Sometimes you may want to try different values for some parameters without having to edit the macro code again and again in order to change the hardcoded variables. The Dialog functions allow you to build your own user interfaces to query the user for information before running the macro. A dialog is built by calling Dialog.create(title) and then adding the different elements that compose the user interface: textboxes for strings/numbers, sliders, selection menus, checkboxes, and radio buttons. Once all the elements are in place, we just need to get the user input and proceed with the processing of the macro.

The following code creates a simple dialog and will allow us to explore the possibilities of the dialog building functions with some additional nicety:

// We are using some relatively new functions, so we have to
// explicitly forbid this macro from running in old ImageJ versions
requires("1.47r");
// Create the main window with its title
Dialog.create("This...