User Tools

Site Tools


Courses -2016
Courses 2018-
Downloads (-2016)
Downloads (2016-)
RSS aggregates

EMBL BioImage Data Analysis



—- Contact
CMCI Alumni
EMBL Heidelberg
EMBL Intranet

Popularity Ranking

Timeline of @cmci_

cmci_ avatar

RT @CornellBiotech: Join us for the Fiji (ImageJ) Summer Workshop Aug 10-12
About 6 days, 7 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @christlet: Extending the classic full-width at half-maximum (FWHM) method for estimating image resolution on sub-resolutive structures…
About 2 weeks ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @CiminiLab: I've made a Twitter Community for Bioimage Analysis- feel free to join and share widely! I'll fully admit this is an experim…
About 2 weeks, 2 days ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @kjaMartens: We created a very simple method to get high precision and density in spectrally-resolved single-molecule localization micro…
About 1 month, 1 week ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @random_walker: There’s a reproducibility crisis brewing in almost every scientific field that has adopted machine learning. On July 28,…
About 1 month, 1 week ago by: Kota Miura (@cmci_)

cmci_ avatar

@AthaleLab @IISERPune @serbonline @DBTIndia @IFCPAR @OfficialSICI @boschindia Congrats Prof. Chait!
About 1 month, 1 week ago by: Kota Miura (@cmci_)

Imaris - Java

Here is some notes on accessing Imaris contents from Java. Since this example uses COM interface via jacob.dll, platform is limited to windows.


There is a breif description in

In order to run the JACOB demo, the Java COM Bridge needs to be installed (put the jacob.dll into /bin and the jacob.jar into /lib/ext). The demo does similar things like the demos above: Start Imaris, load a Dataset, perform some action with the image, and terminate Imaris. Many thanks for providing the source code to Volker Bäcker, Monpellier RIO Imaging.

So accessing Imaris from Java requires Jacob pakage (Java - COM Bridge, When I downloaded the latest version, two .dll files were included in the package and no jacob.dll.

Jacob.jar relies on a DLL file that it loads off of the library path or classpath. This means that you must either copy the appropriate jacob ddll into your path or use VM options to add directory holding jacob dll to the path. Prior to 1.14M6, the jacob DLL name was alwasy “jacob.dll”. This made it hard to verify jacob was loading the correct dll when multiple copies of jacob were installed on a single system. It also was confusing on 64 bit systems where the 32 bit and 64 bit dlls have the same tames. Starting in 1.14M6, Jacob's library loader selects a dll with the appropriate name based on the jacob release and platform. The dll naming convention is: jacob<platform>.<version.>.dll

There actually are following two .dll files in the package.

  • jacob-1.15-M3-x64.dll
  • jacob-1.15-M3-x86.dll

I copied them under C:\Sun\SDK\jdk\jre\bin, where my system PATH is already set.

jacob.jar was as it is so this was copied under C:\Sun\SDK\jdk\jre\lib\ext

Testing java applicaiton using example downloadable from Bitplane

Example java code by Volker Bäcker is available in the Bitplane site linked above. I downloaded the java file and then made it testable in Eclipse (simply add jacob.jar file in the project build path).

Start button: starts up Imaris

Starting up of imaris uses ActiveX control. Useful tool for viewing ActiveX control: checking progID (activeXID).

Constructor of imaris class instance is as follows, within getStartImarisButton().

	public void actionPerformed(java.awt.event.ActionEvent e) {
		if (imarisApplication == null) {
			imarisApplication = new ActiveXComponent("Imaris.Application");
			imarisApplication.setProperty("mVisible", true);

“mVisible” is a property of IApplication Interface and details are in:

ActiveXComponent is a class provided in Jacob package, and accessing Imaris functions are mostly done through the method of this class. Java doc is at:!/api/com/jacob/activeX/ActiveXComponent.html

text field & "Load" button (first and second line)

Load button sends command to Imaris by following three lines in method getLoadImage1Button().

	Variant parameter1 = new Variant(imagePath1TextField.getText());
	Variant parameter2 = new Variant("");
	imarisApplication.invoke("FileOpen",parameter1, parameter2);

imarisapplication is an instance of ActiveXComponent constructed above. Class Variant is described in the Jacob Java doc:!/api/com/jacob/com/Variant.html

“FileOpen” is a member funciton of IApplication Interface and details are in:

By the way, imarisapplication is initialized in the method “initialize()” as follows:

	private void initialize() {
		this.setSize(440, 545);
		this.setTitle("Hello Imaris DataSet");
		this.addWindowListener(new java.awt.event.WindowAdapter() {
			public void windowClosing(java.awt.event.WindowEvent e) {
				if (imarisApplication != null) {
					imarisApplication.setProperty("mUserControl", !checkbox.getState());

details on the IApplication interface property “mUserControl” is in:

getSize button

(does not work, returs error in the current state)


This button's action is as follows:

	public void actionPerformed(java.awt.event.ActionEvent e) {
		ActiveXComponent dataSet = imarisApplication.getPropertyAsComponent("mDataSet");
		int type = dataSet.getPropertyAsInt("mType");

mDataset: IApplicaiton property

mSizeX: IDataSet property

blogtng/2010-06-17/imaris_-_java.txt · Last modified: 2020/11/26 09:11 (external edit)