batch mode

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

batch mode

Frank Sprenger
Hello,
I have several problems with Macros that run in BatchMode(false), but not in BatchMode(true). I have seen several postings about that issue already but I am not sure what the problem is in my case.

I am running 1.45b in 64bit mode.

Here is one example of a macro running only in BathMode(false). When running in BatchMode(true), I am only getting black images for ch2 and ch3. The original image is a 32bit (sum-projection) hyperstack with three channels and 30 frames.
Is there a problem with 32bit images???

Thanks for your input.

Frank



setBatchMode(true);

run("Duplicate...", "title=hyper duplicate");

selectWindow("hyper");
Stack.setChannel(1);
run("Reduce Dimensionality...",  "  frames keep");
rename("ch1");
run("Grays");

selectWindow("hyper");
Stack.setChannel(2);
run("Reduce Dimensionality...", "  frames keep");
rename("ch2");
run("Grays");
       
selectWindow("hyper");
Stack.setChannel(3);
run("Reduce Dimensionality...", "  frames keep");
rename("ch3");
run("Grays");

setBatchMode("exit & display");
Reply | Threaded
Open this post in threaded view
|

Re: batch mode

Frank Sprenger
Hello,
sorry, in the macro the conversion to 8 bit was missing which I have included now.

The problem in batch mode is that the resulting window after reduce dimensionality has lost the scaling that I have applied (and want to keep) of the hyperstack.

Thanks for your input.

Frank



setBatchMode(true);

run("Duplicate...", "title=hyper duplicate");

selectWindow("hyper");
Stack.setChannel(1);
run("Reduce Dimensionality...",  "  frames keep");
rename("ch1");
run("Grays");
run("8-bit");

selectWindow("hyper");
Stack.setChannel(2);
run("Reduce Dimensionality...", "  frames keep");
rename("ch2");
run("Grays");
run("8-bit");
       
selectWindow("hyper");
Stack.setChannel(3);
run("Reduce Dimensionality...", "  frames keep");
rename("ch3");
run("Grays");
run("8-bit");

setBatchMode("exit & display");
Reply | Threaded
Open this post in threaded view
|

Re: batch mode

Jerome Mutterer-3
Hi Frank,

You could use the "Duplicate..." command instead of "Reduce Dimensionality".
The Duplicate command works with hyperstacks.

extracting a channel would read:

selectWindow("hyper");

c=1;
run("Duplicate...", "title=ch"+c+" duplicate channels="+c+"-"+c+"
frames=1-30");

If you need all channels anyway, you might also want to just use the "Split
Channels..." command.

Jerome


On Mon, Mar 7, 2011 at 3:28 PM, Frank Sprenger <
[hidden email]> wrote:

> Hello,
> sorry, in the macro the conversion to 8 bit was missing which I have
> included now.
>
> The problem in batch mode is that the resulting window after reduce
> dimensionality has lost the scaling that I have applied (and want to keep)
> of the hyperstack.
>
> Thanks for your input.
>
> Frank
>
>
>
> setBatchMode(true);
>
> run("Duplicate...", "title=hyper duplicate");
>
> selectWindow("hyper");
> Stack.setChannel(1);
> run("Reduce Dimensionality...",  "  frames keep");
> rename("ch1");
> run("Grays");
> run("8-bit");
>
> selectWindow("hyper");
> Stack.setChannel(2);
> run("Reduce Dimensionality...", "  frames keep");
> rename("ch2");
> run("Grays");
> run("8-bit");
>
> selectWindow("hyper");
> Stack.setChannel(3);
> run("Reduce Dimensionality...", "  frames keep");
> rename("ch3");
> run("Grays");
> run("8-bit");
>
> setBatchMode("exit & display");
>
Reply | Threaded
Open this post in threaded view
|

Re: batch mode

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Frank Sprenger
On Mar 7, 2011, at 8:13 AM, Frank Sprenger wrote:

> Hello,
> I have several problems with Macros that run in BatchMode(false), but not in BatchMode(true). I have seen several postings about that issue already but I am not sure what the problem is in my case.
>
> I am running 1.45b in 64bit mode.
>
> Here is one example of a macro running only in BathMode(false). When running in BatchMode(true), I am only getting black images for ch2 and ch3. The original image is a 32bit (sum-projection) hyperstack with three channels and 30 frames.
> Is there a problem with 32bit images???

The bugs that caused these problems are fixed in the 1.45d1 daily build. You can upgrade by using the Help>Update ImageJ command and selecting "daily build" from the drop down menu.

-wayne


> setBatchMode(true);
>
> run("Duplicate...", "title=hyper duplicate");
>
> selectWindow("hyper");
> Stack.setChannel(1);
> run("Reduce Dimensionality...",  "  frames keep");
> rename("ch1");
> run("Grays");
>
> selectWindow("hyper");
> Stack.setChannel(2);
> run("Reduce Dimensionality...", "  frames keep");
> rename("ch2");
> run("Grays");
>
> selectWindow("hyper");
> Stack.setChannel(3);
> run("Reduce Dimensionality...", "  frames keep");
> rename("ch3");
> run("Grays");
>
> setBatchMode("exit & display");