Login  Register

Re: programmatically opening a stack from a list of filenames

Posted by Albert Cardona on Apr 02, 2007; 6:27pm
URL: http://imagej.273.s1.nabble.com/programmatically-opening-a-stack-from-a-list-of-filenames-tp3699826p3699827.html

Ben,

What you have listed is generally correct (beware though your code has at least
one parenthesis missing at addSlice).

The easier way: extend ij.plugin.FolderOpener and override the sortFileList to
open the image file sequence like you need.

Even easier: assuming the sortFileList will work as is, just pass macro values
and execute the plugin.

You can see what options to pass if you open the Macro recorder and call the
File / Import / Image Sequence command.

    IJ.run("Image Sequence...", "open=/my/folder/anyfile.tif number=752
starting=1 increment=1 scale=100 file=experiment1");

If you set the folder only, through
Macro.setOptions("open=/my/folder/anyfile.tif");
then only the GenericDialog will open asking for input.
If any of the fields in the GenericDialog is not completed from an option from
the macro engine, then the dialog will show as well.

Albert

--------------------------------------------------------------------
This message was sent using Webmail@INI: https://webmail.ini.ethz.ch