http://imagej.273.s1.nabble.com/redirect-to-imageID-tp3692673p3692678.html
Thanks for the solutions. Using the image title is a good workaround - until, as you say, you have two images open of the same name. I was hoping to avoid this as in the past I'd had trouble using titles with the image calculator menu command - but this was updated to something that could cope with Image IDs.
Looking at the source code now I guess the image calculator was easier to make macro/imageID friendly...
Tony J. Collins, Ph.D.
Dept. Biochemistry and Biomedical Sciences HSC 4H21A
> -----Original Message-----
> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
> Michael Schmid
> Sent: May 5, 2009 12:13 PM
> To:
[hidden email]
> Subject: Re: redirect to imageID
>
> Hi Tony,
>
> sorry, no way to have an ImageID for the Analyze>Set Measurements
> redirect target in a macro.
> In the inner works of ImageJ, it is an ImageID, but you cannot access
> it from a macro. You can only find out whether you have one, by using
> call("ij.plugin.filter.Analyzer.isRedirectImage"):
>
http://rsb.info.nih.gov/ij/source/ij/plugin/filter/Analyzer.java>
> You have to use
> sourceTitle = getTitle();
> on the input image and set the measurement options, e.g.
> run("Set Measurements...", "area mean min redirect=["+ sourceTitle
> +"] decimal=4");
>
> This will fail if you have two open images with the same name.
>
> Michael
> ________________________________________________________________
>
> On 5 May 2009, at 17:13, Tony Collins wrote:
>
> > Hi,
> >
> > I'm duplicating an image, then using this to create a binary/
> > watershed mask to "analyze particles" with the measurements
> > redirected to the original.
> >
> > This works well but I'd like to batch process a folder of these
> > images. Is there a way to "redirect to" an image ID rather than
> > image name?
> >
> > Thanks,
> >
> > Tony