image analysis using r - londonr · image processing libraries in cran biops image processing and...

25
Chris Campbell LondonR - 13th July 2010 Image Analysis Using R

Upload: others

Post on 12-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Chris Campbell

LondonR - 13th July 2010

Image Analysis Using R

Page 2: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Steps to image analysis • Image capture

• Clean image/reduce noise

• Extract information

• Analyze information

Page 3: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Image Capture

Light

Photography

Light microscopy

Fluorescence microscopy

gels

cells

tissue samples

http:// ... western blot

http:// ... cells

Page 4: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Image Capture

Light

Photography

Light microscopy

Fluorescence microscopy

gels

cells

tissue samples

X-ray Radiography

Computed tomography (CT)

bones

tumours

http:// ... x-ray

http:// ... cat scan

Page 5: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Image Capture

Light

Photography

Light microscopy

Fluorescence microscopy

gels

cells

tissue samples

X-ray Radiography

Computed tomography

bones

tumours

Magnetism Magnetic resonance imaging (MRI) patients

http:// ... MRI

Page 6: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Image Capture

Light

Photography

Light microscopy

Fluorescence microscopy

gels

cells

tissue samples

X-ray Radiography

Computed tomography

bones

tumours

Magnetism Magnetic resonance imaging patients

Electrons Scanning electron microscopy

Transmission electron microscopy

insects

viruses

http:// ... SEM insect

http:// ... TEM virus

Page 7: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Image Capture

Light

Photography

Light microscopy

Fluorescence microscopy

gels

cells

tissue samples

X-ray Radiography

Computed tomography

bones

tumours

Magnetism Magnetic resonance imaging patients

Electrons Scanning electron microscopy

Transmission electron microscopy

insects

viruses

Positrons Positron emission tomography

(PET)

tumours

http:// ... positron emission tomography

Page 8: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Image Capture

Light

Photography

Light microscopy

Fluorescence microscopy

gels

cells

tissue samples

X-ray Radiography

Computed tomography

bones

tumours

Magnetism Magnetic resonance imaging patients

Electrons Scanning electron microscopy

Transmission electron microscopy

insects

viruses

Positrons Positron emission tomography

(PET)

tumours

Intermolecular

forces

Atomic force microscopy inorganic surfaces http://pico.iis.u-tokyo.ac.jp/media/16/20060621-QuenchedSi-AFM.jpg

Page 9: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Generally… • Use large numbers of images

• Use all images

• Use whole image, not crop

• Random selection not "typical region"

• i.e. avoid subjectivity

Page 10: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Image Processing Libraries in CRAN biOps Image processing and analysis

dcemri A Package for Medical Image Analysis

dpmixsim Dirichlet Process Mixture model simulation for clustering & image segmentation

edci Edge Detection and Clustering in Images

epsi Edge Preserving Smoothing for Images

FITSio FITS (Flexible Image Transport System) utilities

PET Simulation and Reconstruction of PET Images

R4dfp 4dfp MRI Image Read & Write Routines

rimage Image Processing Module for R

RImageJ R bindings for ImageJ

ripa R Image Processing & Analysis

tractor.base A package for reading, manipulating & visualising magnetic resonance images

adimpro Adaptive Smoothing of Digital Images

Page 11: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Libraries in CRAN biOps Image processing and analysis

dcemri A Package for Medical Image Analysis

dpmixsim Dirichlet Process Mixture model simulation for clustering & image segmentation

edci Edge Detection and Clustering in Images

epsi Edge Preserving Smoothing for Images

FITSio FITS (Flexible Image Transport System) utilities

PET Simulation and Reconstruction of PET Images

R4dfp 4dfp MRI Image Read & Write Routines

rimage Image Processing Module for R

RImageJ R bindings for ImageJ

ripa R Image Processing & Analysis

tractor.base A package for reading, manipulating & visualising magnetic resonance images

adimpro Adaptive Smoothing of Digital Images

Page 12: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

• Open source

• Java

• Image analysis software http://rsbweb.nih.gov/ij/

package:RImageJ • Authors: Romain Francois & Philippe Grosjean

• Bindings between R and ImageJ

Page 13: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Subjectivity vs. Objectivity • Hypothesis: blue blobs are always larger than yellow blobs

Page 14: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Subjectivity • Hypothesis: blue blobs are always larger than yellow blobs

Manual

measurements

Page 15: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Subjectivity • Hypothesis: blue blobs are always larger than yellow blobs

It’s easy to accept

manual

measurements

when they make

sense, but it’s

tempting to

repeat them if

they seem wrong

Page 16: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Subjectivity • Hypothesis: blue blobs are always larger than yellow blobs

Subjective

observer accepts

expected

hypothesis

Page 17: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Objectivity • Hypothesis: blue blobs are always larger than yellow blobs

Automatically

threshold

Page 18: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Objectivity • Hypothesis: blue blobs are always larger than yellow blobs

Objective observer

automates analysis

and rejects

hypothesis

Page 19: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Automate Procedures • Identify objects without making subjective decisions

Page 20: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Run ImageJ from R • Open connection to

an image

• Use IJ$run() to

access macros

• Great potential for

automating image

processing from R

Page 21: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Run ImageJ from R • However, some key macros not yet implemented

(e.g. setAutoThreshold, imageCalculator)

Page 22: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

package:rimage • Author: Nikon

• Reads jpegs into

RGB arrays

• Plot function defined

for objects of class

"imagematrix"

Page 23: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Analyze information • Plots and statistical summaries of particles from image

Single image

Multiple images

Page 24: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Conclusions • Images available?

• Ensure quality/validate method

• Choose useful measures

• Use analysis to make predictions

Page 25: Image Analysis Using R - LondonR · Image Processing Libraries in CRAN biOps Image processing and analysis dcemri A Package for Medical Image Analysis dpmixsim Dirichlet Process Mixture

Acknowledgements • Mango Solutions www.mango-solutions.com

• L. R. Contreras-Rojas, R. H. Guy

http://www.bath.ac.uk/pharmacy/staff/rhg.html

• NAPOLEON http://www.ehu.es/napoleon/