IMDISP display procedure update: True Color now faster [message #31034] |
Wed, 05 June 2002 10:02 |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
Dear Colleagues,
Summary:
A new version of my IMDISP display procedure is available at
http://www.gumley.com/PIP/Free_Software.html
The new version (v 1.47 2002/06/05) is considerably faster than the
previous version when displaying large (i.e. megapixel) True Color
images.
Details:
This morning I was browsing the RSI Tech Tip "Tips & Tricks for
Efficient IDL Programming"
http://www.rsinc.com/services/output.cfm?tip_id=1799
when I realized tip number 10 was directly applicable to IMDISP. The
substance of the tip is that for multi-dimensional arrays, the use of
"*" indexing on the left side of an assignment statement can slow things
down when working with True Color images, e.g.,
IDL> true = bytarr(2000, 2000, 3, /nozero)
IDL> data = bytscl(dist(2000))
IDL> t0 = systime(1) & true[*, *, 0] = data & t1 = systime(1)
IDL> print, t1 - t0
1.8526720
This kind of operation is used in IMDISP to store byte-scaled values in
the red, green and blue channels of a True Color image. Zero-based
indexing is much faster in this instance, e.g.,
IDL> t0 = systime(1) & true[0, 0, 0] = data & t1 = systime(1)
IDL> print, t1 - t0
0.030030966
I have modified IMDISP to use zero-based indexing for True Color images,
and my own tests show significant speedups, especially for large images
(better than a factor of two). I often work with megapixel size True
Color images, so I really appreciate the savings.
Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|