On 23 February 2010 16:41, Søren Hauberg <so...@hauberg.org> wrote: > If I understand things correctly, you can currently do > > I = imread ("myfile.tif", 7); > > after which 'I' will contain the 7th frame of "myfile.tif". Hence, the > class of 'I' is an array. > > The obvious extension is to allow for > > J = imread ("myfile.tif", 3:5); > > which would then return frames 3, 4 and 5 in a cell array. The problem > is then that the class of the output depends on how many frames the user > asks for. If the user asks for one frame, she would get an array (for > Matlab compatibility), but if she asks for more than one frame the > result is a cell array. This will most likely be the cause of great > confusion and many bugs. > > One solution would be to do something like > > [J1, J2, J3] = imread ("myfile.tif", 3:5); > > but then you have to know how many frames you are asking for in advance, > which really isn't that great. > > Any thoughts on how to deal with this? > > Søren > >
What about place it in a different function, something like 'multimread'. Would that be easier and solve confusion problems? Alternatively, maybe a parameter to make it read a range of (or all) frames that would read only the first one if not mentioned imread(file) <--- would be the same as imread(file, 'single') imread(file, 'multipage') <--- read all frames imread(file, 'multipage', 3:5) <-- read range of frames 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