Login  Register

Plugin synchronization (especially?) on multi core systems...

Posted by Joachim Wesner on Mar 20, 2009; 3:15pm
URL: http://imagej.273.s1.nabble.com/Images-to-stack-in-batch-mode-tp3693222p3693227.html

Hi list,

I seem to remember there were related entries in the list (archives) here,
but it seems I cannot find the right entries/keyword in the moment....

I´m working on a plugin that seems to show erratic behaviour on my new fast
dual core system. I think I "nailed" the problem down to the
point where I call an external plugin to do some extra processing on an
internal image that I create (and usually close again after).

The task here is to create a circular ROI from interferometer mask data +
some hole filling
.
.
.
            bProc.dilate(); bProc.dilate();
            bProc.erode(); bProc.erode();
            ImagePlus impb = new ImagePlus("Zygo phase mask - "+file,
bProc);
            impb.updateAndRepaintWindow();
            impb.show();
//          IJ.wait(200);
            createSelectionFromMask(bProc);
.
.
.
.
      void createSelectionFromMask(ImageProcessor ip) {
            ip.setThreshold(0, 0, ImageProcessor.NO_LUT_UPDATE);
            IJ.runPlugIn("ij.plugin.filter.ThresholdToSelection", "");
      }


It only works if I really shortly "show" the ImagePlus impb before calling
createSelectionFromMask,, OK, I can accept that, as it´s another
plugin, that I use.

HOWEVER,

Without the added IJ.wait it seems that often on the new fast, dual core
system, the other plugin already runs *BEFORE* the image is "shown", so it
will cease to work.
Inserting the short delay of 200-500 ms seems to cure the problem for the
moment, but I wonder if there is a better solution!?


Sincerely

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


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________