Presentation is loading. Please wait.

Presentation is loading. Please wait.

Image: Susanne Rafelski, Marshall lab Introduction to Digital Image Analysis Part I: Digital Images Kurt Thorn NIC UCSF.

Similar presentations


Presentation on theme: "Image: Susanne Rafelski, Marshall lab Introduction to Digital Image Analysis Part I: Digital Images Kurt Thorn NIC UCSF."— Presentation transcript:

1 Image: Susanne Rafelski, Marshall lab Introduction to Digital Image Analysis Part I: Digital Images Kurt Thorn NIC UCSF

2 What is a digital Image? Many measurements of light intensity

3 Bit depth and dynamic range # of bits range 12 24 416 8256 124096 1665536 0 1 0 1 2 3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1-byte 2-bytes

4 Bit depth and dynamic range 8 bit 6 bit 4 bit 2 bit

5 Converting bit-depth # of bits range 12 24 416 8256 124096 1665536 0 1 0 1 2 3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Your monitor is an 8-bit display

6 Mapping values onto display Digital Number Display Intensity 0 255 0

7 Intensity scaling Computer screens are 8-bit Publishers also want 8-bit files 04095 0 255 Original Intensity Final Intensity You lose information in this process – values 4080-4095 all end up as 255

8 Intensity scaling 04095 0 255 Original Intensity Final Intensity Min Max Brightness Contrast

9 Brightness / Contrast adjustment

10 Brightness/contrast Full Range Auto-Scale Be aware of how your software scales your image

11 Brightness/contrast Full Range High B/C Be aware of how your software scales your image

12 Gamma correction  =1  =2.2  =0.45 Other contrast stretching transforms…. Input Intensity Output Intensity

13 Gamma adjustment 0.6  =1  =0.6  =2.2

14 What are acceptable image manipulations? JCB has the best guidelines –http://jcb.rupress.org/misc/ifora.shtml#image_aquisitionhttp://jcb.rupress.org/misc/ifora.shtml#image_aquisition –http://jcb.rupress.org/cgi/content/full/166/1/1http://jcb.rupress.org/cgi/content/full/166/1/1 Brightness and contrast adjustments ok, so long as done over whole image and don’t obscure or eliminate background Nonlinear adjustments (like gamma) must be disclosed No cutting and pasting of regions within an image (e.g. individual cells) Control and experiment must be treated identically

15 Lookup Tables (LUTs) 00000 00110 01331 01331 00100 0 1 2 3

16 False coloring to bring out detail

17

18 Lookup Tables (LUTs)

19

20 Color Images Color images are made up of three gray scale images, one for each of red, green, and blue Can be 8 or 16 bits per channel

21 Color Images

22 255 209 1390 89 9393 255 231255 0 0 0 0 00 0 0 134 0 18593 90 0 0 39 1850 255 255214 255 0137 0 255 93 90 0255 0 00 0 00 0 0249 185 255 = 255093255 0 13493 00214137 932550249 209892550 00090 39255 0 9000185 139932310 001850 2550 000 Or

23 Stacks: Sequences of images Can represent time series(movies), z-positions, or other variables 65179091511151086871 79910361851268923001306 91716882626235420812304 98320711790439431872634 82516712542182017992206 80310921823218323141430 760763801767817745 723766795864867860 703800101615741299849 74482911461111723781030 75679290813371149883 801757874880823831 813790827860873771 80788292112161062940 8159621816342221851140 80310942395381641341244 7848921464196116891139 82088496510821146990 Z

24 File Formats Data sets can be big: 1392 × 1040 × 2 = 2.8MB 3-channels, 15 image z-stack, 200 time points: 2.8 × 3 × 15 × 200 = 25.2GB Compression!

25 Compression Lossless: preserves all information in original image –Original image can be restored Lossy: discards information not necessary for visual appearance –Original image cannot be restored See: http://dvd-hq.info/data_compression.php Lossless vs. Lossy

26 File Formats Most portable: TIFF –8 or 16-bit, lossless, supports grayscale or RGB Good: JPEG2000, custom formats (nd2, ids, zvi, lsm, etc.) –Lossless, supports full bitdepth –Custom formats often support multidimensional images –Not so portable Generally Bad: Jpeg, GIF, BMP, etc. –Lossy and / or 8-bit

27 Software Tools Acquisition + Analysis NIS-Elements AxioVision MetaMorph Zen Slidebook Micro-Manager http://micro-manager.org/ Presentation Photoshop Gimp Analysis Matlab ImageJ http://rsb.info.nih.gov/ij/ Imaris (3D visualization) CellProfiler http://cellprofiler.org

28 Basic Image Analysis

29 Background correction Cameras have a non-zero offset There can also be background fluorescence due to media autofluorescence, etc. Want to correct for this by background subtraction –Camera dark image –Estimate background from image

30 Estimating background from image Pixel Intensity Number

31 Dark image Acquired with no light going to the camera –Allows you to measure instrument background –Can detect what’s real background autofluorescence

32 Dark image

33 Shading correction Measure and correct for nonuniformity in illumination and detection Image a uniform fluorescent sample

34 Shading correction

35 Correction procedure I meas = I true * Shading + Dark I true = (I meas – Dark) / Shading Good to do on all images

36 Digital Image Filters 111 111 111 Averaging / Smoothing 01210 161061 2 16102 16 61 01210 Gaussian smoothing

37 How this works 10112257 13810524 20 152314 0317158 71161512 111 111 111 Multiply corresponding pixels and sum 10+11+22(10+11+22+13+8+10+20+20+15)/9 = 14 14

38 Linear Filters 00113025500000 01130025500000 01130002550000 01130002550000 11300002550000 01130000255000 01130000255000 01130000255000 01130000025500 01130000025500 111 111 111 Kernel Simple Smoothing 111 111 111 38 111 111 111 111 111 111 69 111 111 111 85 1237 11085 0000 2537 6985 28000 37 2885 56000 503725085 000 50372505685 2800 50372502885 5600 37 0085 00 37 005685 280 37 002885 560 37 00085 0 01210 161061 2 16102 16 61 01210 Gaussian Smoothing

39 Why smooth? If your image is sampled appropriately (at Nyquist) the point spread function will be spread out over multiple pixels Properly exploiting this redundancy requires deconvolution But smoothing helps Also reduces single pixel noise artifacts that can’t be real

40 Actual PSF and Gaussian Filter PSF Gaussian

41 Why smooth? Averages redundancy and suppresses noise Noisy image Gaussian smoothing filter,  = 1 pixel

42 Smoothing Original Gaussian Filtered

43 Edge Detection Original 111 000 121 000 -2

44 Edge Detection Horizontal edge detection 111 000 121 000 -2

45 Contrast enhancement filters Unsharp Laplacian Laplacian of Gaussian -4 -426-4 -4

46 Contast enhancement Original Unsharp Filtered

47 Nonlinear filters Can do things like median filtering – replace center pixel by median value within box Good for smoothing while maintaining edges

48 Thresholding Pixel Intensity

49 Thresholding, where to set the cutoff?

50 Automatic segmentation using Otsu’s method

51 One problem with this approach… It’s biased towards brighter objects Ideally would use second channel to independently define objects to measure

52 Binary images Thresholding gives you a binary image; 1 inside an object, 0 elsewhere This can be used to identify objects It can also be manipulated

53 Binary Operations: Erosion/Dilation Structuring Element: 0000000000 0000111000 0011111100 0000111100 0000111000 0001000000 0010000000 0000000000 0000000000 0000000000 111 111 111 0000000000 0000000000 0000010000 0000010000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 Erosion 0000000000 0000111000 0000111000 0000111000 0000111000 0000000000 0000000000 0000000000 0000000000 0000000000 Dilation

54 Other binary operations Sequential erosion and dilation – tends to smooth objects Hole filling Removing objects at borders

55 Acknowledgements & Further Reading Nico Stuurman Gonzalez, Woods, and Eddins: Digital Image Processing (Using Matlab) Burger and Burge, Digital Image Processing, An Algorithmic Introduction using Java (ImageJ) Pawley: Handbook of Biological Confocal Microscopy


Download ppt "Image: Susanne Rafelski, Marshall lab Introduction to Digital Image Analysis Part I: Digital Images Kurt Thorn NIC UCSF."

Similar presentations


Ads by Google