11-27-2007 02:05 PM
11-27-2007 03:30 PM
I'll try to get the ball rolling here -- hopefully there's some better ideas than mine out there.
1. I've never used IMAQ, but I suspect that it offers more efficient methods than stuff I dream up in standard LabVIEW. Of course, maybe you don't use it either -- just sayin'...
2. Since you can't make a contiguous 11000-image 3D array, and don't know how to manage 11000 individual 2D arrays, how about a compromise? Like, say, 11 3D arrays holding 1000 images each? Then you just need ~50 MB chunks of contiguous memory.
3. I'm picturing a partially hardcoded solution in which there are a bunch of cloned "functional globals" which each hold 1000 images of data. This kind of thing can be done using (A) Reentrant vi's or (B) Template vi's. You may need to use VI Server to instantiate them at run-time.
4. Then I'd build an "Action Engine" wrapper around that whole bunch of stuff. It'd have an input for image #, for example, image # 6789. From there it would do a quotient & remainder with 1000 to split 6789 into a quotient of 6 and remainder of 789. Then the wrapper would access function global #6 and address image # 789 from it.
5. Specific details and trade offs depend a lot on the nature of your data processing. My assumption was that you'd primarily need random access to images 1 or 2 at a time.
I hope to learn some better ideas from other posters...
-Kevin P.
P.S. Maybe I can be one of those "other posters" -- I just had another idea that should be much simpler. Create a typedef custom control out of a cluster which contains a 2D image array. Now make an 11000 element array of these clusters. If I recall correctly, LabVIEW will allocate 11000 pointers. The clusters that they point to will *not* need to be contiguous one after the other. Now you can retrieve an image by indexing into the array of 11000 clusters and simply unbundling the 2D image data from the cluster element.
11-27-2007 04:57 PM
11-27-2007 09:00 PM
11-28-2007 07:26 AM
Another option is to use single-element queues to hold each of your images. Store the queue references in an array. To use the image, select the queue reference from the array, dequeue the image, process, then enqueue so you don't lose the data. This method takes full advantage of fragmented memory. It also takes advantage of the fact that dequeueing a single-element queue does not cause a memory copy, so it should be fast. If you need more details, let me know.
11-28-2007 09:11 AM
11-29-2007 08:27 AM
11-29-2007 09:10 AM - edited 11-29-2007 09:11 AM
11-29-2007 10:18 AM
11-29-2007 10:19 AM
DFGray: ...I would typically dequeue the image, do the processing, then enqueue it again, flowing data through the analysis and back to the enqueue. At the very least, the copy made from extracting the data from an array of clusters or LV2 global is avoided.
Aristos Queue: ...Notifiers are closely related to queues, and they have the same low-friction design