670 likes | 764 Views
Computers in Imaging. Robert Metzger, Ph.D. Decimal Form (Base 10).
E N D
Computers in Imaging Robert Metzger, Ph.D.
Decimal Form (Base 10) • In general, a positional numbering system encodes the numbers as: anbn + an-1bn-1 + . . . + a2b2+ a1b1+ a0b0 (0 < ai < b, i = 0,1,2,...,n), where the integer b > 1 is the radix (or base) of the numbering system • The leftmost digit is called the most significant digit, the rightmost the least significant digit • Whenever it is not clear which base is being used either a subscript will be used to denote it or the base will be written in parentheses • Decimal form (radix 10): 4210 = (4x101)+(2x100)
Binary Form (Base 2) • Powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024... • Binary form (radix 2): 1010102 = (1x25)+(0x24)+ (1x23)+(0x22)+ (1x21)+(0x20) = 3210 + 810 + 210 = 4210 • Other radices used in computing Octal (b=8) Hexadecimal (b=16; A=10, … F=15)
4 Digital Representation of Data • Bits, Bytes and Words • Smallest unit of storage capacity = 1 bit (binary digit:1 or 0) • Bits grouped into bytes: 8 bits = byte • Word = 16, 32 or 64 bits, depending on the computer system addressing architecture • Computer storage capacity is measured in: • kilobytes (kB) - 210 bytes = 1024 bytes a thousand bytes • megabytes (MB) - 220 bytes = 1024 kilobytes a million bytes • gigabytes (GB) - 230 bytes = 1024 megabytes a billion bytes • terabytes (TB) - 240 bytes = 1024 gigabytes a trillion bytes
5 Digital Representation of Data • Digital Representation of Different Types of Data • Alphanumeric text, integers, and non-integer data • Storage of Positive Integers • In general, n bits have 2n possible permutations and can represent integers from 0 to 2n-1 (the range usually denoted with square brackets): • n bits represents 2n values with range [0, 2n-1] • 8 bits represents 28 = 256 values with range [0, 255] • 10 bits represents 210 = 1024 values with range [0, 1023] • 12 bits represents 212 = 4096 values with range [0, 4095] • 16 bits represents 216 = 65,536 values with range [0, 65535]
6 Digital Representation of Data • Binary Representation of Signed Integers • Include the use of negative numbers • Reserve first bit for the sign (+/-): [-127,127] – one’s complement • Two’s complement: [-128, 127] – simplifies electronic circuitry • Floating Point Form • For very large or very small numbers (e.g., 6.023 x 1023) • Similar to scientific notation: 0.111111112 x 2010011112 • Binary Representation of Alphanumeric text • ASCII = American Standard Code for Information Interchange • ASCII code for representation of text, e.g., A = 01000001 • Stored in one byte (128 characters) • Computer needs to keep track of the data type
7 Data Transfer • Data are transferred between the various components of the computer and with devices external to the computer in binary format • A voltage of fixed value (e.g., +5V) is used to represent 1 • Another voltage value (e.g., 0V) is used to represent 0 • clock frequency = 1/t (usually given in MHz or GHz) • Changes between the voltage states occur through synchronization signals from the computer’s clock 1 clock cycle = the minimum time increment (t) at which a 1 → 0 or 0 → 1 transition can occur
8 Serial vs. Parrellel • Serial - pulses transmitted one after another over single wire • Parallel - All pulses transmitted simultaneously over several wires • If N wires are used, parallel transmission is predominantly N times faster than serial transmission • Bus: a bundle of wires used for parallel data transfers Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 66.
9 Digital Data Transfer • Each device connected to the bus is identified by an address or a range of addresses • Only one device at a time can transmit data on the bus • In general only one device receives the transmitted data • The sending device transmits receiving address & data • The width of a bus refers to the number of wires used to transmit data in parallel (e.g., 32 bits) A bus also contains wires for ground, control signaling, etc.
10 Analog and Digital Representation of Data • Analog: continuous waveform where the amplitude represents the numerical signal magnitude • Advantages of digital: • resistance to accumulated errors • error correction possible with the transmission of redundant information • digital circuitry most often less expensive than analog • Advantage of analog: • Often transmitted quicker Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 67.
11 Conversion of Analog Data to Digital Form • The electronic measuring devices of medical scanners (e.g., transducers and detectors) produce analog signals • Analog to digital conversion (analog to digital converter – ADC) • ADCs characterized by • sampling rate or frequency (e.g., samples/sec – 1 MHz) • number of bits output per sample (e.g., 12 bits/sample = 12-bit ADC) Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 69.
12 ADC Potential Loss of Data • Sampling and quantization (digitization): loss of data (necessary evil) Minimum sampling frequency (Nyquist limit) to accurately represent signal Quantization error minimized through use of large number of bits/sample Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 69.
Back to the Future 13 • “I think there is a world market for • maybe five computers.” • - Thomas Watson, chairman of IBM, 1943
14 Components & Function of a Digital Computer Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., pp. 70 and 78.
15 Main Memory • Random access memory (RAM): volatile • Buffer between CPU and mass storage devices • Memory addresses where data and instructions reside • Also read-only memory (ROM): static • DRAM: dynamic RAM • SRAM: static RAM (cache) • VRAM: video RAM (display card) • All RAM volatile! Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 71.
16 Central Processing Unit (CPU) • CPU executes a sequence of instructions: program • A CPU contained on a single chip: microprocessor • A number of data storage locations: storage registers • Data • Memory addresses • Arithmetic Logic Unit (ALU) • Logic operations and data transfer signaled via clock • CPU speed measured in instructions or operations per second (e.g., MIPS or GFLOPS) and determined by: • CPU clock rate (e.g., MHz or GHz) • Architecture (bits per instruction, e.g., 32-bit vs. 64-bit and parallel processing capabilities)
17 Central Processing Unit (CPU) • CPU program execution • A program is a sequence of instructions for CPU execution • Instruction cycle - CPU fetches the instructions from memory and executes them sequentially • An instruction may cause the CPU to perform one of the following: • Mathematical operation • Transfer data • Compare • Jump to an instruction other than the next in the sequence • Each instruction consists of two parts: an opcode specifying the operation to be performed and an address
18 Input-Output (I/O) Bus and Expansion Slots • Bus described under serial vs. parallel data transfer • Most I/O buses are provided with expansion slots to accommodate printed circuit (PC) cards with multiple functions, e.g.: • Modem card → modem and video display card → video monitor • Makes it possible to customize general-purpose computers for specific applications (e.g., MRI scanner) and to add additional functions and capabilities (e.g., ADC) • I/O Ports: serial, parallel, USB (Universal Serial Bus) and SCSI (Small Computer System Interface)
19 Mass Storage Devices • Permit the non-volatile storage of programs and data • Various formats based on: • Access time (e.g., msec or minutes): random or sequential • Data transfer rate (e.g., kbps, Mbps or Gbps) • Cost • Portability • Permanence (CD-R vs. CD-RW) • All consist of: • Mechanical drive • Storage medium • Controller • Hierarchical: trade-off speed vs. cost per MB
20 Mass Storage Devices Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 76.
21 Display Interface and Keyboard/Pointing Devices • Display computer information in visual form • Usually displayed on a video monitor or printed • Cathode ray tube (CRT) • Flat-panel display (TFT = thin-film transistors) • Video display controller/card • Receive digital data from computer memory • Store locally on card with VRAM (video RAM) • Registers to manipulate the original image or text data • DACs to convert into on-screen video image • Usually computer equipped with keyboard, mouse, trackball or joystick (could be head-less though)
22 Acquisition and Communications Interface • Acquisition interface = ADC card(s), though more efficient for the modality electronics to perform ADC • Computers also communications devices (PACS) • Modem = modulator/de-modulator (DAC - encoded signal on wire - ADC) • Network interface card (NIC), e.g., Ethernet • Needs unique address on the network • Phone number of modem pool, e.g., 206-685-5599 • Internet Protocol (IP) address, e.g., 128.95.120.1
23 Array Processor • In the past when general-purpose CPU speeds were slow, custom-designed hardware (array processors) to perform compute-intense mathematical operations (e.g., floating point computation) were manufactured Achieved speed through specially designed circuits to make use of parallel processing and pipelining operation • Attaches to the computer bus for fast I/O operation • Not needed as much these days with very fast general-purpose microprocessors with parallel processing capabilities inherent in some operating systems
24 Performance of Computer Systems • Review • Clock speed of the CPU, e.g., 3.4GHz Pentium 4 • Width and clock speed of the I/O between • Memory hierarchy, dimensions and elements • Access and transfer times of mass storage devices • MIPS, MFLOPS and benchmark testing • CPU architecture, e.g.. number of bits/instruction and parallelism
25 Computer Languages • Machine Language • Binary instructions to be executed by CPU requiring detailed knowledge of the particular computer • 0110101010101001001010101010001011110011110110101...) • High-Level Languages • Program writing without detailed knowledge of the machine • This program is translated into machine language via a compiler • Include FORTRAN, Basic, Pascal, C, Java • Requires an compiler or interpreter program to translate to binary
26 Heirarchy of Software • Applications Software - programs to perform specific functions desired by the user • May be written in either high-level or machine language • Generally an executable program run by the OS • Hopefully user-friendly, flexible and intuitive to use • Operating System (OS) - the program that, after being initially loaded into the computer by a boot program, manages all the other programs in a computer • On instruction to run a program, the OS copies it from mass storage to memory, initiates execution of the first instruction by the CPU, transfers control to the program and regains control on completion of the task • Handles complex I/O tasks and sharing of resources • Examples: Windows, Mac OS, Linux, UNIX
27 Computer Security • Goals • Deny unauthorized persons access to data • Protect programs and data from accidental or deliberate loss • Data Backup • Practicing “Safe Computing” • Malicious programs exist, such as viruses, worms, Trojans, time bombs, and password grabbers • Types of viruses: executable file, boot sector and macro infectors • Deny unauthorized users access to your system • Good password selection (8-14 characters, not in the dictionary of any known language, mix of upper/lower case and numbers, and should contain at least one non-alphanumeric character, e.g., !, @, #, %, etc.) • Firewall software/hardware, e.g., Zone Alarm or Black Ice • Grant each user only sufficient privileges required to accomplish required tasks
28 Back to the Future • “Computers in the future may weigh • no more than 1.5 tons.” • - Popular Mechanics, forecasting the relentless march of science, 1949.
29 Digital Storage of Images • Usually stored as a 2D array of data, I(x,y): I(1,1), I(2,1), … I(n,m-1), I(n,m) • Typical matrices – CT: 512x512x12bits/pixel; DR: 2048x2560x10 bits/pixel • Total number of bytes/image = pixels/image ∙ bits/pixel‡ ∙ (1 byte/8 bits) • ‡ aligned along byte boundaries, e.g., 12 bits/pixel 16 bits/pixel Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 71.
30 Effect of Resolution and Bits per Pixel 8, 3, 2, 1 bits/pixel 10242, 642, 322, 162 matrices Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 82. Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 84.
31 Image Processing • Addition or subtraction, e.g., digital subtraction angiography (DSA) • Spatial filtering • Smoothing (removing quantum mottle – noise) • Edge enhancement, e.g., computed radiography (CR) • Reconstruction from projections • Back-projection, e.g., computed tomography (CT), single photon and positron emission tomography (SPECT and PET) • Fast Fourier Transform, e.g., magnetic resonance imaging (MRI) • Calculation of physiological performance indices, e.g., nuclear medicine • Generation and manipulation of volumetric data sets • Image co-registration (“fusion”), e.g., CT and PET
Back to the Future 32 • “I have traveled the length and breadth of this country and talked with the best people, and I can assure you that data processing is a fad that won't last out the year.” • - The editor in charge of business books for Prentice Hall, 1957.
33 Computer-Aided Detection • Also known as computer-aided diagnosis • Computer program that uses specific image processing algorithms and decision threshold parameters to detect features in an image likely to be of clinical significance in images • Assist as a secondary reader to call attention to objects that might have been overlooked • For example in mammography: • Masses • Microcalcification clusters • Architectural distortions
34 Image Display • Conversion of a digital image matrix in the display card memory (VRAM) into an analog video signal using a digital to analog converter (DAC) Matrix digital values are scanned in raster fashion as a function of time which through the DAC provides a time-varying analog signal • The time-varying analog video signal is input to a video monitor Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., pp. 86 and 90.
35 Gray-scale and Color Cathode Ray Tube Monitors • Gray-scale monitors provide better range of brightness and dynamic range than COTS color monitors • CRT elements and function • Intensity of light is proportional to the electric current in the beam, which is determined by the analog voltage signal applied from the video card • A color CRT uses three independent electron guns with tightly clustered red, green and blue phosphor regions
36 Flat Panel Monitors • Most flat-panel monitors use liquid crystal display (LCD) technology • When voltage is applied to the liquid crystal material it rotates incident polarized light • This rotated light then passes through another polarizer (90º to the first) so that the input voltage modulates the intensity of fluorescent tube backlight • Active matrix LCDs are also called thin-film transistor (TFT) displays Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 89.
37 Contrast Enhancement • Although there are 10-bit DACs, the human visual system (HVS) can only distinguish 26-28 shades of gray Thus for a 12-bit CT image, only 256 shades of gray are visualized at any one time of the 4096 levels stored Also, radiographic contrast may vary between objects, so there is a need to interactively alter image contrast Altering the contrast so that it is more optimal involves the operation of a translation table (or look-up table – LUT) sitting between VRAM and the DAC, allowing displayed image contrast enhancement
38 Video and Level Controls • Modification of the translation table causes changes in the displayed image brightness and contrast and is usually done through window (contrast) and level (brightness) controls (e.g., under mouse control) • In the example (below), the window is kept constant as the level is increased, causing the image to become darker and darker • The narrower the window, the greater the displayed image contrast Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 92.
39 False Color Displays and Hardcopy Devices • The amplitude of the signals generated in the production of radiographic images do not have inherent color information • When color is used to display some aspect of the received signal then the resulting images are called false-color or pseudo-color images • Example: Doppler US and NM • Multiple LUTs and DACs • Hardcopy Devices - permit the recording of digital images on photographic film or paper, e.g., laser imager Bushberg, et al., The Essential Physics of Medical Imaging, 2nd ed., p. 92.
40 PACS and Teleradiology • Picture Archiving and Communications Systems • Teleradiology • Standards • ACR Standards for Teleradiology • Digital Imaging and Communications in Medicine (DICOM) • Networks for Image and Data Transfer • Acquisition of Digital Images • Storage of Images • Data Compression • Display of images for Interpretation and Consultation
41 ACR Standards for Teleradiology • Teleradiology (transmission of images for viewing at sites remote from where they are acquired) and reporting back ACR published the first ACR Std for Teleradiology in 1994 with subsequent revisions in 1996, 1998 and 2002: http://www.acr.org/departments/stand_accred/standards/pdf/teleradiology.pdfThe ACR Standard for Teleradiology document outlines the qualifications of personnel involved, equipment guidelines, licensing, credentialing, and liability, communication, quality control for teleradiology, quality improvement and has a listing of up to date references
42 DICOM (Digital Imaging in Communications and Medicine • Most important functions • unambiguous definition of terms used • define models of image communication • agreed upon by those who adopt the standard • Has become the predominant standard for the communication of medical images • Takes into account existing standards for networks • By necessity, written in dry language with a minimum of explanatory information (thousands of pages) • Web resource: http://medical.nema.org/
43 Local Area Network (LAN) • Topology: star, ring and bus • Protocol: Internet and Ethernet use TCP/IP = Transport Control Protocol/Internet Protocol • Media: wire, fiber-optic and air • Ethernet • Shared bandwidth • Switched – full duplex • 10, 100, 1000 and 10,000 Mbps/sec • ATM/SONET • Asynchronous Transfer Mode • Synchronous Optical Network • 155, 622 and 2,500 Mbps
44 Wide Area Network (WAN) Internet = LANs mesh connected with WANs all using TCP/IP
45 Acquisition of Digital Images • Film digitization and frame grabbers (old) • DICOM modalities • Computed Tomography (CT) • Magnetic Resonance Imaging (MRI) • Nuclear Medicine (including SPECT and PET) • Ultrasound (US) • Computed Radiography (CR) • Digital Radiography (DR) • Digital Fluoroscopy (DF) • Mammography (one digital, but mostly film)
4 Mbytes 10 Mbytes 4 Mbytes 10 Mbytes 2.5:1 46 Storage of Images • Data Storage Technologies (redundancy and backup) • Hierarchical Storage Management (HSM) systems • RAID: redundant array of inexpensive disks • Magneto-optic disk (MOD/EOD) • WORM optical disks • Digital Linear Tape (DLT) and other tape formats, e.g., D2, D3 ... • Data Compression • Lossless (compression ratio < 4:1) • Lossy (compression ratio > 4:1)
47 Display of Images for Interpretation • Large format raster-scanned CRT and LCD (flat panel) • CRT/LCD more or less equivalent to film • Lesser spatial resolution, greater contrast resolution (LUT) • Pixel Resolution: 1024 x 1280 (C), 1200 x 1600 (B), 1728 x 2304 (A) • Luminance: 240-280 cd/m2 vs. 1713 cd/m2 (light box) • Dynamic Range: bit depth (16-bit per pixel frame buffer) • Veiling Glare: stray ambient light reduces contrast • ROC Studies: OK for primary diagnosis • Flat panel monitors available. • 1536 x 2048 pixels and 700 cd/m2
IMAGE MODALITY IMAGE SIZE (MB) CT 0.5 MRI 0.125 CHEST 10.0 CR RAD 8.6 - 10.2 GI FLUORO 0.25 ANGIO --DSA & FLUORO 0.5 - 2.0 NUCLEAR MED 0.033 ULTRASOUND 0.25 (0.75 COLOR)