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/");
labels = IJ.openImage("C:/Users/Lenovo/Desktop/GitHub/Segmentation/");
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:"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