Opening a datastack

How can I open a data stack using a beanshell script?

import ij.IJ;
import trainableSegmentation.WekaSegmentation;

// import images
image = IJ.openImage("C:/Users/Lenovo/Desktop/GitHub/Segmentation/Fiji.app/data/testdata/original/1200.tif");
labels = IJ.openImage("C:/Users/Lenovo/Desktop/GitHub/Segmentation/Fiji.app/data/testdata/ground_truth/1200.tif");
nSamplesToUse = 2;

The above code can open just one image but I need to open an entire stack. I am pretty sure its something really silly. Can someone help me out with this?

For instance for a folder of images as a stack:

IJ.run("Image Sequence...", "open=C:/Users/bio7/Desktop/images/");

However you left out some crucial information. Do you have a stack as one *.tif file
or a folder of images (where my example is suited)?

1 Like