- Image Processing with ImageJ
- José María Mateos-Pérez Javier Pascau
- 514字
- 2021-08-06 16:56:16
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.
- 深度實踐OpenStack:基于Python的OpenStack組件開發
- 摩登創客:與智能手機和平板電腦共舞
- 深入淺出Java虛擬機:JVM原理與實戰
- 劍指JVM:虛擬機實踐與性能調優
- DevOps入門與實踐
- Instant Lucene.NET
- Python3.5從零開始學
- HTML+CSS+JavaScript網頁設計從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- 石墨烯改性塑料
- INSTANT Apache ServiceMix How-to
- Android高級開發實戰:UI、NDK與安全
- Java語言程序設計實用教程(第2版)
- Spring Boot學習指南:構建云原生Java和Kotlin應用程序
- Java網絡編程實用精解
- 羅布樂思開發官方指南:Lua 語言編程