ImageJ and .Net

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ImageJ and .Net

sushma569
As a previous post suggested I used IKVM to create a .dll version of ImageJ to use in .Net environment.

I have created a simple plugin that takes some string as input and prints out "Hello " + str.

I tried the IJ.runPlugin(...) command but I cannot get it to run this plugin. Basically either ClassNotFoundException or nothing happens.

If someone has tried this approach and has been successful please give me syntax to run a plugin.

[code]
//.Net
            IJ.runPlugIn("My Plugin HelloWorld", "test");

            Console.WriteLine("done " + o);


//plugin
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.*;

public class My_Plugin_HelloWorld implements PlugIn {

        public void run(String arg) {
                String x = "Hello world! " + arg + ", " + arg;
                IJ.showMessage("My_Plugin", x);

                IJ.runPlugIn("Red_And_Blue", "");
        }

}


[/code]

[output]

[/output]

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ and .Net

dscho
Hi,

On Mon, 31 Aug 2009, sushma569 wrote:

> As a previous post suggested I used IKVM to create a .dll version of
> ImageJ to use in .Net environment.
>
> I have created a simple plugin that takes some string as input and prints
> out "Hello " + str.
>
> I tried the IJ.runPlugin(...) command but I cannot get it to run this
> plugin. Basically either ClassNotFoundException or nothing happens.

Did you set the property "plugins.dir" appropriately?  I.e. to point to
the directory containing the .class and/or .jar files defining the
plugins?

Ciao,
Dscho
Reply | Threaded
Open this post in threaded view
|

RE: ImageJ and .Net

sushma569

Hi,

 

Thanks for your quick response.

 

[code]

 java.lang.System.getProperties().setProperty("plugins.dir", "C:\\Program Files\\ImageJ\\plugins\\Examples");

 

IJ.runPlugIn("My_Plugin_HelloWorld", "test");

[/code]

 

This worked and I was able to run the plugin finally.

 

Thanks again.

 

From: Johannes Schindelin (via Nabble) [mailto:[hidden email]]
Sent: Monday, August 31, 2009 1:07 PM
To: Venkatesh, Sushma (S)
Subject: Re: ImageJ and .Net

 

Hi,

On Mon, 31 Aug 2009, sushma569 wrote:

> As a previous post suggested I used IKVM to create a .dll version of
> ImageJ to use in .Net environment.
>
> I have created a simple plugin that takes some string as input and prints
> out "Hello " + str.
>
> I tried the IJ.runPlugin(...) command but I cannot get it to run this
> plugin. Basically either ClassNotFoundException or nothing happens.

Did you set the property "plugins.dir" appropriately?  I.e. to point to
the directory containing the .class and/or .jar files defining the
plugins?

Ciao,
Dscho


View message @ http://n2.nabble.com/ImageJ-and-Net-tp3554710p3554824.html
To unsubscribe from ImageJ and .Net, click here.