Re: Multipage image processing [message #68709] |
Tue, 17 November 2009 05:48 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Wox writes:
> I'm writing a program that processes multipage images (i.e. each file
> contains typically 1000 images of size 1024x1024). I would like some
> ideas on how to handle this:
> 1. Read the 1000x1024x1024 datablock in memory and start processing
You have got to be kidding!
> 2. Use ASSOC to associate a 3D array to the file and then process the
> array as if it would be in memory
I don't know what "as if it would be in memory" means here. The
point of an associated variable is that you read and process only
the image or images you need, as you need them. This is the most
efficient I/O of your three choices.
> 3. Read the separate 1024x1024 images as you are processing them
> (read, process, read, process,...) keeping the file open in the
> process (or maybe not, file might be on the network and connection
> might be broken)
If you keep the file open, this is not really any different from
the ASSOC method. If you open and close the file, it will be
significantly slower than the ASSOC method. If you leave the file
open, you can move through the file with POINT_LUN, which is,
essentially, what ASSOC does for you.
> I think 2 or 3 are the better options because I can't be sure that the
> 3D datablock will always fit into memory. As for option 2, are there
> memory limitations? Is it faster/slower than option 3?
As far as I know, there are no memory limitations with the ASSOC
method, except the usual that 32-bit operating systems throw in
your way.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|