Difference between revisions of "Assignment 4: finding and measuring things"

From Course Wiki
Jump to: navigation, search
(Overview)
 
(7 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
[[Category:Optical Microscopy Lab]]
 
[[Category:Optical Microscopy Lab]]
 
{{Template:20.309}}
 
{{Template:20.309}}
 
 
==Overview==
 
==Overview==
Congratulations on completing assignment 3. Now you can say you made an epifluorescence microscope. How cool is that?
+
Congratulations on completing assignment 3. Now you can say you built your own epifluorescence microscope and used it to image mammalian cells. How cool is that?
 
+
The in-lab part of this assignment is straightforward. You will make a fluorescent image of tiny microspheres for measuring resolution and then you will record a three-minute movie of larger microspheres for measuring the noise in position measurements made with your microscope. Easy.  If your microscope is in shape, you ought to be able to get the lab part done in well under an hour. (The tiny microspheres do not produce very much light. Sometimes people struggle a bit to get them in focus. Hint: make sure your microscope is well-adjusted before you look at really tiny, dim things.)
+
 
+
You will also develop image processing code to analyze the images. Using the image of tiny microspheres, you willo measure the resolution of your microscope. You will use the movie of larger microspheres to assess how precise position can be measured. Developing the code will take longer than the in-lab part of this assignment.
+
 
+
==Instructions==
+
 
+
===Measuring resolution===
+
[[Image:20.309_140218_PSFbeads.png|frameless|thumb|Example image processing on PSF beads to determine microscope resolution.]]
+
[[Image:20.309_140218_GaussianFit.png|frameless|thumb|Example Gaussian fit of a PSF bead fluorescence emission profile to estimate microscope resolution.]]
+
 
+
One of the most commonly used definitions of resolution is the distance between two point sources in the sample plane such that the peak of one source’s image falls on the first minimum of the other source’s image. The definition suggests a procedure for measuring resolution: make an image of a point source; measure the peak-to-trough distance in the image plane; and divide by the magnification. In this part of the lab, you will use a procedure inspired by this simple idea to estimate the resolution of your microscope. Instead of measuring the spot sizes with a ruler, you will use nonlinear regression on a digital image of point sources.
+
 
+
One practical problem with this method is that true point sources are difficult to come by. If you are using a telescope, stars are readily available to image and they are very good approximations of point sources. Since there is no natural microscopic sample that is equivalent to the night sky, microscopists have to construct something suitable. One of the most common facsimiles is a microscope slide sprinkled with tiny, fluorescent beads that have diameters in the range of 100-190 nm. These beads are small enough to be considered point sources. Unfortunately, beads small enough for this purpose are not very bright. Imaging them can be challenging. Your microscope must be very well aligned to get good results. To measure the spots, you will use nonlinear regression to fit a model curve to the
+
 
+
You will use image processing functions to locate the beads in your image and fit a Gaussian function to them. Gaussians are more amenable to nonlinear regression than Bessel functions, and they are a very good approximation. It is straightforward to convert the Gaussian parameters to Rayleigh resolution. See [[Converting Gaussian fit to Rayleigh resolution]] for a discussion of the conversion.
+
 
+
====Procedure====
+
# Make an image of a sample of 170 nm fluorescent beads with the 40X objective. (Several dozens to hundreds of PSF spheres should be captured in your image.)
+
#* Use 12-bit mode on the camera and make sure to save the image in a format that preserves all 12 bits.
+
#* Ensure that the image is exposed properly.
+
#**Over-exposed images will give inaccurate results.
+
#**Under-exposed images will be difficult to process and yield noisy results.
+
#* This procedure is extremely sensitive to the focus adjustment.
+
#* To minimize photobleaching, do not expose of the beads to the light source and longer than necessary.
+
#* Be sure to save the image and the histogram for your lab report.
+
# Use image processing functions to locate non-overlapping, single beads in the image.
+
# Use nonlinear regression to fit a Gaussian to each bead image.
+
# Convert the Gaussian parameters to resolution.
+
#* [[MATLAB: Estimating resolution from a PSF slide image|This page]] has example MATLAB code.
+
 
+
===Stability of microscope for particle tracking===
+
 
+
The accuracy of optical particle tracking may be limited by mechanical and optical phenomena. Vibration and drift are a source of additive noise. [[Shot noise and centroid finding|Shot noise]] and CCD readout noise in the image of a particle bring about uncertainty in the estimate of its centroid. Excessive vibration can frequently be corrected by improving the mechanical support structure of the instrument. Most stages can be locked to reduce drift. Shot noise is fundamental; however, its relative contribution to the total signal can be minimized by ensuring that the optical system is functioning at peak efficiency.
+
 
+
Before attempting to make measurements with particle tracking, it is essential to determine the performance characteristics of the instrument to be used. This can be accomplished by measuring a specimen with known characteristics. Perhaps the most foolproof choice is a sample with fixed particles. Any measured variation in the fixed sample is noise.
+
 
+
In order to analyze your data, you will need to write code in Matlab. It is helpful to make sure your code is working before you collect data. '''Problem Set 2 will help you with this.''' You may download this set of Matlab files to help you get started: [[File:Matlab_Code_Following_Things_2.zip]]. Please note that you should take any code you download from the internet (including ones from this class) with a grain of salt--you will want to verify your code is working the way it should and that any bugs are fixed. One way to help test your code is to use it on simulated data, where you know what the output should be.
+
 
+
* To verify that your system is sufficiently stable for accurate particle tracking, monitor a dry specimen containing 0.84μm fluorescent beads.
+
 
+
[[Image:StabilityPlot2.jpg|right|400px|thumb|Example stability plot from Spring 2016 students.]]
+
 
+
# Bring a slide with fixed beads into focus. Choose a field of view in which you can see at least 3 beads with the 40× objective. Limit the field of view to only those beads by choosing a region of interest (ROI) in <tt>UsefulImageAcquisition</tt> tool.
+
# Track the beads for 3 minutes (at least 20 fps) in a Matlab video and save the centroids with a frame rate of your choice and make a note of it.
+
# Use the Matlab function <code>track</code> (be sure to limit the algorithm to a small region of interest around the beads, otherwise Matlab will struggle!) to separate the centroids into individual trajectories, <math>\vec r_n(t)</math>, where <math>t = nT</math> and <math>T</math> is the inverse of the frame rate you set above.
+
<br>
+
 
+
* Use your data to calculate mean squared displacements [[MSD of Sum and Difference Trajectories|(MSDs) of sum and difference trajectories]]. You may have already completed this for Problem Set 2.
+
 
+
* Make any necessary adjustments to your microscope and repeat this particle-tracking procedure to attain sufficient stability:
+
The MSD from the difference trajectory should start out less than 100 nm<sup>2</sup> at t = 1 s and still be less than 1000 nm<sup>2</sup> for t = 180 s.
+
 
+
==Overview==
+
In this assignment, you will develop two pieces of image-processing software. The first function will measure the size of bright spots in an image. You will use this function to measure the resolution of your microscope. The second piece of software will track the positions of multiple particles through a sequence of frames. You will use assess how precise your position measurements are. In the next assignment, you will use the particle tracking software to measure the mean squared displacement of particles in fluids and inside of cells. You may choose any software development environment you like. Examples and starter code will be supplied in MATLAB.
+
 
+
===Measuring resolution===
+
One of the most commonly used definitions of resolution is the distance between two point sources in the sample plane such that the peak of one source’s image falls on the first minimum of the other source’s image. This suggests a procedure for measuring resolution: image a point source; measure the peak-to-trough distance; and divide by the magnification. In this part of the lab, you will use this method to estimate the resolution of your microscope.
+
 
+
[[Image:20.309_140218_PSFbeads.png|frameless|thumb|Example image processing on PSF beads to determine microscope resolution.]]
+
[[Image:20.309_140218_GaussianFit.png|frameless|thumb|Example Gaussian fit of a PSF bead fluorescence emission profile to estimate microscope resolution.]]
+
 
+
A practical problem with this method is that true point sources are difficult to come by. If you are using a telescope, stars are readily available, reasonably bright, and an excellent approximation to a point source. Instead of stars, microscopists usually use tiny, fluorescent beads as approximate point sources. These beads are small enough to be considered point sources. You will use nonlinear regression to estimate the resolution of your microscope from an image of the tiny beads. Unfortunately, beads small enough for this purpose are not very bright. Imaging them can be challenging. Your microscope must be aligned very well to get good results.
+
  
You will use image processing functions to locate the beads in your image and fit a Gaussian function to them. Gaussians are more amenable to nonlinear regression than Bessel functions, and they are a very good approximation. It is straightforward to convert the Gaussian parameters to Rayleigh resolution. See [[Converting Gaussian fit to Rayleigh resolution]] for a discussion of the conversion.
+
The in-lab part of this assignment is straightforward. You will take a fluorescent image of tiny microspheres for measuring resolution, and then you will record short movies of larger microspheres diffusing in glycerol. Easy.  If your microscope is in shape, you ought to be able to get the lab part done in well under an hour. (The tiny microspheres do not produce very much light. Sometimes people struggle a bit to get them in focus. Hint: make sure your microscope is well-adjusted before you look at really tiny, dim things.)
  
# Make an image of a sample of 170 nm fluorescent beads with the 40X objective. (Several dozens to hundreds of PSF spheres should be captured in your image.)
+
The out-of-lab components of this assignment will involve writing some hardcore MATLAB code. You will simulate data, use nonlinear fitting to measure the size of beads in an image, and track particles through frames of a movie. Many students find that developing the code for this assignment is challenging and that it can take longer than expected. Please don't hesitate to work on your code in 16-336 during lab hours. The instructors are happy to work alongside you to help you get through MATLAB's many curiosities and frustrations.
#* Use 12-bit mode on the camera and make sure to save the image in a format that preserves all 12 bits.
+
#* Use <code>imhist</code> to ensure that the image is exposed properly.
+
#** Since there are a very small number of bright pixels, plot the histogram counts on a logarithmic scale.
+
#* '''Include the image and the histogram in your lab report.'''
+
# Use image processing functions to locate non-overlapping, single beads in the image.
+
# Use nonlinear regression to fit a Gaussian to each bead image.
+
# Convert the Gaussian parameters to resolution.
+
# '''Report the results in your lab report.'''
+
#* [[MATLAB: Estimating resolution from a PSF slide image|This page]] has example MATLAB code.
+
#* '''Discuss how the measured resolution compares with the theoretical value.'''
+
  
==Segmentation==
+
{{Template:Safety Warning|message = Warning: Assignment 5 will heavily build off of the code you write in Assignment 4. Drop at your own risk!!}}
''Segmentation'' is the process of assigning pixels in an image into groups.In most fluorescent, microscopic images, the concept is pretty simple: the bright stuff is interesting and the dull stuff is dark. There are many approaches to segmentation ... global threshold. ...
+
==Choosing a threshold==
+
<center>
+
[[File:Thresholding Animation.gif]]
+
</center>
+
  
 +
==Navigation==
 +
{{Template:Assignment 4 navigation}}
 +
Back to [[20.309 Main Page| 20.309 Main Page]]
 
{{Template:20.309 bottom}}
 
{{Template:20.309 bottom}}

Latest revision as of 14:49, 17 September 2018

20.309: Biological Instrumentation and Measurement

ImageBar 774.jpg

Overview

Congratulations on completing assignment 3. Now you can say you built your own epifluorescence microscope and used it to image mammalian cells. How cool is that?

The in-lab part of this assignment is straightforward. You will take a fluorescent image of tiny microspheres for measuring resolution, and then you will record short movies of larger microspheres diffusing in glycerol. Easy. If your microscope is in shape, you ought to be able to get the lab part done in well under an hour. (The tiny microspheres do not produce very much light. Sometimes people struggle a bit to get them in focus. Hint: make sure your microscope is well-adjusted before you look at really tiny, dim things.)

The out-of-lab components of this assignment will involve writing some hardcore MATLAB code. You will simulate data, use nonlinear fitting to measure the size of beads in an image, and track particles through frames of a movie. Many students find that developing the code for this assignment is challenging and that it can take longer than expected. Please don't hesitate to work on your code in 16-336 during lab hours. The instructors are happy to work alongside you to help you get through MATLAB's many curiosities and frustrations.


Warning.jpg Warning: Assignment 5 will heavily build off of the code you write in Assignment 4. Drop at your own risk!!


Navigation

Back to 20.309 Main Page