Understanding Image Basics

From MIPAV
Revision as of 15:36, 7 May 2012 by Olgavovk (Talk)

(diff) <previousrevision> | Latest revision (diff) | <nextrevision> (diff)
Jump to: navigation, search

Understanding Image Basics

In this chapter. . .

  • Supported graphic formats overview
  • Understanding the MIPAV dimensionality and coordinate system
  • Data types
  • Headers
  • Endianness
  • Viewing and editing image attributes

This chapter also explains the dimensionality and coordinate system used by MIPAV, the data types MIPAV supports, the header offset information, endianness, and how to view and edit image attributes.It also provides a basic information about image file formats supported by MIPAV. More information about graphic file formats and the formats that MIPAV supports can be found in Appendix C: "Supported formats" .

Supported graphic formats overview

MIPAV supports three categories of graphic file formats: vector (i.e., volume of interest, or VOI), bitmap (i.e., 2D to 5D grayscale or RGB images), and 3D images.
Vector file formats are usually used to store line-based elements. These elements can be geometric shapes, such as polygons, curves, or splines. MIPAV can read and generate several vector-formatted file types including the MIPAV lookup table (LUT), MIPAV MTX, MIPAV Graphics Plot (PLT), and MIPAV VOI. See also Appendix C: "Supported formats" .
Bitmap file formats are usually used to store real-world graphics data e.g., photographs or medical images such as CT scans. The data portion of bitmap files contains numerical data that indicates the color of each pixel or voxel in the image. MIPAV can read and generate a number of bitmap formatted file types, such as Adobe Photoshop (PSD), Graphics Interchange File (GIF), Sun Raster (RS), Tagged Image File Format (TIFF), and Truevision Graphics Adapter (TGA).
</font>MIPAV uses 3D graphic formatted files to store descriptions of the color and shape of 3D models of real-world and imaginary objects.
To support the wide range of image-processing needs of the NIH intramural research community, MIPAV reads and writes the image file types indicated in Table 1, refer to Appendix C: "Supported formats".

Understanding the MIPAV dimensionality and coordinate system

Internally, MIPAV is designed to store images of any dimensionality and thus is n dimensional. Figure 1 is a model of an example 3D-image where each position within the grid represents a voxel.
voxel-The smallest distinguishable cube-shaped part of a 3D-image.

The voxel in the upper left-most position is considered the origin of the dataset. (A volumetric dataset is a set of cross-sectional images). Ideally, each voxel would be isotropic (i.e., cubic), but clinical datasets are often acquired in such a manner that the resolution in the x and y dimensions is greater than the resolution in the z dimension, thus producing rectangular voxels (elongated in the z. This voxel anisotropy is taken into account in the execution of the algorithms found in MIPAV.

Because MIPAV's image storage buffer is n-dimensional, it can store 2D, 3D, and 4D medical images. CT and MRI are examples of 3D medical images where the three dimensions (x, y, and z) are spatial dimensions. Other 3D datasets include fluoroscopy volumes, where the first two dimensions are spatial and the third dimension is time.


Figure 1. Example of 3D image (origin at top left)

File:MIPAV ImageBasicsa.gif


Re-ordering data from image to voxel order

When recorded in scanner or image order, multi-component images are stored as consecutive volumes. This is convenient for visualization, since one can easily render a particular 3D volume, however, it is inconvenient for parallel processing, as one must read the entire 4D image in order to get the specific component(s) for a particular processing.

In voxel order all components for a particular voxel are stored together. This allows to read the image one voxel at a time, or skip ahead to a particular voxel, without storing the entire image into memory.

See also: [Orientation and Voxel-Order Terminology: RAS, LAS, LPI, RPI, XYZ and All That].

Data types

A data type is the classification of a particular type of information. For example, a floating point data type indicates a number with a decimal point. Data read from image files are stored in MIPAV's data structures. MIPAV supports all the basic data types shown in Table 1 and may in the future support more composite data types including color and complex numbers. The image data read from the file is stored in a data buffer of the same basic data type, preventing the reduction of image information that results from conversion into a fixed data type.

Table 1. Data types supported by MIPAV

Data type
Description
Boolean
1 bit per pixel/voxel (1 on, 0 off)
Signed byte
1 byte per pixel/voxel (-128, 127)
Unsigned byte
1 byte per pixel/voxel (0, 255)
Signed short
2 bytes per pixel/voxel (-32768, 32767)
Unsigned short
2 bytes per pixel/voxel (0, 65535)
Integer
4 bytes per pixel/voxel (-231, 231-1)
Long
8 bytes per pixel/voxel (-9.22E18, 9.22E18)
Float
4 bytes per pixel/voxel (-3.4E38, 3.4E38)
Double
8 bytes per pixel/voxel (-1.8E308, 1.8E308)
Color 32
3 bytes per pixel/voxel, plus 1 byte; 8 bits per color channel (alpha, red, green, and blue)


Headers

If you attempt to open a raw image, you may need to supply MIPAV with the header offset. The header offset indicates the size of the space reserved at the beginning of the file where specific types of information is kept. This space, which is called the header, precedes the image data. If you know the length of the header, enter it in the header offset text box. When MIPAV accesses the file, it skips the header offset and begins to read the image data. Note that not all image file formats have a header.

Endianness

Endianness refers to the byte ordering of the data. Some computers order the data with the least significant byte (LSB) first followed by the most significant byte (MSB). This byte order is referred as "little endian" or Intel byte ordering. machines that use little-endian byte ordering are VAXes, Intel x86, and Pentium. The reverse is MSB then LSB, which is referred as "big endian" or Motorola byte ordering. Machines that use big-endian byte ordering are IBM System 3D, RISC, and a Motorola 680x0. MIPAV is biendian; that is, it supports both big- and little-endian byte-ordering formats.

Viewing and editing image attributes

Information about the image appears in the Image Information dialog box and in the Image Attributes dialog box.

The Image Attributes window displays the name of the image file and information about the resolution of the image. The About Image window displays more detailed information about the image, such as the orientation of the image or the number of bits per pixel or voxel.

Viewing image attributes

To view the attributes of an image, select Image > Attributes > View Header in the MIPAV window. For DICOM datasets, the Image Information dialog box similar to the one shown in Figure 2-a appears. For non-DICOM datasets, an Image Information dialog box similar to the one in Figure 2-b appears.

Figure 2. The Info dialog box for DICOM (a) and non-DICOM (b) images



ImageBasicsInfoDICOMDialog.jpg


(a) the Info dialog box for DICOM images

ImageBasicsInfoDialog.jpg


(b) the Info dialog box for non-DICOM images




Editing image attributes

You can edit some of the image attributes for both DICOM datasets and non-DICOM datasets in the Image Attributes dialog box (Figure 3). The Image Attributes dialog box includes five tabbed pages, which are the following:
General page displays the name of the image (without its extension, or suffix) and lists the image modality
Resolutions page indicates the unit of measure for each dimension
Orientations/Origin page lists the image orientations
Transform Matrix displays and lists the values for the transform matrix
Talairach displays Talairach transform

By default, the General page always appears first when the Image Attributes dialog box opens.

Image Attributes dialog box

Figure 3. Image Attributes dialog box
Apply applies the changes to the current image, but doesn't close the dialog box.
OK applies the changes to the current image and closes the dialog box.
Close closes the dialog box without applying the changes to the image.
Help opens the on-line help.
General tab
ImageAttributesGeneral.jpg
Image name (without suffix) displays the name of the current image. You can change the image's name here.
Image modality shows image modality. You can change the modality by selecting it from the list.
The list includes: Unknown Modality, Biomagnetic Imaging, Color Flow Doppler, Computed Radiography, Computed Tomography, Diaphanography, Digital Radiography, Duplex Doppler, Endoscopy, External Camera Photography, FA, General Microscopy, Hardcody, ICG, Intraoral Radiography, Laser Surface Scan, Magnetic Resonance Angiography, Mammography, Magnetic Resonance, Nuclear Medicine, Other, Positron Emission Tomography, Panoramic X-ray, Radio Fluoroscophy, Radiographic Imaging, Radiotherapy Dose, Radiotherapy Image, Radiotherapy Plane, Radiotherapy Record, Radiotherapy Structure Set, Red Free, Slide Microscopy, Single Photon Emission Computer Tomography, Thermography, Ultrasound, and X-ray Angiography.
Image endian order Here, use the appropriate radio button to set the image endiannes.
Resolutions tab
ImageAttributesDialogREsolutionsTab.jpg
1-5 dimension shows resolution for each dimension.
Slice thickness shows the slice thickness.
Units of measure displays the units of measure used in the image.
Orientation/Origin tab
ZeroBased ImageAttributes3.jpg
Image Orientation Medical image data are stored in a variety of ways. In order to orient a two-dimensional image slice or three-dimensional volume in space, one needs to know how the order of the image data relates to a standard set of axes. For medical imaging, these axes are generally chosen to correspond to the directions posterior/anterior'superior/inferior [[1]]. This information could be found from the image header. To change image orientation, select one from the list: Axial, Coronal, Sagittal, or Unknown. See also "About medical image coordinate systems."
X-axis orientation (image left to right)
Y-axis orientation (image top to bottom)
Z-axis orientation (into the screen)
To specify X, Y, or Z -axis orientation, select one from the list: Unknown, Patient Right to Left, Patient Left to Right, Patient Anterior to Posterior, Patient Posterior to Anterior, Patient Inferior to Superior, Patient Superior to Inferior. Here, the head end is referred to as the superior end, while the feet are referred to as the inferior end.
Anteriorrefers to the "front" of the individual, similarly, posterior refers to the "back" of the individual.
Left and right are self explanatory.
X-axis origin
Y-axis origin
Z-axis origin
The image origin is generally at the corner of the image, often the upper left, the axis directions are: the X- axis is across, Y -axis is down, and Z-axis goes into the screen. Usually, it differs from matrix coordinates and Cartesian coordinates. E.g. for the above image, the origin coordinates shown in the dialog box are as follows: x=0,z=0, and y=-239.0625, which corresponds to the scanner frame of reference and scanner origin coordinates. If you mouse over the image, MIPAV will show you the coordinates from the image frame of reference.
4-th dimension For 4D images, it specifies the units and values used for the 4-th dimension.
Transform matrix

ImageAttributesTransformMatrix1.jpg

Matrix displays a list of transformation matrix for the chosen image.
Transform. ID displays transformation ID type for the chosen image. To change the current transformation matrix, select a new transform ID first, and then click Replace. This will replace the transformation matrix.
Replace replaces a current transformation matrix to a new one that you choose.
Add a New adds a transformation matrix that has been selected from the Transform ID list to the image.
Rename renames a transformation matrix.
Copy copies the current transformation matrix to the Clipboard.
Paste pastes a copied transformation matrix
Load loads a transformation matrix (from a file with the *.mtx
Save saves a transformation matrix to a file.
Identity transforms the current transformation matrix to an identity matrix.
Invert inverts the current transformation matrix.
Composite TBD.
Decompose TBD.
Talairach
Shows ACPC and Talairach transformation matrices.

ImageAttributesTalairach1.jpg

Include Talairach - displays a Talairach transformation matrix for the image.
Load -loads a new matrix.
Save - saves a matrix to a file.








To modify the name of the image dataset
1 Open either a DICOM or non-DICOM image dataset.
2 Select Image > Attributes > Edit Attributes in the MIPAV window. The Image Attributes dialog box opens.
3 Select the name of the image in the Image name (without suffix) box.
4 Type a new name of the image.
5 Click either Apply or OK. The new image name appears in the header on the image window.


What's the Difference Between
Clicking Apply or Clicking OK?
Click Apply when you want the dialog box or window to remain open after it makes the change so that you can make further modifications. If instead you click OK, the dialog box or window closes immediately after making the current change.


To edit the dimensions and units of measure
1 Open either a DICOM or non-DICOM image dataset.
2 Select Image > Attributes > Edit Attributes in the MIPAV window. The Image Attributes dialog box opens.
3 Click Resolutions. The Resolutions page in the Image Attributes dialog box appears.
< 4 Type the changed values in the dimension text boxes on the left and then select the appropriate value in the Unit of measure boxes on the right.
5 Click either Apply or OK.
To edit the x, y, and z orientations of image datasets
1 Open either a DICOM or non-DICOM image dataset.
2 Select Image > Attributes > Edit Attributes in the MIPAV window. The Image Attributes dialog box opens.
3 Click Orientations. The Orientations page (Figure 4) in the Image Attributes dialog box opens.
4 Select the appropriate values in the boxes on the right.
5 Click Apply or OK.
To change the origin for the first image slice
1 Open either a DICOM or non-DICOM image dataset.
2 Select Image > Attributes > Edit Attributes in the MIPAV window. The Image Attributes dialog box opens.
3 Click Orientation. The Orientation page (Figure 4]) in the Image Attributes dialog box appears.
4 Type the appropriate values in the dimension boxes.
5 Click Apply or OK.
To change the transform matrix
1 Open either a DICOM or non-DICOM image dataset.
2 Select Image > Attributes > Edit Attributes in the MIPAV window. The Image Attributes dialog box opens.
3 Click Transform Matrix. The Transform Matrix page (Figure 3) in the Image Attributes dialog box appears.
4 Select the appropriate transform ID in the Transform ID box.
5 Load and save transform matrices.
6 Click Apply or OK.