简体   繁体   中英

Re-opening ImagePlus file (imageJ)

I'd like to re-open an ImagePlus file I already called using show().

That is, I already called

imp.show() 

I closed the window containing the image, but now I'd like to re-open the ImagePlus file in another window (via code). Unfortunately, calling imp.show() again doesn't work. Any ideas on how I can re-open it in a new ImageJ window?

A search in the ImageJ mailing list gives you the answer (by Michael Schmid):

Closing an ImageWindow ( ImageWindow.close ) calls imp.flush() , which
deletes many class variables of the imp (essentially everything that
needs significant amounts of memory is set to null).

and suggests a possible solution:

If you don't have a stack, a solution would be keeping a reference to
the ImageProcessor in the imp and keep it instead of imp (also the
roi). If you have no stack, you could also try to clone the ImagePlus
to get a copy that can be displayed again - memory consumption for
cloning would be rather low ('shallow cloning').

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM