Different results from setBatchMode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Different results from setBatchMode

Pang, Zhengyu (GE Global Research)
Dear all,
 
I noticed that I got different composite images when I used
setBatchMode(false) or setBatchMode(true). The macro is as follows:
 
 
setBatchMode(false)
open(");        
open( "");    
 open("");
       run("Images to Stack", "title=[]");
       run("Make Composite", "display=Composite");
       setSlice(1);
       run("Red");
       setMinAndMax(100, 1200);
       setSlice(2);
       run("Green");
       setMinAndMax(0, 500);    
       setSlice(3);
       run("Blue");
       setMinAndMax(100, 2000);    
       saveAs("jpeg", ImageName);
 
This macro works only if I use false as a parameter for setBatchMode
function. If I use true, I noticed that setMinAndMax function does not
work at all. Is this because that you have to open images in order to
set Min and Max for displaying purpose? As the use of true parameter can
save you a lot of time, is there any way that I can use "true" and still
adjust each channel differently. Here the green channel is especially
dark.
 
Thanks,
 
Zhengyu
 
 
 

Dr. Zhengyu Pang

Biochemistry and Biological Engineering Laboratory

GE Global Research

Biosciences Global Technology Organization

T +1 518 387 4015

M +1 919 724 7116

F +1 518 387 7765

[hidden email]

One Research Circle

Niskayuna, NY 12309

GE imagination at work

 
 

Dr. Zhengyu Pang

Biochemistry and Biological Engineering Laboratory

GE Global Research

Biosciences Global Technology Organization

T +1 518 387 4015

M +1 919 724 7116

F +1 518 387 7765

[hidden email]

One Research Circle

Niskayuna, NY 12309

GE imagination at work

 
Reply | Threaded
Open this post in threaded view
|

Re: Different results from setBatchMode

Krs5
Dear list,

I seem to have the same type of problem in a macro I work on to measure dots in nuclei. I get different results when run in true and false mode. I have not been able to nail down the problem yet but one thing I noticed is that if I select a nucleus in the DAPI channel and put the ROI in the ROI manager, take the FITC channel and threshold the signal followed by adding the ROI from the manager, it does not seem to work and takes the dots from the whole FITC image. If I first put the ROI and then do the thresholding, it works (but the dots obtained in this way are too large when using the default setting for threshold). This might be all related issues?

Kees
 

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Pang, Zhengyu (GE Global Research)
Sent: 19 October 2010 16:31
To: [hidden email]
Subject: Different results from setBatchMode

Dear all,
 
I noticed that I got different composite images when I used
setBatchMode(false) or setBatchMode(true). The macro is as follows:
 
 
setBatchMode(false)
open(");        
open( "");    
 open("");
       run("Images to Stack", "title=[]");
       run("Make Composite", "display=Composite");
       setSlice(1);
       run("Red");
       setMinAndMax(100, 1200);
       setSlice(2);
       run("Green");
       setMinAndMax(0, 500);    
       setSlice(3);
       run("Blue");
       setMinAndMax(100, 2000);    
       saveAs("jpeg", ImageName);
 
This macro works only if I use false as a parameter for setBatchMode
function. If I use true, I noticed that setMinAndMax function does not
work at all. Is this because that you have to open images in order to
set Min and Max for displaying purpose? As the use of true parameter can
save you a lot of time, is there any way that I can use "true" and still
adjust each channel differently. Here the green channel is especially
dark.
 
Thanks,
 
Zhengyu
 
 
 

Dr. Zhengyu Pang

Biochemistry and Biological Engineering Laboratory

GE Global Research

Biosciences Global Technology Organization

T +1 518 387 4015

M +1 919 724 7116

F +1 518 387 7765

[hidden email]

One Research Circle

Niskayuna, NY 12309

GE imagination at work

 
 

Dr. Zhengyu Pang

Biochemistry and Biological Engineering Laboratory

GE Global Research

Biosciences Global Technology Organization

T +1 518 387 4015

M +1 919 724 7116

F +1 518 387 7765

[hidden email]

One Research Circle

Niskayuna, NY 12309

GE imagination at work

 
Reply | Threaded
Open this post in threaded view
|

Re: Different results from setBatchMode

BenTupper
In reply to this post by Pang, Zhengyu (GE Global Research)
Hi,

Sometimes, when running in batchmode, it seemes that ImageJ can get  
ahead of itself.  One thing you might try to resolve this is to  
capture the ID of each image as created and then explicitly select  
that image before operating upon it.  In the past, that has resolved  
these kinds of issue for me.  For example...

run("Red");
redID = getImageID();
selectImage(redID);
setMinAndMax(100,200);


There may be other issues here, but I think it is worth trying to  
control the active image using getImageID and selectImage.

Cheers,
Ben


On Oct 19, 2010, at 11:30 AM, Pang, Zhengyu (GE Global Research) wrote:

> Dear all,
>
> I noticed that I got different composite images when I used
> setBatchMode(false) or setBatchMode(true). The macro is as follows:
>
>
> setBatchMode(false)
> open(");
> open( "");
> open("");
>       run("Images to Stack", "title=[]");
>       run("Make Composite", "display=Composite");
>       setSlice(1);
>       run("Red");
>       setMinAndMax(100, 1200);
>       setSlice(2);
>       run("Green");
>       setMinAndMax(0, 500);
>       setSlice(3);
>       run("Blue");
>       setMinAndMax(100, 2000);
>       saveAs("jpeg", ImageName);
>
> This macro works only if I use false as a parameter for setBatchMode
> function. If I use true, I noticed that setMinAndMax function does not
> work at all. Is this because that you have to open images in order to
> set Min and Max for displaying purpose? As the use of true parameter  
> can
> save you a lot of time, is there any way that I can use "true" and  
> still
> adjust each channel differently. Here the green channel is especially
> dark.
>
> Thanks,
>
> Zhengyu
>
>
>
>
> Dr. Zhengyu Pang
>
> Biochemistry and Biological Engineering Laboratory
>
> GE Global Research
>
> Biosciences Global Technology Organization
>
> T +1 518 387 4015
>
> M +1 919 724 7116
>
> F +1 518 387 7765
>
> [hidden email]
>
> One Research Circle
>
> Niskayuna, NY 12309
>
> GE imagination at work
>
>
>
>
> Dr. Zhengyu Pang
>
> Biochemistry and Biological Engineering Laboratory
>
> GE Global Research
>
> Biosciences Global Technology Organization
>
> T +1 518 387 4015
>
> M +1 919 724 7116
>
> F +1 518 387 7765
>
> [hidden email]
>
> One Research Circle
>
> Niskayuna, NY 12309
>
> GE imagination at work
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Different results from setBatchMode

Janne Hyötylä
Hi all,

On Thu, 21 Oct 2010 14:43:54 +0200, Ben Tupper <[hidden email]>  
wrote:

> Hi,
>
> Sometimes, when running in batchmode, it seemes that ImageJ can get  
> ahead of itself.  One thing you might try to resolve this is to capture  
> the ID of each image as created and then explicitly select that image  
> before operating upon it.  In the past, that has resolved these kinds of  
> issue for me.  For example...
>
> run("Red");
> redID = getImageID();
> selectImage(redID);
> setMinAndMax(100,200);
>
>
> There may be other issues here, but I think it is worth trying to  
> control the active image using getImageID and selectImage.

Do other people have experience or opinions about this?

So far I didn't actually think of selecting the desired image, but relied  
on the principle that if in "manual mode" (i.e. by going through the  
menus) the correct image is automatically selected after an operation, it  
will also be in a macro with setBatchMode(true). Maybe that's a wrong  
assumption...?

Cheers,

Janne