LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run imagej within labview

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

 

http://forums.ni.com/t5/LabVIEW/ImageJ-implementation-or-equivalent-in-Labview/m-p/249904/highlight/...

 

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... 

 

0 Kudos
Message 1 of 7
(4,753 Views)

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,

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 2 of 7
(4,722 Views)

That link says the document is deleted. Any solutions? I am trying to do similar excersise of calling imageJ from Labview

0 Kudos
Message 3 of 7
(4,337 Views)

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

 

Carli S.
Troubleshooting & Maintenance Digital Business Manager - NI
0 Kudos
Message 4 of 7
(4,300 Views)

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

0 Kudos
Message 5 of 7
(3,554 Views)

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

Trevor H.
Technical Support Engineer
National Instruments
0 Kudos
Message 6 of 7
(3,532 Views)

Did you get how to integrate ImageJ to Labview? Run imagej(fiji) macro program in labview

0 Kudos
Message 7 of 7
(2,799 Views)