Login  Register

Re: batch mode

Posted by Jerome Mutterer-3 on Mar 07, 2011; 3:01pm
URL: http://imagej.273.s1.nabble.com/batch-mode-tp3685405p3685408.html

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");
>