I easily want to save an image stack with imwrite:
for i=1:60
imwrite(ImStack(:,:,i),'file.tif','WriteMode','append','Compression','none');
end
This code works fine on another machine with Matlab 2009b (Win XP, x86). On mine with Matlab 2010b 64bit (Win7 64), there occurs an error while saving the image.
??? Error using ==> imwrite at 453
Can't open file "C:/.../stackadd/file.tif" for
writing.
You may not have write permission.
Error in ==> stackadd at 61
imwrite(ImStack(:,:,i),'file.tif','WriteMode','append','Compression','none');
This error does not occur every time. When I restart Matlab the script mostly runs fine (at the beginning of the script, the existance of the output file is checked and the file is deleted where applicable). But during the second run there comes this error. It is not reproducable at one special "i". Sometimes the "i" is lower, sometimes higher.
The final image "file.tif" contains those stacks before the error. Thus, the error can't be an issue with permissions.
Hope you can help me... !
http://blogs.mathworks.com/steve/2010/11/09/the-mystery-of-the-failing-tiff-append-loop/
"Jens" wrote in message <ihmqdm$9v9$1...@fred.mathworks.com>...