Login  Register

Re: Saving Virtual Stack as .avi causes Exception

Posted by dscho on Nov 20, 2009; 11:36am
URL: http://imagej.273.s1.nabble.com/Saving-Virtual-Stack-as-avi-causes-Exception-tp3690396p3690400.html

Dear Ingo,

On Fri, 20 Nov 2009, Ingo Bartholomaeus wrote:

> My previous posting was a little misleading: The error ONLY occurred if
> I try to overwrite the source file. This however is not really
> surprising as the data type is "virtual stack". But it would be better
> if ImageJ did not damage the source file, but instead converts the
> virtual to a normal stack upon saving, in case the user wants to
> overwrite the source file.

Ah, that explains the error.  You are changing the data of a virtual stack
behind its back.

Now, I would like to convince you that converting a virtual to a normal
stack upon saving is not a good idea.  Imagine a real-life scenario here:
a .avi file which is 4.2G in size, so that you cannot possibly open it on
a 32-bit Windows computer, except as a virtual stack.  So what you propose
would just throw an out-of-memory error.

And now I would like to convince you that it is not a good idea to
overwrite the original file to begin with: it is always possible that you
run out of quota, or that there is a write error which ImageJ cannot
recover from, and in those cases, you would have lost your original data
anyway, without any way for ImageJ to prevent that.

So I would like to suggest that you save to a new name and only after that
was successful, delete the original file and rename the new file.  It is
even possible to do that in a simple macro.

Ciao,
Johannes