02-13-2012 04:32 PM
Hi... I want to be able to run "imagej", a Java image processing and analysis code (http://rsbweb.nih.gov/ij/) from within LabVIEW. There is a post on this forum at
that contains a link to a piece of LabVIEW 7.1 code called
RunImageJ.vi
I've downloaded it, changed the paths that are obviously wrong between the default path on that piece of code and what exists on my Windows 7 machine and run it... But it fails with the following errors...
java.lang.NoClassDefFoundError: RunMacro
Caused by: java.lang.ClassNotFoundException: RunMacro
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: RunMacro. Program will exit.
Exception in thread "main"
I am not a Java expert (not even a novice in fact) and I'm not very interested in spending a lot of time learning the nuances of Java. If I have to I will but I am hoping that perhaps someone here can offer some guidance or perhaps point me to a different LabVIEW based solution. We have some fairly complex macros/plugins running in ImageJ and giving us just the information we need... We eventually need to have that same capability in LabVIEW and it would be far easier to have the ability to simply call ImageJ from within LabVIEW and return results similar to what is possible with say Matlab Script Nodes. Otherwise, we will need to more or less attempt to extract the math from the Java codes and that clearly would be no fun at all...
Does anyone have a solution for how to call ImageJ from within LabVIEW without me needing to become a Java expert??? Any help would be much appreciated... thanks... bob...
02-14-2012 04:57 PM - edited 02-14-2012 04:58 PM
Hi Bob,
I've been looking around for something to point you in the right direction.
Here is a Knowledge Base article on the basics of calling Java methods in LabVIEW:
http://digital.ni.com/public.nsf/websearch/BEE812007BA2A9B486256BC80068A49A?OpenDocument
Hopefully this gives you a general idea of what you might need to run imagej, mainly the use of some kind of C environment (like the LabWindows/CVI environment) to create a dll wrapper that can be called from LabVIEW. Unfortunately, you can't directly call Java code because LabVIEW doesn't natively support it.
I also took a look at the program from the thread you linked. It seems like a basic windows command prompt call, so it should run any executable-type files you enter in the file path.
Regards,
11-19-2014 12:25 PM
That link says the document is deleted. Any solutions? I am trying to do similar excersise of calling imageJ from Labview
11-20-2014 12:55 PM
Looks like the resource about calling Java Methods in LabVIEW has been removed.
Many customers have had success with a third-party plugin called ImageJVI that sounds like it would be helpful in your application.
It can be found at http://www.imagejvi.org/index.php/about-image-j-vi.html
01-29-2018 10:41 AM
Looks like ImageJVI has been deleted or is no longer supported. Whatever the case it's no longer found in that link. Any other suggestions? Thanks
01-30-2018 05:28 PM
Hey PM7,
Since this is an older forum post, people are unlikely to search it. You would probably get more responses by creating a new post, and referencing this one for context.
I also found another thread discussing ImageJVI that has more recent conversations on it. There may be some more useful information there.
https://forums.ni.com/t5/LabVIEW/ImageJ-implementation-or-equivalent-in-Labview/td-p/249904/page/2
06-08-2019 11:07 AM
Did you get how to integrate ImageJ to Labview? Run imagej(fiji) macro program in labview