Image and Its Properties 43
FIGURE 3.5: Window and level.
Image viewing applications display the pixel value after a suitable
transformation due to the fact that displays have a lower intensity
range than the intensity range in an image. One example of the trans-
formation, namely window-level, is shown in Figure 3.5. Although the
computer selects a transformation, the user can modify it by chang-
ing the window range and the level. The window allows modifying the
contrast of the display while the level changes the brightness of the
display.
3.2.5 Connectivity: 4 or 8 Pixels
The usefulness of this section will be more apparent with the dis-
cussion of convolution in Chapter 7, “Fourier Transform.” During the
convolution operation, a mask or kernel is placed on top of an image
pixel. The final value of the output image pixel is determined using a
linear combination of the value in the mask and the pixel value in the
image. The linear combination can be calculated for either 4-connected
pixels or 8-connected pixels. In the case of 4-connected pixels shown in
Figure 3.6, the process is performed on the top, bottom, left and right
pixels. In the case of 8-connected pixels, the process is performed in
addition on the top-left, top-right, bottom-left and bottom-right pixels.
44 Image Processing and Acquisition using Python
FIGURE 3.6: An example of 4 and 8 pixel connectivity.
3.3 Image Types
There are more than 100 image formats. Some of these formats,
such as JPEG, GIF, PNG, etc., are used for photographic images. For-
mats such as DICOM, NIFTI, and Analyze AVW are used in medical
imaging. Formats such as TIFF, ICS, IMS, etc., are used in microscope
imaging. In the following sections, we discuss some of these formats.
3.3.1 JPEG
JPEG stands for the Joint Photographic Experts Group, a joint
committee formed to add images to text terminals. Its extension is .jpg
or .jpeg. It is one of the most popular formats due to its ability to
compress the data significantly with minimal visual loss. In the ini-
tial days of the World Wide Web, JPEG became popular as it helped
save bandwidth in image data transfer. It is a lossy format, that com-
presses data using Discrete Cosine Transform (DCT). The parameters
of compression can be tuned to minimize the loss in detail. Since JPEG
stores image data after transforming them using DCT, it is not very
suitable for storing images that contain fine structures such as lines,
curves, etc. Such images are better stored as PNG or TIFF. The JPEG
images can be viewed using viewers that are built into most computers.
Since JPEG images can be compressed, image standards such as TIFF