make settings in the IJ.doCommand("..."); - or IJ.run("..."); -command of a plugin

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

make settings in the IJ.doCommand("..."); - or IJ.run("..."); -command of a plugin

Silke 1
Dear all,

My main problem is to make settings in a separate window that opens when I use the IJ.doCommand(“e.g. Set Measurements…”); or IJ.run(“Set Measurements…”);  in a plugin.


I’ve got a lot of images to analyze, and I’d like to write a Plugin, that does the following things:

1. selects some relevant items I want to measure at Analyze->Set Measurements
2. sets the threshold and scale
3. runs “Analyze Particles with the following settings:
size=0-Infinity
circularity=0.00-1.00
show=Outlines display
I can do this in a macro by using
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Outlines display");,
but in a plugin, I cannot add the settings to the command
run("Analyze Particles...");
or
IJ.doCommand("Analyze Particles...");
4. Saves the data with the plugin “Excel Writer”,
Again I can do this in a macro, but don’t know how it works for a plugin:
run("Excel...", "select...=[C:\\Users\\Silökre\\Desktop\\ImageJ Lunkeranteil.xls]");


I tried to use the plugin example “IP Demo” that comes along with ImageJ, and tried to copy my macro into the “macro 1”, but the command
run("Excel...", "select...=[C:\\Users\\....xls]");
        didn’t work either.


Does anybody know what I have to do here?
Thanks a lot!

Regards

Silke

--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
Reply | Threaded
Open this post in threaded view
|

Re: make settings in the IJ.doCommand("..."); - or IJ.run("..."); -command of a plugin

Gabriel Landini
On Saturday 05 September 2009, [hidden email] wrote:
> I’ve got a lot of images to analyze, and I’d like to write a Plugin, that
>  does the following things:

Sorry to ask, why a plugin? You have a 2 or 3 lines macro that does what you
want. My take on this is that plugins are useful extensions for doing things
not currently available, but writing a plugin that just calls the commands
already existent and callable from a macro, may not give you a big advantage.

There are some technical reasons why you may want to use a plugin instead,
like thread safety. However if you just want to analyse some images, I would
use the extra time that will take writing and debugging the plugin to analyse
the images with the already existing macro.

Anyway, to run the particle analyzer in a plugin, you need to call the
ParticleAnalyzer class with your image's ImageProcessor.

Have a look here:
http://rsb.info.nih.gov/ij/developer/api/ij/plugin/filter/ParticleAnalyzer.html

Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: make settings in the IJ.doCommand("..."); - or IJ.run("..."); -command of a plugin

Silke 1
Thank you,

I'll try it.
Reply | Threaded
Open this post in threaded view
|

Re: make settings in the IJ.doCommand("..."); - or IJ.run("..."); -command of a plugin

Silke 1
Silke 1 wrote
Thank you,

I'll try it.


Dear all,

I saved the “ExcelWriter.jar” plugin into my ImageJ folder „C:\Programme\ImageJ\plugins”, and I’d like to import it now into a new plugin. This doesn’t work with the common
“import ExcelWriter.jar” or “package ExcelWriter.*” command or something like that.
Does anyone know how to import the ExcelWriter into a new plugin?
(I’ve read something about a CLASSPATH C:\Programme\ImageJ\plugins command in the javac compiler, but don’t know where to put this into ImageJ).

Reagrds
Silke

Reply | Threaded
Open this post in threaded view
|

importing ExcelWriter

Michael Schmid
Hi Silke,

if you look at the ExcelWriter sources, there are no 'package'  
statements in it, so there is nothing to import.
If your plugin it does not compile correctly, place the ExcelWriter  
sources into the same directory. You can delete the .class files  
belonging to ExcelWriter afterwards.

A simple way to get the sources: rename ExcelWriter.jar to  
ExcelWriter.zip, then you can open it with any zip utility.

[BTW, for a new topic in the mailing list, please use a new and  
appropriate subject for the e-mail.]

Michael
________________________________________________________________

On 16 Sep 2009, at 08:48, Silke 1 wrote:

> Dear all,
>
> I saved the “ExcelWriter.jar” plugin into my ImageJ folder
> „C:\Programme\ImageJ\plugins”, and I’d like to import it now into a  
> new
> plugin. This doesn’t work with the common
> “import ExcelWriter.jar” or “package ExcelWriter.*” command or  
> something
> like that.
> Does anyone know how to import the ExcelWriter into a new plugin?
> (I’ve read something about a CLASSPATH C:\Programme\ImageJ\plugins  
> command
> in the javac compiler, but don’t know where to put this into ImageJ).
>
> Reagrds
> Silke