Friday 21 March 2014

Image Sequence in ImageJ


Creates a new image window or stack. A dialog box allows you to specify the image title, type, dimensions and initial content.
Name is the title that will be used for the Window. Type is the image type: 8-bit grayscale, 16-bit grayscale (unsigned), 32-bit (float) grayscale or RGB color. Fill With (White, Black or Ramp) specifies how the image is initialized. Width and Height specify the image dimensions in pixels. Set Slices to a value greater than one to create a stack.



import ij.IJ;
import ij.ImagePlus;
import ij.WindowManager;

public class TestImp {

    public static void main(String[] args) {

        IJ.run("Image Sequence...", "open=C:\tempfiles");

        // "open=C:\tempfiles number=2 starting=1 increment=1 scale=100 file=[] or=[] sort");

        ImagePlus imagePlus = WindowManager.getCurrentImage();

        System.out.println(imagePlus.getStackSize());

    }
}

No comments: