Re: Collate PlotWindows into a stack
Posted by
Albert Cardona on
May 16, 2008; 2:42am
URL: http://imagej.273.s1.nabble.com/Collate-PlotWindows-into-a-stack-tp3696195p3696198.html
> Thank you for the help. However, I dont think this way will work for
> me, because the plots are not generated all at once. The following
> class is in the plugin and is used to plot the results. As I use the
> plugin multiple times I wind up with numerous "PSD Sum" windows, but
> they are not all generated at one time.
You have then several options.
1) reshape your code so that you can capture them
or:
2) scan WindowManager for windows that are instances of PlotWindow. For
example:
int[] ids = WindowManager.getIDList();
for (int i=0; i<ids.length; i++) {
ImagePlus imp = WindowManager.getImage(ids[i]);
if (imp.getWindow() instanceof PlotWindow) {
// Add this window to the list of PlotWindow to put into a stack
// ...
}
}
Ideally you'd run this when done generating all.
Albert
--
Albert Cardona
http://www.mcdb.ucla.edu/Research/Hartenstein/acardona