Repository navigation
Expand file tree
/
Copy pathug06imageview.html
More file actions
executable file
·257 lines (227 loc) · 10.7 KB
/
Copy pathug06imageview.html
File metadata and controls
executable file
·257 lines (227 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php
$page_title = "HDFView User's Guide -- Image Viewer";
include ("../../../links.php");
include ("../../../includes/header.html");
?>
<p>
<a href="index.html">[Index]</a>
<a href="ug01introduction.html">[1]</a>
<a href="ug02start.html">[2]</a>
<a href="ug03objects.html">[3]</a>
<a href="ug04treeview.html">[4]</a>
<a href="ug05spreadsheet.html">[5]</a>
<a href="ug06imageview.html">[6]</a>
<a href="ug07textview.html">[7]</a>
</p>
<fieldset><h1>Chapter 6: Image Viewer</h1></fieldset>
<p>
Image Viewer is a graphical window to display HDF images. HDFView is a simple image
viewer for HDF4/5 and has very limited function of processing image.
<p>
An HDF4 image is raster image of 8-bit pixels with and indexed RGB color table,
or a 24-bit true color image. HDF4 library provides image APIs to access image data
and color table.
<p>
An HDF5 image is a dataset that confirms the
<a href="/HDF5/doc/ADGuide/ImageSpec.html">
HDF5 Image Specification</a>. HDFView supports two types of images: indexed
and true color. Both indexed image and true color image have predefined
attributes and data layout according to the HDF5 image specification.
For more details about HDF5 image, see the
<a href="/HDF5/doc/ADGuide/ImageSpec.html">
HDF5 Image Specification</a>.
<ul class="ul">
<li class="li2"><a href="ug06imageview.html#ug06image">6.1 Display a 2D or 3D Image</a></li>
<li class="li2"><a href="ug06imageview.html#ug06zoom">6.2 Zoom/Flip/Contour Image</a></li>
<li class="li2"><a href="ug06imageview.html#ug06palette">6.3 View and Modify Image Palette/Values</a></li>
<li class="li2"><a href="ug06imageview.html#ug06histogram">6.4 Show Histogram of Pixel Values</a></li>
<li class="li2"><a href="ug06imageview.html#ug06import">6.5 Import JPEG Image to HDF4/5</a></li>
<li class="li2"><a href="ug06imageview.html#ug06save">6.6 Save HDF Image to JPEG File</a></li>
</UL>
<hr noshade size=1>
<h2>
<a NAME="ug06image"></a>
6.1 Display a 2D or 3D Image</h2>
HDFView displays HDF4 raster image or HDF5 datasets that follow the HDF5
<a href="/HDF5/doc/ADGuide/ImageSpec.html">Image
and Palette Specification</a> for indexed images with a 8-bit standard
RGB color model palette or three-dimensional true color images.
Other image formats supported by the Image and Palette Specification are
not supported by this tool.
<h3>
6.1.1 Indexed Image (8-bit) </h3>
<p>An indexed image is one of the following:
<ul class="ul">
<li class="li2">An HDF4 RI8 image</li>
<li class="li2">An HDF5 dataset that conforms to the HDF5 Image specification, and is
a "IMAGE_SUBCLASS=IMAGE_INDEXED"
<li class="li2">An SDS or HDF5 dataset with data that can be interpreted as an image </li>
</ul>
<p>The dataset is displayed as a Java image using IndexColorModel.
The dataset is converted to a raster image using
the first palette specified by the PALETTE attribute, or the default palette for
HDF4.
Multiple user defined palettes (i.e., the PALETTE attribute may be a list) are
not supported in version 1.0.
<p>The dataset of an indexed image holds the values of indices of the color lookup
table (palette). The dataset is converted into image pixels by looking up the color
table. The following figure is an example of mapping dataset values into pixels.
<center>
<p><img SRC="images/image_indexed_mapping.gif" >
<br><b>Mapping of Dataset Values to Image Pixels</b></center>
<p>
For a two dimensional indexed image HDFView assumes that the width of the image is
the size of second dimension and the height of the image is the first dimension,
i.e. dim[0]=height and dim[1]=width.
<p>Although HDFView displays the entire image by the order of (dim[0], dim[1],
dim[2])=(depth, height, width) by default, you can always change the order
and select a subset for display as discussed in Chpater 5.
<p>HDFView also displays a three dimensional array as an array of 2D images
arranged along the third dimension, i.e. dim[0]=depth, dim[1]=height and
dim[2]=width. You can flip back and forth to look at images at different
position of the depth dimension. For instance, if the dataset is 20 x 400
x 600 (dim[0]=20, dim[1]=400, and dim[2]=600), HDFView will display it as
20 images each with the size of 600 x 400 (width is 600, height is 400).
However, A three-dimension image of [1][height][width] or [height][width][1]
is treated as a two-dimension indexed image of [height][width].
<p>
A 2D or 3D SDS or HDF5 dataset with integer or float data can be displayed as
an indexed image using the "Open As" selection from the Object menu.
Since the dataset does not have a palette, a default palette is
used. The palette is chosen from the "Select Palette" menu in the
"Dataset Selection" window. The predefined palettes include:
<ul class="ul">
<li class="li2">gray
</li>
<li class="li2">
rainbow
</li>
<li class="li2">
nature
</li>
<li class="li2">
wave
</li>
</ul>
The default is "gray", a gray scale.
<h3>
6.1.2 True Color Image </h3>
In the case of an image with more than one component per pixel (e.g., Red,
Green, and Blue), the data may be arranged in one of two ways.
HDFView
only supports three color components: red, green and blue.
<p>Following HDF4
terminology, the data may be interlaced by <i>pixel</i> or by <i>plane</i>. For an HDF5 Image dataset the interlace should
be indicated by the INTERLACE_MODE attribute. In both cases, the dataset will
have a dataspace with three dimensions, <i>height</i>, <i>width</i>, and <i>components</i>.
For <i>pixel interlace</i> the
data is arranged by the order of [height][width][pixel components].
For <i>plane interlace</i> the data is arranged by the order
[pixel components][height][width].
<p>
The translation from pixel values to color components for display or processing
purposes is a one-to-one correspondence of data values to components.
Data of RGB
color components is converted into byte data, which is packed into
single <i>int</i>
pixel. The Java Image is created with a DirectColorModel, with masks to define
packed samples. This color model is similar to an X11 TrueColor visual. The
default RGB ColorModel specified with the following parameters:
<pre>
Number of bits: 32
Red mask: 0x00ff0000
Green mask: 0x0000ff00
Blue mask: 0x000000ff
Alpha mask: 0xff000000
Color space: sRGB
isAlphaPremultiplied: False
Transparency: Transparency.TRANSLUCENT
transferType: DataBuffer.TYPE_INT
</pre>
The following figure shows examples of true color images. The image on the
left is pixel interleaving with dimensions of [149][227][3]. The image on the right
is plane interleaving with dimensions of [3][149][227].
<center>
<p><img SRC="images/image_true_color.gif" >
<br><b>True Color Image Displayed in the Image View</b></center>
<h2>
<a NAME="ug06zoom"></a>6.2 Zoom/Flip/Contour Image</h2>
HDFView supports only limited image manipulation such as zooming, flipping and
contour. You can zoom in and out of an image. The minimum zoom factor
is 1/8 (reduced to 1/8 the size) and the maximum is 8 (magnified to 8 times
the size). Reduction (zoom out) is done by sampling pixels, such as a 1/2
size image is created by selecting every second pixel. Magnification (zoom
in) is done by replicating pixels.
<p>
You can also flip an image horizontally or verticaly. Flipping an image will
change the coordinates of the image.
This can be used to adjust images that may have been created with
different origins that the defaults.
<p>
The "contour" creates a contour plot of the pixel values.
The contour can have from three to nine contour levels. Level three
has less details of contour and level nine has more details of the contour.
<b>Repeated contour operation shows the accumulated effect of contouring.
For example, if you do contouring with level 3 and then do contouring with
level 4 on the same image, the final image shows the the effect of contouring
with level 4 of the contour image with level 3</b>.
<p>
The following shows an contour image of level nine.
<center>
<p><img SRC="images/image_contour.gif" >
<br><b>Contour Image</b></center>
<h2>
<a NAME="ug06palette"></a>6.3 View and Modify Image Palette/Values</h2>
A palette is the means by which color is applied to an image and is also
referred to as a color lookup table. It is a table in which every row contains
the numerical representation of a particular color. In the example of an
8-bit standard RGB color model palette, this numerical representation of
a color is presented as a triplet specifying the intensity of red, green,
and blue components that make up each color.
<p>Although the HDF5 palette specification allows for variable color length,
different look-up methods and color models beyond RGB, HDFView only supports
the indexed RGB color model of 256 colors. Clicking the palette icon from the
tool bar or selecting the palette command from the image menu, you can also
see the red, green and blue components of the color table are ploted in a
line plot.
<center>
<p><img SRC="images/image_palette.gif" >
<br><b>Image Palette (256 Colors)</b></center>
<p>
To view pixel values of each individual point, check the "Show value" item
in the "Image" menu. When you move the mouse over the image, the pixel values
of the mouse point are shown at the bottom of the image.
<p>
You can modify the values of color table. Select the color (red, green or blue)
in the palette view and drag line of selected color. The value of selected color
changes as you move the color line. In the following figure, the image on the
left is the orginal image and the image on the right is the image with modified
color table.
<center>
<p><img SRC="images/image_palette_modify.gif" >
<br><b>Modified Image Palette (256 Colors)</b></center>
<h2>
<a NAME="ug06histogram"></a>6.4 Show Histogram of Pixel Values</h2>
The frequency of pixel values of a selected area or the whole image can
be displayed in a histogram chart. The horizontal axis of the histogram
chart is the the 256 pixel values. The vertical axis shows the frequency
of the pixel values.
<center>
<p><img SRC="images/chart_histogram.gif" >
<br><b>Histogram of Pixel Values</b></center>
<h2>
<a NAME="ug06import"></a>6.5 Import JPEG Image to HDF4/5</h2>
Using HDFView, you can convert an JPEG image into HDF4 or HDF5 image.
Selec the "Import JPEG To" command in the file menu or the "JPEG To"
command in the tools menu, a popup window will ask you to choose an JPEG
image file to convert. Image is converted into 24-bit HDF4 or HDF5 image. The
current conversion does not support image with indexed color model or image
with less than two color components. The image data is saved as 8-bit unsigned
integer regardless the data type of the original image.
<h2>
<a NAME="ug06save"></a>6.6 Save HDF Image to JPEG File</h2>
Using "Save Imae As" command in the "Image" menu, you can save the
current image into an JPEG file.
<?php
include ("../../../includes/footer.html");
?>