Login  Register

Re: Mac vs Windows VirtualStack behaviour

Posted by Wayne Rasband-2 on Jun 27, 2019; 4:31pm
URL: http://imagej.273.s1.nabble.com/Mac-vs-Windows-VirtualStack-behaviour-tp5022264p5022292.html

> On Jun 27, 2019, at 4:19 AM, otills <[hidden email]> wrote:
>
> Thanks Wayne.
>
> The second approach of looping over a list seems most appropriate in this
> instance. However, if each image in the list is from a different directory
> how should we deal with this for the 'dir' argument in the VirtualStack
> constructor?

The following JavaScript example opens images in different directories as a virtual stack. It requires the ImageJ 1.52q3 daily build, which fixes a bug that caused the images to not open if the ‘path’ argument in the VirtualStack constructor was an empty string.

-wayne

  list = [
     "C:/Users/rasba/images/dir1/image.tif",
     "C:/Users/rasba/images/dir2/image.tif",
     "C:/Users/rasba/images/dir3/image.tif"
  ]
  img = IJ.openImage(list[0]);
  stack = new VirtualStack(img.getWidth(),img.getHeight(),null,"");
  for (i=0; i<list.length; i++)
     stack.addSlice(list[i]);
  vstack = new ImagePlus("Virtual Stack",stack);
  vstack.show();

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html