Posted by
Joachim Wesner on
Mar 20, 2009; 5:02pm
URL: http://imagej.273.s1.nabble.com/Images-to-stack-in-batch-mode-tp3693222p3693229.html
Thanks Wayne,
again, extremely fast and exactly on the point!!
Actually, I did not really want to display that temporary ImagePlus at all,
but was forced to do so for the other plugin to work,
as I overlooked the alternative method you mention!
I changed my code and left the display of that mask window as a debug
option, works great now!
Thanks again!
Cheers
Joachim
Leica Microsystems CMS GmbH | GmbH mit Sitz in Wetzlar | Amtsgericht
Wetzlar HRB 2432
Geschäftsführer: Dr. Stefan Traeger | Dr. Wolf-Otto Reuter | Dr. David Roy
Martyr | Colin Davis
ImageJ Interest Group <
[hidden email]> schrieb am 20.03.2009 17:08:54:
> Images are displayed in a thread separate from the thread used to run
> plugins, so it would be better not to display the image until you have
> finished processing it. With macros, you can easily do this by running
> in batch mode. JavaScripts and plugins can run plugins or commands on
> images that are not displayed using
>
> IJ.runPlugIn(ImagePlus, className, arg)
>
> or
>
> IJ.run(ImagePlus, command, options)
>
> Here is and updated version of your example that does not display the
> image until it has finished:
>
> bProc.dilate(); bProc.dilate();
> bProc.erode(); bProc.erode();
> ImagePlus impb = new ImagePlus("Zygo phase mask - "+file, bProc);
> createSelectionFromMask(impb);
> impb.show();
> .
> .
> .
> void createSelectionFromMask(ImagePlus imp) {
> ImageProcessor ip = imp.getProcessor();
> ip.setThreshold(0, 0, ImageProcessor.NO_LUT_UPDATE);
> IJ.runPlugIn(imp, "ij.plugin.filter.ThresholdToSelection", "");
> }
>
> -wayne
>
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit
http://www.messagelabs.com/email
______________________________________________________________________