Login  Register

Re: redirect to imageID

Posted by Tony Collins-4 on May 05, 2009; 8:24pm
URL: http://imagej.273.s1.nabble.com/redirect-to-imageID-tp3692673p3692678.html

Hi Michael, (and thanks to Guanghua too),

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...

Cheers,

Tony
 
Tony J. Collins, Ph.D.
McMaster Biophotonics Facility
Dept. Biochemistry and Biomedical Sciences HSC 4H21A
McMaster University, Hamilton, ON, L8N 3Z5
[hidden email]     www.macbiophotonics.ca


> -----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