Hi Wayne

Thank you for your reply.
Since I was doing this in python, I did the following

impList = []
for path in sorted(paths):
    impList.append(ImagePlus(path))

stackImp = ImagesToStack.run(impList)

where paths is a list of image files in some directory. This uses memory, but I have enough memory to handle it.

Best regards
--aryeh

On 08/05/2024 7:46 pm, Wayne Rasband wrote:
Hi Aryeh,

You can use a simple macro like the following to open a folder of images that 
differ in size as a stack. There is no significant  increase in time or memory 
usage when using batch mode.

  setBatchMode(true);
  dir = getDir("Choose a Directory ");
  File.openSequence(dir, " open");
  run("Images to Stack", "method=[Copy (top-left)] use");
  setBatchMode(false);

-wayne

On May 6, 2024, at 4:41 AM, Aryeh Weiss<[email protected]>  wrote:

Import image sequence is invoked when I drag and drop a directory containing 
images into ImageJ.

One problem that I have is that it assumes all of the image are the same size 
as the first  image. Therefore, it will only import images  of that size, and 
ignore all of the others, with an error message that the expected size was not 
found.

One the other hand, the Images to Stacks command will ask how to adjust the 
images (centered, cropped, etc) and then create the stack.

Can this capability be added to the FileOpener class ?

The workaround is to load up a list of ImagePlus and then send that to 
ImagesToStack, but that is less convenient, and may require more memory since 
the list of ImagePlus must first be loaded, and then made into a stack.

Thanks in advance for considering this request.

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


--
--aryeh
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
+972-3-5317638

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

Reply via email to