Posted by
Michael Schmid on
Jun 01, 2010; 1:20pm
URL: http://imagej.273.s1.nabble.com/possible-bug-in-the-redirect-to-option-in-Set-Measurements-tp3688112p3688113.html
Hi Tamjid,
you can refer to an image by name only if the WindowManager knows
about it - that's the only place where a list of all images and their
name is kept.
If you create a new ImagePlus and don't show it, the WindowManager
(and no one else except your plugin) will know about its existence.
Then, you can't access it by its name.
So it is no bug, it has to be like that.
Instead of giing the name, you have to use the following method in
ij.plugin.filter.Analyzer:
/** Set the "Redirect To" image. Pass 'null' as the argument to
disable redirected sampling. */
public static void setRedirectImage(ImagePlus imp)
Michael
________________________________________________________________
On 1 Jun 2010, at 14:11, Tamjid wrote:
> Dear All
>
> I was trying to use the "redirect to" option available in
> the "set
> Measurements" to work with image file,
> but it did not. But, when I opened the image window (i.e used
> imp.show()) it worked.
>
> I was using:
>
> IJ.run("Set Measurements...", "area mean min shape
> redirect="+imp1.getTitle()+" decimal=9");
> or,
> IJ.run("Set Measurements...", "area mean min shape
> redirect="+imp.getTitle()+".tif decimal=9");
>
> Even converted the image into 8 bit assuming 'Gray' min max and
> mean will
> not work - ... but worked once used imp.show() before calling the
> above
> line.
>
>
> Any help or update, please.
>
> Thanks
> Tamjid