On 23 February 2010 15:43, David Grundberg <dav...@cs.umu.se> wrote: > > I don't know if the underlaying tiff library supports reading single frames. > > One way to work-around any frame loading problem is to make sure that all > frames are loaded at once in one imread call. Maybe imread should read all > frames available if there is only one argument. Maybe imread should be made > to accept ":" as a frame index and load all available frames only then. > > David >
David I think that would be great. Would save, at least for me, loads of time. From what I see in other labs with matlab, the default is always to have a separate function that checks the number of frames and then loads all of them in a for loop. I've also seen to use the info from imfinfo given as an argument to imread which is supposed to speed up imread. I I don't know how worried the development is when it comes to keep compatibility with matlab. I, for one, would like to load all frames with only one imread. To have a range of frames as an optional argument would also be very handy. While that is not implemented, I'll share my workaround in case someone has the same problem. Basically I just save each frame as a separate tif file (ImageJ added this option recently, no need for a plug-in in File>Save as>Image sequence), and load each of them in octave file_path = regexprep(file_path, "0000", ""); for iImg = 1:nFrames mod = sprintf("%0.4d", iImg-1); mod_file_path = regexprep(file_path, ".tif$", [mod, ".tif"]); imStack(iImg).data = imread(mod_file_path); endfor It's not the most general thing but can be changed easily and reduces time of analysis from almost 4 hours to less than 3min :) Carnë ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev