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

Last change on this file since 191 was 191, checked in by pinsard, 18 years ago

remove format=raw in all html files 2+ : correction for all_plots; suppression of css and correction of Source links in idldoc html output

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