Chapter 24: Appendix I Digital Image Processing What is Digital Imaging? Digital Imaging is the transforming of energy: (from light photon, sonic, magnetic, x-ray, or gamma radiation sources) to electrical signals that are measured and assigned discrete binary values. Binary data is processed into image information which may be enhanced, printed, displayed on a monitor, and stored as a computer file. Digital Modalitites Every imaging modality may be digital. CT and MRI are only digital. From an equipment standpoint, the major difference between the modalities is the type of energy used, how the energy is changed as is traverses the body, and how the remnant energy is measured as it leaves the body. Computed Tomography (CT) Is only digital X-radiation passes through, and is attenuated. Cardiovascular Interventional Technology (CVI) digital application started in the 1980s X-radiation passes through, and is attenuated Magnetic Resonance Imaging (MRI) Is only digital Hydrogen atoms excited by radio frequencies (RF) create magnetic vectors that sweep an antenna. Nuclear Medicine Technology An isotope is injected, ingested or inhaled. After being metabolized, concentrations of the isotope are collected by the nuclear medicine camera, which was originally viewed on a scope. Nucs are now digital. Diagnostic Medical Sonography and Vascular Technology Sound waves pass into, and are reflected off of interfaces of tissues and organs. Virtually all ultrasound is digital today. Digital Radiography (DR) Digital applications were available in the early 1980s, but the difficulties of displaying radiographic quality (in terms of spatial resolution) limited its use. By 2000 high resolution systems became Increasingly popular. By 2006 they have become the standard. . X-radiation passes through, and is attenuated Digital Mammography X-radiation passes through, and is attenuated Like digital radiography, highly dependant on excellent spatial resolution: even more so. Question: How is an analog radiographic image created? • Begin with photons coming off the anode. • Outline the process, as each major step. • Use the appropriate terminology. Answer: How is an analog radiographic image created? • • • • • • Incident beam leaves anode. Attenuation in body. Remnant radiation exits as the aerial image. Photons interact with silver halide crystals. Latent image is formed. Latent image is manifest on development. Question: What does a graphic representation of density building on a film look like, and what is it called? D log E (or) H & D Curve (or) Hurter & Driffield Curve (or) Characteristic Curve (or) Sensitometric Curve Producing a digital radiograph is the same as for analog film, up to the point of the photons interacting with the film. Digital imaging samples the remnant radiation with (some kind of) a detector, not film. Analog (343): Information display that is continually changing. Every value, to infinity, exists. For examples: a sweep second hand on a clock, a mercury thermometer, and the gray scale of an x-ray film. (See digital) Digital (343): Information (or a display of information) that is discrete. Values are absolute, with nothing in between. For examples: the second by second increments of a digital clock, a digital thermometer, and the gray scale of a digital image. (See analog) Analog is continuous. Digital is discrete. Data (343): The smallest unit of information. If a brick building were used for analogy, a single brick would be data. (See information) Digital computers store data as binary digits. Question: How do they do that? Computer circuitry is a series of switches that store data in one of two elementary discrete- states: on, or off. On (Closed) =1 Off (Open) =0 Information: Processed data. If a brick building were used for analogy, a single brick would be data, and the building itself would be information. (See data) Bit (Binary digit) (344): In the binary numbering system, two symbols, 0 and 1, are used to represent any value from null to infinity. Like base 10 numbering, binary (base 2), is derived from the base number raised to every exponent of itself: 20, 21, 22, 23 etc. Bit depth refers to the dynamic range (gray scale) a microprocessor can display. A 4 bit processor displays 32 shades of gray, an 8 bit processor 256. 0 and 1 are binary digits or bits Digital computers store data as binary digits. Question: How do they do that? Binary numbering system (344): In the base 2 numbering system all values are represented by 0 or 1. Zero = off when representing an open switch. One = on. 4 10 10 3 10 2 10 1 10 0 Binary numbering 2 4 3 2 1 0 2 2 2 2 512 256 128 64 32 16 8 4 2 1 0 0 0 0 0 0 1 1 1 0 0 1 1 1 1 0 = 14 1 0 1 0 = 42 1 1 1 1 = 127 Binary numbering 512 256 128 64 32 16 8 4 2 1 1 0 1 0 1 0 0 =84 Binary numbering 512 256 128 64 32 16 8 4 2 1 1 1 0 0 1 0 0 0 0 384 Byte (344): A group of 8 bits, used in computer programming for organization of data. An 8 bit processor (28) stores 256 bits of data. When the data is an image, than image can have up to 256 shades of gray. (See appendix I) =400 Machine language: (344) is a programming language that sets the configuration of switches in a computer chip, which determines how data is processed. Though cryptic to humans (10010111), machine language is the most efficient programming code, for it does not require interpretationfor the computer uses it. (See bits, bytes, appendix I) Three logic gates: AND, OR, NOT, form a half adder. Any combination of 0 and 1 can be added in a half adder AND Gate Off + Off = Off On + Off = Off On + On = On OR Gate Off + Off = Off On On + + Off = On On = On NOT Gate Off = On On = Off A digital computer processes and stores data by configuring circuit pathways: opening and closing semiconductor switches of integrated circuits (IC). When a switch is closed a current will flow through that branch of the circuit. When it is open current will not flow. Operation of a Half Adder 0 + 0 0 0 =0 Operation of a Half Adder 1 + 0 0 1 =1 Operation of a Half Adder 0 + 1 0 1 =1 Operation of a Half Adder 1 + 1 1 0 =2 Program (343): Operating instructions in the form of operating systems or application programs. (See software) Software (343): Software is the program (machine language, BASIC, Visual BASIC, Fortran, C, C+, C++, Magic) that directs a computer’s function by configuring the switches in the semiconductor material of a computer chip. (See program, hardware) Hardware (344): The computer chips or integrated circuits (IC), the mother board they reside on, the DVD, hard drive, ports, plugs, box, and anything else coffee can be spilled on. Central Processing Unit (CPU) ALU CU Primary Memory (RAM & ROM) Arithmetic Logic Unit (contains logic gates in registers) Control Unit (directs the flow of input and output) Central processing unit (CPU) (344): The major components of a digital computer: the arithmetic logic unit (ALU), the control unit (CU), and primary memory (Random access memory or RAM), comprise the CPU. Input and output devices, as well as secondary memory are peripherals (CD, DVD, floppy drives, flash drives) that communicate with the CPU. Random access memory (RAM) (345): Semiconductor switches in microchips have addresses: locations which may be accessed directly (randomly): a quick, electronic process. When a program (such as word processing) is loaded from a secondary storage device (such as a hard drive) it is copied into a RAM chip. As changes are made they are made in RAM. The program must be saved back to the hard drive to be retained. RAM is also called volatile memory, which means that when power is turned off data in RAM is lost. Read only memory (ROM) (345): Memory that can only be read (used) and not written to (changed). RAM: addressable memory in an integrated circuit (IC) Welcome to RAM Population: 376,243,101,765 When input is analog, (as sampled by a conventional video camera), an Analog to Digital Converter (ADC) digitizes the signal before being sent to the control unit. ALU ADC CU Input Primary Memory (RAM) When input is digital (keyboard, CT, MRI, DR etc.) the digital signal is sent directly to the contol unit 1. Raw data (digital signal) enters the CU from a digital imaging device or ADC 2. The signal is identified and sent to the ALU for processing 3. Processing complete, the CU routes the image data to RAM ALU Processing & Saving 2 3 ADC CU Primary Memory 1 4 (RAM) Secondary memory (floppy, hard, optical disk or tape) is most often measured in megabytes, or gigabytes. Secondary Memory 5 4. From Primary memory the image is most often sent to a monitor, and, in the case of imaging equipment, it is SAVEd in secondary memory. Output is routed from RAM to the CU, then to the output device. If the image file had been saved to a secondary memory device and purged from RAM, it must be loaded back to RAM before being sent to output. Joe’s colon ALU ADC CU Primary Memory DAC When the output device is analog, it is sent to the DAC (RAM) Secondary Memory Output When the output device is digital the file is sent directly to it Pixel (Picture element) (346): Commonly thought of as the dots on a monitor or TV screen, but pixels also refer to the elements of certain digital detectors. The term conveys the concept of reducing nformation into a matrix of discreet elements (See matrix) One Pixel One bit of computer memory (on or off) is all it takes to light up a pixel (on), or not (off). Matrix (346): An array of pixels arranged in rows and columns. The pixels of a monitor or TV screen form a matrix. A large matrix (more pixels) = better spatial resolution (See pixels) A conventional (not HDTV or high resolution monitor) is a matrix of 525 x 525 pixels. Only two bits of data (2 bit processor) is needed to control each pixel when the dynamic range is 21: on or off. MRI midsagittal head scan displayed in 2 bits. Printout of the data in the matrix of a CT image 250 The number 47 defines the shade of gray for the pixel in column 250, row 210. Values of digits stored in bytes of computer memory directly correspond to the illumination of pixels. Column 250 Row 210 In this case, the pixel in column 250, row 210. Bandwidth (Bandpass) (350): The range of frequencies in a signal. Conventional commercial TV has a 525 x 525 matrix (1-2 lp/mm), which is very poor spatial resolution. Increasing the matrix size (more pixels) improves spatial resolution but also requires the pixels to be scanned faster, which requires the electron beam to modulate (change from pixel to pixel) more rapidly. The frequency of modulation is measured in Hz, and is referred to as the bandwidth. Commercial TV has a bandwidth of 4 MHz. A 1000 line (actually 1050 pixels vertically) high definition monitor requires 20 MHz, and resolves 5-7 lp/mm. Voxel (Volume element) (346): Although each pixel on a monitor displays a two dimensional representation of data, the data did not come from a finite plane. For example, a sectional image of a CT scan is sampled by a fan beam which has a thickness from 1mm to a cm. The volume of the tissue within the sampled tissue contributes to the brightness of the pixels. This is the voxel. Sampling the Voxel in Cross Sectional Images Cross sectional images have depth, which is selected prior to a scan. When a two dimensional section is viewed, the density of each pixel actually represents all the tissues in the volume of the section. This density represents the volume element, or the voxel. The CT numbers from these samples would represent an average of the mass and healthy tissue. Three contiguous CT sections with parts of a frontal lobe mass in each one The CT number from this sample would represent the true density of the mass. Using the region of interest (ROI) cursor to sample CT numbers from the voxels of pixels. This ROI has been sized to measure a density in the right kidney. The mean density of 15.9 indicates a fluid filled cyst. Filtering (Convolution) (350-35): With image data stored as binary numbers, mathematical algorithms (repeated applications of a formula, applied to raw data) are used to enhance the appearance of the image. Digital filters do not add to the data. They accentuate features by suppressing frequencies that may obscure detail, like blowing dust from a written page enhances readability without altering the print. This is done by suppressing spatial frequencies (which enhances others). An example of anatomy with low spatial frequencies is the liver, for it is a homogeneous shade of gray. High spatial frequencies occur in trabecular bone, which demonstrates heterogeneous shades of gray. Band-pass filtering: Demonstration (display) of a selected range of frequencies. High-pass filtering: Suppression of all but high frequency signals. Also called sharpening or edge enhancement. Low-pass filtering: Suppression of all but low frequency signals. Smoothing filter: A low-pass that averages adjacent pixels Plain film x-ray of the abdomen demonstrating low spatial frequencies (few changes in density) of water density organs An ankle with Paget’s disease demonstrating high spatial frequencies (many changes in density) of the diseased trabecular bone No filter High Ultra High Ridiculously High Repeated applications of a high pass filter (also known as sharpening or edge enhancement) demonstrates the effect of suppressing low spatial frequencies Low pass or smoothing filter No filter Edge sharpening filter has an algorithm similar to a high pass filter Windowing (Window level and width) (349): Digital images may have a dynamic range of thousands of shades of gray (depending on the bit depth of the processor) but the human eye can only distinguish about 32. To utilize this much information a feature called windowing allows selective display of the dynamic range. (See appendix I) Window width: If 256 shades of gray were acquired during imaging, but only half of those were chosen to be displayed on the monitor, the window width would be 128. Widow width can be described as controlling density (or brightness). Window level (or center): The displayed dynamic range could be at the high or low end of the scale, or anywhere in between. The window level (or center) is the number the display is centered on. For example, if the window width were 105, and the window center was 70, the display of grays would extend from 18 to 122. (52 shades of gray below 70, and 52 above, which = 105 shades of gray. Window level can be described as controlling contrast. Windowing It’s like contrast and brightness, but it’s not. The human eye can distinguish 32 shades of gray. 5 2 32 Windowing But a digitized image may contain thousands of shades of gray, known as the dynamic range 5 2 32 2 10 1024 CT Numbers (Hounsfield Units) Bone = + 1000 Based on Water = 0 Air = - 1000 CT numbers (HU), express attenuation values relative to water Window Width The range of displayed pixel values For example: A window width of 5 A narrow window is the digital equivalent of a short scale of contrast on a radiograph Window Width The range of displayed pixel values A wide window is the digital equivalent of a long scale of contrast on a radiograph For example: A window width of 500 Window Center (or level) The middle of the range of any given window width 7 0 -7 2 1 0 * 1 2 3 4 5 For example: A window width of 5 At a center of 2 Window Center (or level) 7 A window width of 5 0 -7 0 -1 -2 At a center of - 2 * This CT section through the abdomen was windowed with a width of 300 shades of gray The median number (the level or center) is 2 HU below water, -2 A soft tissue window set at a width of 110, at a level of 43 The same CT section of the head set at a width of 2010, at a level of 800 Note the fracture through the frontal sinus Width 2290 Level 907 Bone windows demonstrating trauma to the left orbit, maxilla, and sinuses. Two windows of the same section through the thorax Width 1269 Level 202 Width 1269 Level 2 Digital subtraction angiography (DSA) images use narrow windows to enhance the contrast difference between the vessel and the surrounding tissue Signal to noise ratio (SNR) (347): Along with a signal (such as the video signal) there are stray electrical currents that degrade image information. The higher the ratio the better the signal. For example, a vidicon camera has a SNR of 200:1 due the heat produced by an electron tube. A digital signal must be no less than 1000:1 to be of acceptable quality. Question: How can a simple on/off switch be used to store complex information that contains many shades of gray? Answer: Many switches are used in combination. Question: If one bit of data is enough to turn a pixel off or on, what can a byte of data do for a single pixel? Answer: A byte of image data stores values for 256 shades of gray. How many KB of computer memory is required for a monitor with a 512 x 512 matrix displaying a gray scale of 2? 512 x 512 = 262,144 bits 262,144 / 8 bits per byte = 32,768 bytes 32,768 bytes / 1024 bytes in a kilobyte = 32KB Answer = 32KB (compared to the 3.2 KB file for all the text of chapter 24) How many bytes of computer memory is required for a for a monitor with a 512 x 512 8 matrix, displaying 256 shades of gray (2 )? 512 x 512 = 262,144 bits 262,144(8bits)/8 bits per bytes = 262,144 bytes 262,144 bytes/1024 bytes in a kilobyte =262KB Answer = 262KB Conclusion: Images are memory hogs.