source: trunk/SRC/Documentation/idldoc_html_output/Picture/imdisp.html

Last change on this file was 338, checked in by smasson, 16 years ago

update documentation

File size: 18.6 KB
Line 
1
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5<!-- Generated by IDLdoc 2.0 -->
6
7<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8  <head>
9    <title>imdisp.pro (SAXO Documentation)</title>
10
11   
12    <link rel="stylesheet" type="text/css" media="all" href="./../main_files.css" />
13    <link rel="stylesheet" type="text/css" media="print" href="./../main_files_print.css" />
14   
15
16    <script type="text/javascript">
17      function setTitle() {
18        parent.document.title="imdisp.pro (SAXO Documentation)";
19      }
20    </script>
21  </head>
22
23  <body onload="setTitle();">
24
25    <div id="navbar_title">
26  <h1>SAXO Documentation</h1>
27</div>
28
29
30<div id="main_navbar">
31
32  <table cellspacing="0">
33    <tr>
34     
35      <td><a href="./../overview.html" title="Overview of library">Overview</a></td>
36     
37
38     
39      <td >Directory</td>
40     
41
42     
43      <td><a href="./../idldoc-categories.html" title="Browse library by category">Categories</a></td>
44     
45
46     
47      <td><a href="./../idldoc-index.html" title="Index of files, routines, and parameters">Index</a></td>
48     
49
50     
51      <td><a href="./../search-page.html" title="Search library">Search</a></td>
52     
53
54      <td id="selected">File</td>
55
56     
57      <td><a href="../../../Picture//imdisp.pro" title="Source code of a file">Source</a></td>
58     
59
60     
61      <td><a href="./../idldoc-help.html" title="Help on IDLdoc">Help</a></td>
62     
63
64      <td >Etc</td>
65
66      <td id="flexible">Developer&nbsp;documentation</td>
67    </tr>
68  </table>
69
70</div>
71
72<div id="secondary_navbar">
73
74<a href="image_viewer.html">&lt;&lt;prev file</a> | <a href="saveimage.html">next file &gt;&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="imdisp.html" target="_TOP">view single page</a> | <a href="./../index.html" target="_TOP">view frames</a>&nbsp;&nbsp;&nbsp;&nbsp;summary: fields | routine&nbsp;&nbsp;&nbsp;&nbsp;details: <a href="#routine_details">routine</a>
75
76</div>
77
78
79    <div id="container">
80
81      <h1 class="directory"><a href="directory-overview.html">Picture/</a></h1>
82      <h2 class="pro_file">imdisp.pro</h2>
83
84      <div id="file_attr">
85        <dl>
86        </dl>
87      </div>
88
89      <div id="file_comments">
90    Display an image on the current graphics device.
91    IMDISP is an advanced replacement for <a href="/Applications/itt/idl64/help/online_help/TV.html">TV</a> and
92    <a href="/Applications/itt/idl64/help/online_help/TVSCL.html">TVSCL</a>.
93
94    - Supports WIN, MAC, X, CGM, PCL, PRINTER, PS, and Z graphics devices,
95    - Image is automatically byte-scaled (can be disabled),
96    - Custom byte-scaling of Pseudo color images via the RANGE keyword,
97    - Pseudo (indexed) color and True color images are handled automatically,
98    - 8-bit and 24-bit graphics devices  are handled automatically,
99    - Decomposed color settings are handled automatically,
100    - Image is automatically sized to fit the display (can be disabled),
101    - The !P.MULTI system variable is honored for multiple image display,
102    - Image can be positioned via the POSITION keyword,
103    - Color table splitting via the BOTTOM and NCOLORS keywords,
104    - Image aspect ratio customization via the ASPECT keyword,
105    - Resized images can be resampled (default) or interpolated,
106    - Top down image display via the ORDER keyword (!ORDER is ignored),
107    - Selectable display channel (R/G/B) via the CHANNEL keyword,
108    - Background can be set to a specified color via the BACKGROUND keyword,
109    - Screen can be erased prior to image display via the ERASE keyword,
110    - Plot axes can be drawn on the image via the AXIS keyword,
111    - Photographic negative images can be displayed via the NEGATIVE keyword.
112</div>
113
114     
115
116     
117
118     
119
120     
121
122      <div id="routine_details">
123       
124
125        <div class="routine_details" id="_imdisp">
126
127          <h2><a class="top" href="#container">top</a>imdisp <span class="categories">
128 Picture
129</span></h2>
130       
131          <p class="header">
132            imdisp<span class="result">, <a href="#_imdisp_param_IMAGE">IMAGE</a></span>, <a href="#_imdisp_keyword_RANGE">RANGE</a>=<span class="result">vector</span>, <a href="#_imdisp_keyword_BOTTOM">BOTTOM</a>=<span class="result">BOTTOM</span>, <a href="#_imdisp_keyword_NCOLORS">NCOLORS</a>=<span class="result">NCOLORS</span>, <a href="#_imdisp_keyword_MARGIN">MARGIN</a>=<span class="result">MARGIN</span>, <a href="#_imdisp_keyword_INTERP">INTERP</a>=<span class="result">INTERP</span>, <a href="#_imdisp_keyword_DITHER">DITHER</a>=<span class="result">DITHER</span>, <a href="#_imdisp_keyword_ASPECT">ASPECT</a>=<span class="result">ASPECT</span>, <a href="#_imdisp_keyword_POSITION">POSITION</a>=<span class="result">POSITION</span>, <a href="#_imdisp_keyword_OUT_POS">OUT_POS</a>=<span class="result">OUT_POS</span>, <a href="#_imdisp_keyword_NOSCALE">NOSCALE</a>=<span class="result">NOSCALE</span>, <a href="#_imdisp_keyword_NORESIZE">NORESIZE</a>=<span class="result">NORESIZE</span>, <a href="#_imdisp_keyword_ORDER">ORDER</a>=<span class="result">ORDER</span>, <a href="#_imdisp_keyword_USEPOS">USEPOS</a>=<span class="result">USEPOS</span>, <a href="#_imdisp_keyword_CHANNEL">CHANNEL</a>=<span class="result">CHANNEL</span>, <a href="#_imdisp_keyword_BACKGROUND">BACKGROUND</a>=<span class="result">BACKGROUND</span>, <a href="#_imdisp_keyword_ERASE">ERASE</a>=<span class="result">ERASE</span>, <a href="#_imdisp_keyword_AXIS">AXIS</a>=<span class="result">AXIS</span>, <a href="#_imdisp_keyword_NEGATIVE">NEGATIVE</a>=<span class="result">NEGATIVE</span>, <a href="#_imdisp_keyword__EXTRA">_EXTRA</a>=<span class="result">_EXTRA</span></p>
133       
134          <div class="comments">
135</div>
136
137         
138
139         
140            <h3>Parameters</h3>
141       
142           
143            <h4 id="_imdisp_param_IMAGE">IMAGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
144              <span class="attr">in</span>
145             
146             
147              <span class="attr">required</span>
148             
149             
150             
151             
152            </h4>
153       
154          <div class="comments">
155 Array containing image data.
156 Pseudo (indexed) color images must have 2 dimensions.
157 True color images must have 3 dimensions, in either
158 [3, NX, NY], [NX, 3, NY], or [NX, NY, 3] form.
159</div>
160           
161
162         
163
164         
165
166            <h3>Keywords</h3>
167           
168            <h4 id="_imdisp_keyword_RANGE">RANGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
169             
170             
171             
172             
173             
174              <span class="attr">type:</span> <span class="value">vector</span>
175              <span class="attr">default:</span> <span class="value">min and max array values</span>
176             
177            </h4>
178       
179            <div class="comments">
180 For Pseudo Color images only, a vector with two elements
181 specifying the minimum and maximum values of the image
182 array to be considered when the image is byte-scaled
183 This keyword is ignored for True Color images,
184 or if the NOSCALE keyword is set.
185</div>
186           
187            <h4 id="_imdisp_keyword_BOTTOM">BOTTOM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
188             
189             
190             
191             
192             
193             
194              <span class="attr">default:</span> <span class="value">0</span>
195             
196            </h4>
197       
198            <div class="comments">
199 Bottom value in the color table to be used
200 for the byte-scaled image.
201 This keyword is ignored if the NOSCALE keyword is set.
202</div>
203           
204            <h4 id="_imdisp_keyword_NCOLORS">NCOLORS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
205             
206             
207             
208             
209             
210             
211              <span class="attr">default:</span> <span class="value">!D.TABLE_SIZE - BOTTOM</span>
212             
213            </h4>
214       
215            <div class="comments">
216 Number of colors in the color table to be used
217 for the byte-scaled image
218 This keyword is ignored if the NOSCALE keyword is set.
219</div>
220           
221            <h4 id="_imdisp_keyword_MARGIN">MARGIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
222             
223             
224             
225             
226             
227             
228              <span class="attr">default:</span> <span class="value">0.1 or 0.025 if !P.MULTI is set to display multiple images</span>
229             
230            </h4>
231       
232            <div class="comments">
233 A scalar value specifying the margin to be maintained
234 around the image in normal coordinates
235</div>
236           
237            <h4 id="_imdisp_keyword_INTERP">INTERP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
238             
239             
240             
241             
242             
243             
244              <span class="attr">default:</span> <span class="value">nearest neighbor sampling</span>
245             
246            </h4>
247       
248            <div class="comments">
249 If set, the resized image will be interpolated using
250 bilinear interpolation
251</div>
252           
253            <h4 id="_imdisp_keyword_DITHER">DITHER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
254             
255             
256             
257             
258             
259             
260              <span class="attr">default:</span> <span class="value">no dithering</span>
261             
262            </h4>
263       
264            <div class="comments">
265 If set, true color images will be dithered when displayed
266 on an 8-bit graphics device
267</div>
268           
269            <h4 id="_imdisp_keyword_ASPECT">ASPECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
270             
271             
272             
273             
274             
275             
276              <span class="attr">default:</span> <span class="value">maintain native aspect ratio</span>
277             
278            </h4>
279       
280            <div class="comments">
281 A scalar value specifying the aspect ratio (height/width)
282 for the displayed image
283</div>
284           
285            <h4 id="_imdisp_keyword_POSITION">POSITION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
286             
287             
288             
289             
290             
291             
292              <span class="attr">default:</span> <span class="value"> [0.0,0.0,1.0,1.0]</span>
293             
294            </h4>
295       
296            <div class="comments">
297 On input, a 4-element vector specifying the position
298 of the displayed image in the form [X0,Y0,X1,Y1] in
299 in normal coordinates
300 See the examples below to display an image where only the
301 offset and size are known (e.g. MAP_IMAGE output).
302</div>
303           
304            <h4 id="_imdisp_keyword_OUT_POS">OUT_POS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
305             
306             
307             
308             
309             
310             
311             
312             
313            </h4>
314       
315            <div class="comments">
316 On output, a 4-element vector specifying the position
317 actually used to display the image.
318</div>
319           
320            <h4 id="_imdisp_keyword_NOSCALE">NOSCALE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
321             
322             
323             
324             
325             
326             
327              <span class="attr">default:</span> <span class="value">to byte-scale the image</span>
328             
329            </h4>
330       
331            <div class="comments">
332 If set, the image will not be byte-scaled.
333</div>
334           
335            <h4 id="_imdisp_keyword_NORESIZE">NORESIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
336             
337             
338             
339             
340             
341             
342              <span class="attr">default:</span> <span class="value">To resize the image to fit the display</span>
343             
344            </h4>
345       
346            <div class="comments">
347 If set, the image will not be resized.
348</div>
349           
350            <h4 id="_imdisp_keyword_ORDER">ORDER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
351             
352             
353             
354             
355             
356             
357              <span class="attr">default:</span> <span class="value">To display the image from the bottom up</span>
358             
359            </h4>
360       
361            <div class="comments">
362 If set, the image is displayed from the top down
363 Note that the system variable !ORDER is always ignored.
364</div>
365           
366            <h4 id="_imdisp_keyword_USEPOS">USEPOS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
367             
368             
369             
370             
371             
372             
373              <span class="attr">default:</span> <span class="value">To honor ASPECT and MARGIN when POSITION vector is supplied</span>
374             
375            </h4>
376       
377            <div class="comments">
378 If set, the image will be sized to exactly fit a supplied
379 POSITION vector, over-riding ASPECT and MARGIN.
380</div>
381           
382            <h4 id="_imdisp_keyword_CHANNEL">CHANNEL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
383             
384             
385             
386             
387             
388             
389             
390             
391            </h4>
392       
393            <div class="comments">
394 Display channel (Red, Green, or Blue) to be written.
395 0 => All channels (the default)
396 1 => Red channel
397 2 => Green channel
398 3 => Blue channel
399 This keyword is only recognized by graphics devices which
400 support 24-bit decomposed color (WIN, MAC, X). It is ignored
401 by all other graphics devices. However True color (RGB)
402 images can be displayed on any device supported by IMDISP.
403</div>
404           
405            <h4 id="_imdisp_keyword_BACKGROUND">BACKGROUND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
406             
407             
408             
409             
410             
411             
412             
413             
414            </h4>
415       
416            <div class="comments">
417 If set to a positive integer, the background will be filled
418 with the color defined by BACKGROUND.
419</div>
420           
421            <h4 id="_imdisp_keyword_ERASE">ERASE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
422             
423             
424             
425             
426             
427             
428             
429             
430            </h4>
431       
432            <div class="comments">
433 If set, the screen contents will be erased. Note that if
434 !P.MULTI is set to display multiple images, the screen is
435 always erased when the first image is displayed.
436</div>
437           
438            <h4 id="_imdisp_keyword_AXIS">AXIS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
439             
440             
441             
442             
443             
444             
445             
446             
447            </h4>
448       
449            <div class="comments">
450 If set, plot axes will be drawn on the image. The default
451 x and y axis ranges are determined by the size of the image.
452 When the AXIS keyword is set, IMDISP accepts any keywords
453 supported by PLOT (e.g. TITLE, COLOR, CHARSIZE etc.).
454</div>
455           
456            <h4 id="_imdisp_keyword_NEGATIVE">NEGATIVE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
457             
458             
459             
460             
461             
462             
463             
464             
465            </h4>
466       
467            <div class="comments">
468 If set, a photographic negative of the image is displayed.
469 The values of BOTTOM and NCOLORS are honored. This keyword
470 allows True color images scanned from color negatives to be
471 displayed. It also allows Pseudo color images to be displayed
472 as negatives without reversing the color table. This keyword
473 is ignored if the NOSCALE keyword is set.
474</div>
475           
476            <h4 id="_imdisp_keyword__EXTRA">_EXTRA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
477             
478             
479             
480             
481             
482             
483             
484             
485            </h4>
486       
487            <div class="comments"></div>
488           
489         
490
491          <h3>Examples</h3><div class="preformat">
492
493;- Load test data
494
495 openr, lun, filepath('ctscan.dat', subdir='examples/data'), /get_lun
496ctscan = bytarr(256, 256)
497readu, lun, ctscan
498free_lun, lun
499openr, lun, filepath('hurric.dat', subdir='examples/data'), /get_lun
500hurric = bytarr(440, 330)
501readu, lun, hurric
502free_lun, lun
503read_jpeg, filepath('rose.jpg', subdir='examples/data'), rose
504help, ctscan, hurric, rose
505
506;- Display single images
507
508!p.multi = 0
509loadct, 0
510imdisp, hurric, /erase
511wait, 3.0
512imdisp, rose, /interp, /erase
513wait, 3.0
514
515;- Display multiple images without color table splitting
516;- (works on 24-bit displays only; top 2 images are garbled on 8-bit displays)
517
518!p.multi = [0, 1, 3, 0, 0]
519loadct, 0
520imdisp, ctscan, margin=0.02
521loadct, 13
522imdisp, hurric, margin=0.02
523imdisp, rose, margin=0.02
524wait, 3.0
525
526;- Display multiple images with color table splitting
527;- (works on 8-bit or 24-bit displays)
528
529!p.multi = [0, 1, 3, 0, 0]
530loadct, 0, ncolors=64, bottom=0
531imdisp, ctscan, margin=0.02, ncolors=64, bottom=0
532loadct, 13, ncolors=64, bottom=64
533imdisp, hurric, margin=0.02, ncolors=64, bottom=64
534imdisp, rose, margin=0.02, ncolors=64, bottom=128
535wait, 3.0
536
537;- Display an image at a specific position, over-riding aspect and margin
538
539!p.multi = 0
540loadct, 0
541imdisp, hurric, position=[0.0, 0.0, 1.0, 0.5], /usepos, /erase
542wait, 3.0
543
544;- Display an image with axis overlay
545
546!p.multi = 0
547loadct, 0
548imdisp, rose, /axis, /erase
549wait, 3.0
550
551;- Display an image with contour plot overlay
552
553!p.multi = 0
554loadct, 0
555imdisp, hurric, out_pos=out_pos, /erase
556contour, smooth(hurric, 10, /edge), /noerase, position=out_pos, $
557  xstyle=1, ystyle=1, levels=findgen(5)*40.0, /follow
558wait, 3.0
559
560;- Display a small image with correct resizing
561
562!p.multi = 0
563loadct, 0
564data = (dist(8))[1:7, 1:7]
565imdisp, data, /erase
566wait, 3.0
567imdisp, data, /interp
568wait, 3.0
569
570;- Display a true color image without and with interpolation
571
572!p.multi = 0
573imdisp, rose, /erase
574wait, 3.0
575imdisp, rose, /interp
576wait, 3.0
577
578;- Display a true color image as a photographic negative
579
580imdisp, rose, /negative, /erase
581wait, 3.0
582
583;- Display a true color image on PostScript output
584;- (note that color table is handled automatically)
585
586current_device = !d.name
587set_plot, 'PS'
588device, /color, bits_per_pixel=8, filename='imdisp_true.ps'
589imdisp, rose, /axis, title='PostScript True Color Output'
590device, /close
591set_plot, current_device
592
593;- Display a pseudo color image on PostScript output
594
595current_device = !d.name
596set_plot, 'PS'
597device, /color, bits_per_pixel=8, filename='imdisp_pseudo.ps'
598loadct, 0
599imdisp, hurric, /axis, title='PostScript Pseudo Color Output'
600device, /close
601set_plot, current_device
602
603;- Display an image where only the offset and size are known
604
605;- Read world elevation data
606file = filepath('worldelv.dat', subdir='examples/data')
607openr, lun, file, /get_lun
608data = bytarr(360, 360)
609readu, lun, data
610free_lun, lun
611;- Reorganize array so it spans 180W to 180E
612world = data
613world[0:179, *] = data[180:*, *]
614world[180:*, *] = data[0:179, *]
615;- Create remapped image
616map_set, /orthographic, /isotropic, /noborder
617remap = map_image(world, x0, y0, xsize, ysize, compress=1)
618;- Convert offset and size to position vector
619pos = fltarr(4)
620pos[0] = x0 / float(!d.x_vsize)
621pos[1] = y0 / float(!d.y_vsize)
622pos[2] = (x0 + xsize) / float(!d.x_vsize)
623pos[3] = (y0 + ysize) / float(!d.y_vsize)
624;- Display the image
625loadct, 0
626imdisp, remap, pos=pos, /usepos
627map_continents
628map_grid
629</div>
630          <h3>Version history</h3>
631         
632          <h4>Version</h4><div class="preformat">
633 $Id: imdisp.pro 325 2007-12-06 10:04:53Z pinsard $
634</div>
635          <h4>History</h4><div class="preformat">
636 Liam.Gumley@ssec.wisc.edu
637 <a href="http://cimss.ssec.wisc.edu/~gumley"/>
638
639 Copyright (C) 1999, 2000 Liam E. Gumley
640
641 This program is free software; you can redistribute it and/or
642 modify it under the terms of the GNU General Public License
643 as published by the Free Software Foundation; either version 2
644 of the License, or (at your option) any later version.
645
646 This program is distributed in the hope that it will be useful,
647 but WITHOUT ANY WARRANTY; without even the implied warranty of
648 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
649 GNU General Public License for more details.
650
651 You should have received a copy of the GNU General Public License
652 along with this program; if not, write to the Free Software
653 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
654</div>
655         
656         
657          <h3>Known issues</h3>
658         
659         
660         
661          <h4>Restrictions</h4><div class="preformat">
662 The image is displayed on the current graphics device.
663
664
665 Requires IDL 5.0 or higher (square bracket array syntax).
666</div>
667       
668         
669         
670         
671         
672         
673         
674         
675       
676          <h3>Statistics</h3>
677          <table class="statistics">
678            <tr><td>McCabe cyclic</td><td>          76</td></tr>
679            <tr><td>McCabe essential</td><td>           1</td></tr>
680            <tr><td>McCabe modular design</td><td>           1</td></tr>
681          </table>
682         
683       
684        </div>
685       
686      </div>
687
688     
689
690      <div id="tagline">Produced by IDLdoc 2.0.</div>
691
692    </div>
693
694  </body>
695</html>
Note: See TracBrowser for help on using the repository browser.