Login  Register

Stack to Hyperstack batch macro

Posted by ky730 on Jun 07, 2014; 3:43am
URL: http://imagej.273.s1.nabble.com/Stack-to-Hyperstack-batch-macro-tp5008083.html

Hi,

I just started to learn writing ij macros.

I'm trying to create a macro to batch process "Stack to Hyperstack" on all the files in a folder, using the following command:

run("Stack to Hyperstack...", "order=xyczt(default) channels=3 slices=7 frames=?? display=Color");

You notice "frame=??". This is the part that I don't know how to work on. The problem is the files (as stacks) are made up of 3 channels, 7 z-slices, BUT with different number of time frames. Is there a way that I could write a command to automatically count the number of frames (i.e. divide the total number of slices by 21 (3 channels x 7 z-slices))?

Thanks very much.

Kian