About how to use Open_MI plugin to open AFM images



Hi buddies,

Recently I want to use imageJ to process AFM images so I installled Fiji latest version and downloaded the Open_MI.java file as a plugin. Simultaneously, I installed JDK8 with JRE in my Win10. But first the problem was that I cannot compile this java file. The situation was very similar to the messages from the Topic of “Can’t run plugins” @mconfused, such as cannot find javac with some java:number,etc. So I adopted the way of moving java files out of the imageJ installation @ctrueden. There seems no above errors but I still cannot open AFM images from Bruker whatever I click the plugin of Open_Mi directly or through the “new-script- open_mi.java -compile and run” way. The procedure is: The message starts as “Open_MI not up-to-date because 1 source files are not up-to-date (C:\Users\XUEFEN~1\AppData\Local\Temp\java490694589260327820\src\main\java\Open_MI.java)…(too long!)” Please further refer to the information uploaded as two snap-shots.Then after I choose one AFM file( .hdr format?) and click open and imageJ shows it is running but waiting while there is no any result pop out i.e., seemingly there is nothing happened. I am not sure whether the issure is related to the above information and sorry for any unuseful information disturbing you!
Can anyone offer any solutions?



The ability to compile Java code from inside ImageJ is not well-supported currently in ImageJ2 & Fiji—see e.g.

For now, for ImageJ1 plugins shipped as .java files, it is best to compile the .java files to .class in some other way. You can use javac from the command line, or download ImageJ1 and use its Compile & Run command, which still works. Then you can place the compiled .class files into your Fiji installation’s plugins folder, and they should work.

To help you out, I compiled the Open_MI plugin and placed the results online at https://curtis.imagej.net/Open_MI/

To do it, I used the following command line invocation:

$ javac -cp /Applications/Fiji.app/jars/ij-1.52b.jar *.java
Open_MI.java:110: error: unmappable character for encoding UTF8
				fileUnit = "�";
Open_MI.java:119: error: unmappable character for encoding UTF8
				fileUnit = "�m";
Open_MI.java:221: error: unmappable character for encoding UTF8
Open_MI.java:230: error: unmappable character for encoding UTF8
4 errors

As you can see, there were errors, which I fixed by editing the source code to replace the offending unit strings with “angstrom” and “micron” as appropriate, and then trying again.


Hi ctrueden,
Thank you very much for your help. Following your both ways, this plugin with Java issue should be sloved since there are not any errors popped out but I still cannot open this kind of .000 AFM image.(When I click on the plugin of Open MI, there is a popped window of “open STP…”. Then choose a AFM file and click on OPEN, but nothing happens.) So I suspect this plugin cannot open this kind of format file in itself rather than pertaining to imageJ Java compiler for the time being. So I am contacting Bruker engineers for solutions. Anyway, thanks you very much !!


As best I can tell, Open_MI is very dated. The ImageJ page Curtis linked for it says it was last updated in 2008, so unless you’re running very old AFM software, the file format may have changed. You might try opening your file in Gwyddion which looks current, or WSxM, although the web site is down at the moment so I don’t know its status.

If you need ImageJ for analysis, export from Gwyddion to something more common, or since Gwyddion is open source you could port its code to Java and release an ImageJ import plugin.


Hi jimpassmore,

Thank you for your reply. Yes, you are correct. I am using Gwyddion which can open current AFM images. As to WSxM, I am not sure because I have not used it before. Thank you again for your support!