Difference between revisions of "Assignment 4 part 3: Track microspheres over time"
MAXINE JONAS (Talk | contribs) |
MAXINE JONAS (Talk | contribs) (→Navigation) |
||
Line 92: | Line 92: | ||
==Navigation== | ==Navigation== | ||
{{Template:Assignment 4 navigation}} | {{Template:Assignment 4 navigation}} | ||
− | + | Back to [[20.309 Main Page|20.309 Main Page]] | |
{{Template:20.309 bottom}} | {{Template:20.309 bottom}} |
Revision as of 15:56, 1 October 2017
This is Part 3 of Assignment 4.
Overview
In this part of the assignment, you will develop code to track fluorescent microspheres in a sequence of frames. To characterize the performance of your microscope for particle tracking, you will make a 180 s movie fixed, 0.84 μm microspheres with your microscope and plot the mean squared displacement of pairs of particles in the movie.
Next week, you will use the same code to characterize the diffusive motion of particles in different rheological environments (including live cells).
Develop particle tracking code
Use the function SimulatedBrownianMotionMovie below to generate a synthetic movie of diffusing microspheres. You can use the synthetic movie and functions you developed in parts 1 and 2 to help you write code that will find centroids of the particles in each frame. Make sure to use the WeightedCentroid property instead of Centroid (and be sure you understand the difference between the two). Your function should return an N x 3 matrix of values where the first column is the Y coordinate, the second column is the X coordinate, and the third column is the frame number.
function SimulatedMovie = SimulatedBrownianMotionMovie( varargin ) % this is a fancy way to take care of input arguments % all of the arguments have default values % if you want to change a default value, call this function with name/value pairs like this: % foo = SimulatedBrownianMotionMovie( 'NumerOfParticles', 10, 'ParticleDiameter' 3.2E-6 ); p = inputParser(); p.addParameter( 'NumberOfParticles', 5 ); p.addParameter( 'ParticleDiameter', 0.84E-6 ); p.addParameter( 'PixelSize', 7.4E-6 / 40 ); p.addParameter( 'ImageSize', [ 300 300 ] ); p.addParameter( 'FrameInterval', 1/10 ); p.addParameter( 'TemperatureKelvin', 293 ); p.addParameter( 'Viscosity', 1.0E-3 ); p.addParameter( 'BoltzmannConstant', 1.38e-23 ); p.addParameter( 'NumberOfFrames', 100 ); p.addParameter( 'ShowImages', true ); p.parse( varargin{:} ); assignLocalVariable = @( name, value ) assignin( 'caller', name, value ); allParameters = fields( p.Results ); for ii = 1:numel(allParameters) assignLocalVariable( allParameters{ii}, p.Results.(allParameters{ii}) ); end % at this point, there will be local scope variables with the names of % each of the parameters specified above close all diffusionCoefficient = BoltzmannConstant * TemperatureKelvin / ( 3 * pi * Viscosity * ParticleDiameter ); displacementStandardDeviation = sqrt( diffusionCoefficient * 2 * FrameInterval ); % create initial particle matrix particleRadiusInPixels = ParticleDiameter / 2 / PixelSize; particles = nan( NumberOfParticles, 4 ); particles(:, 1:2) = bsxfun( @times, rand( NumberOfParticles, 2 ), ImageSize ); particles(:, 3) = particleRadiusInPixels; particles(:, 4) = 4 * sqrt(2) * particleRadiusInPixels^2 * 4095; SimulatedMovie = zeros( ImageSize(1), ImageSize(2), NumberOfFrames ); figure for ii = 1:NumberOfFrames SimulatedMovie(:,:,ii) = SyntheticFluorescentMicrosphereImageWithNoise( particles, ImageSize ) / 4095; if( ShowImages ) imshow( SimulatedMovie(:,:,ii) ); drawnow end % update the particle position according to the diffusion % coefficient particles(:, 1:2) = particles(:, 1:2) + displacementStandardDeviation / PixelSize * randn( size( particles(:, 1:2) ) ); end end
Once you have your N x 3 matrix, use the track function to add a fourth column to the matrix containing a unique identifier for each particle. The N x 4 matrix is an input to this function for calculating MSD values and diffusion coefficients.
Stability of microscope for particle tracking
Once you have developed and tested your code, use the following procedure to measure the location precision of your microscope:
- Bring a slide with fixed beads into focus.
- Choose a field of view in which you can see at least 3 beads using the 40× objective.
- Limit the field of view to only those beads by choosing a region of interest (ROI) in UsefulImageAcquisition tool. (Otherwise, you will have a gigantic movie that is hard to work with.)
- Acquire a movie beads for 3 minutes at a frame rate of at least 10 fps.
- Use the code you developed to track the particles and plot MSD versus time interval.
The MSD for the difference trajectory of two fixed particles should should start out less than 100 nm2 and still be less than 1000 nm2 for t = 180 s. If the MSD is larger than that, refine your apparatus and methodology until you achieve that goal.
Turn in the code you developed and a plot of MSD for sum and difference tracks versus time interval. |
- Overview
- Part 1: Make a fake image
- Part 2: Measure resolution
- Part 3: Track microspheres over time
Back to 20.309 Main Page