Installation/Windows

From MiToBo
Revision as of 09:36, 5 November 2015 by Misiak (talk | contribs) (→‎Use MiToBo with an existing ImageJ installation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Using MiToBo with ImageJ on a Windows-based system


Notice: The ImageJ directory path depends on your ImageJ installation. Following, we assume that the ImageJ home directory is set up to C:\Program Files\ImageJ\.<br\>

Use MiToBo with an existing ImageJ installation

For installing MiToBo into an existing ImageJ installation perform the following steps:

  1. extract the mitobo-plugins-1.x binary zip file
  2. go to the mitobo-plugins-1.x\plugins\ directory
    • copy the mitobo_plugins.jar to your ..\ImageJ\plugins\ directory
    • copy all jars from mitobo-plugins-1.x\plugins\jars\ to your ..\ImageJ\plugins\jars\ directory except the ij.jar and jars already existing
      (Notice: MiToBo requires explicite versions of some jars, other versions may not work probably, see requirements.)
  3. go to the mitobo-plugins-1.x\macros\toolsets\ directory
    • copy the MiToBo_Runner.txt to your ..\ImageJ\macros\toolsets\ directory
  4. Make the native libraries in lib/ of the MiToBo zip file available to Java (see the Native libraries section below)

Native libraries

Some operators of MiToBo use native code via the Java Native Interface (JNI).
The 'lib/' directory in the zip file provides precompiled JNI-libraries for 32-Bit (lib/libwin32) Windows systems.
At the moment, JNI-libraries for Windows are only available for 32-Bit architectures, but can also be used with an 64-Bit architecture (see below).
For using the native code add the libraries to the library path.
The path to the native libraries must be available to any java application which uses MiToBo operators that depend on these libraries.

32-Bit architecture
  1. go to the mitobo-plugins-1.x\lib\ directory
    • copy the libwin32 directory to your ..\ImageJ\ directory

  2. configurate your ImageJ startup
    • edit ImageJ configuration file ..\ImageJ\ImageJ.cfg and add the library path

      -Djava.library.path="C:\Program Files\ImageJ\libwin32"

      Example of an ImageJ.cfg file:
   C:\Program Files\ImageJ\
   C:\Program Files\Java\jre6\bin\javaw.exe
   -Djava.library.path="C:\Program Files\ImageJ\libwin32" -Xmx1024m -cp "C:\Program Files\ImageJ\ij.jar" ij.ImageJ


  • as an alternative you can start ImageJ from command line
  • open your Windows command line
  • move to the ..\ImageJ\ directoy
  • type the following command:
  java -Djava.library.path="C:\Program Files\ImageJ\libwin32" -Xmx1024m -cp "C:\Program Files\ImageJ\ij.jar" ij.ImageJ


Notice: The -Xmx1024m variable sets the maximum memory heap size of Java to 1024 MB. This value can be increased, depending on your installed system memory and architecture.<br\>

64-Bit architecture

Using a 64-Bit architecture requires a 32-Bit Java installed on the system to use the 32-Bit JNI-libraries.
Perform the following steps to run MiToBo on a 64-Bit architecture:

  1. go to the mitobo-plugins-1.x\lib\ directory
    • copy the libwin32 directory to your ..\ImageJ\ directory

  2. configurate your ImageJ startup
    • edit ImageJ configuration file ..\ImageJ\ImageJ.cfg and add the library path

      -Djava.library.path="C:\Program Files (x86)\ImageJ\libwin32"

      Example of an ImageJ.cfg file:
   C:\Program Files (x86)\ImageJ\
   C:\Program Files (x86)\Java\jre6\bin\javaw.exe
   -Djava.library.path="C:\Program Files (x86)\ImageJ\libwin32" -Xmx1024m -cp "C:\Program Files (x86)\ImageJ\ij.jar" ij.ImageJ


  • as an alternative you can start ImageJ from command line
  • open your Windows command line
  • move to the ..\ImageJ\ directoy
  • type the following command:
  C:\Program Files (x86)\Java\jre6\bin\javaw.exe -Djava.library.path="C:\Program Files (x86)\ImageJ\libwin32" -Xmx1024m -cp "C:\Program Files (x86)\ImageJ\ij.jar" ij.ImageJ


Notice: The -Xmx1024m variable sets the maximum memory heap size of Java to 1024 MB. This value can be increased, depending on your installed system memory and architecture.<br\>