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

Configuration options


Once you have a working ImageJ installation, you might want to tweak some configuration options, such as the appearance, font size, and proxy settings. These options are easily modified using the menus Edit | Options | Fonts…, Edit | Options | Appearance…, and Edit | Options | Proxy Settings….

The next section is dedicated to explain how to tweak the one configuration parameter that might be vital during your analysis tasks: the amount of system memory available to ImageJ.

Memory limit increase

If you run Help | About ImageJ... you will get this nice image:

Along with the version (note the upgrade!), the information of ImageJ's main author, and some other data that resembles those previously commented, you can see that 4095 KB of RAM memory is used, from a total of 640 MB (less than 1 percent). Every time you open a new image, the amount of memory being used increases, until the limit is reached. Once you get to this point, an error will pop up, as ImageJ will not have the necessary resources. The error will be something like this:

If you are going to work with big images, or you need to keep open a great number of them, it is wise to increase the memory limit for your system. It can be done, as the error message states, by navigating to the Options | Memory & Threads command from the menu. This will open the following dialog:

Here, you can select the total amount of memory you want ImageJ to use. For example, we change the Maximum memory field to a value of 2048, and click on OK. A new window will inform us that ImageJ will use the new limit upon restart.

In Windows systems, this value is stored in the Image.cfg file. Another option is to edit that file before running ImageJ. These are the contents of that file in a regular installation, though the exact path may vary:

C:\Program Files\Java\jre7\bin\javaw.exe
-Xmx640m -cp ij.jar ij.ImageJ

As you can see, this is just a call to the Java Runtime Environment with the appropriate parameters to run ImageJ. -Xmx640m defines the amount of memory available for the Java virtual machine. If we change that value to -Xmx2048m, we will accomplish the same result as before. This way of changing the total amount of memory can also be used in Linux; in this case, the value is stored in the run script as another argument for the Java virtual machine. These are the typical contents of the run script upon installation:

java –Xmx512m –jar ij.jar

This script just calls the java executable with the configured memory limits, and launches the application inside the ij.jar file. This memory limit can be changed directly in the script file.

Bear in mind that, for memory amounts bigger than 2 GB, a 64-bit system and appropriate Java version is needed.

Note

It is not a good idea to give ImageJ all the available memory. Your operating system and other programs need their share too.