20.309:Homeworks/Homework 3: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
Line 6: Line 6:
<br/>
<br/>


'''Advice on this homework set:'''
'''General advice:'''
 
*There is no lab work required this week, but read the fluorescence microscopy lab manual to prepare for next week.
*There is no lab work required this week.
*Read the fluorescence microscopy lab manual to prepare for next week.
*Feel free to work on this homework set on your own computer. (You will need MatLAB plus the image processing toolbox.)  
*Feel free to work on this homework set on your own computer. (You will need MatLAB plus the image processing toolbox.)  
*If you would like some help, instructors and TAs will be available in the lab. In particular, TAs will be available on Tuesday from 3:30-5:30, Wednesday from 3:00-6:00, Thursday from 1:00-6:00, and Friday 1:00-5:00. The lab will be open regular hours.
*If you would like some help, instructors and TAs will be available in the lab. In particular, TAs will be available on Tuesday from 3:30-5:30, Wednesday from 3:00-6:00, Thursday from 1:00-6:00, and Friday 1:00-5:00. The lab will be open regular hours.
*All the image files you will use in this homework can be found in the students folder of the course locker.
*All the image files you will use in this homework can be found in the students folder of the course locker.
*The images are of different sizes, file formats, and aspect ratios. All are grayscale; however, the techniques generalize to multiple color channels, such as RGB.
*The images are of different sizes, file formats, and aspect ratios. All are grayscale. The techniques you will use to solve the problems on this homework generalize to multiple color channels, such as RGB.
 
'''Useful Commands'''
Below are a some commands for opening, displaying, and writing image files, for which Help will provide the details. Pay attention to the numerical data type of these images when matlab imports them (the \workspace" window will be key here) -- you may need to inter-convert between types.
 
''imread'' is used to load image data from a file. The basic syntax is ''A = imread(`filename')'', with the image data from the file ending up stored in matrix A.
 
''imshow'' displays the data of an image file in a matlab figure window. You can do it either without loading it into the matlab workspace, or when it's present in the workspace and assigned to a variable.
 
''imwrite'' writes image data to a file, in a format that you specify. The basic syntax is ''imwrite(A,`filename')''.
 
''aviinfo'' returns the header information about a movie file in .avi format
 
''aviread(`filename', 1)'' reads one frame of the avifile into a Matlab movie structure. If f is the movie structure, you can assign the image data of that frame to a matrix A using the command ''A = f.cdata''.
 
====Other Useful Commands====


The details of how these work will be important for you to explore on your own, with the help of matlab and the instructors. Be aware that the list below is by no means exhaustive or exclusive -- you may not use every command on the list, and you should explore other commands you find to be relevant that may not be listed here.
'''Some useful commands:'''
fft, fftshift, imhist, histeq, imadjust, conv, conv2
*<code>imread</code> loads an image from a file. The syntax is: <code>A = imread('filename')</code>. The image data from the file is stored in matrix A.
*<code>imshow</code> displays the data of an image file in a matlab figure window. You use the <code>imshow</code> with or without loading the image into the matlab workspace.
*<code>imwrite</code> writes an image to a file. You can specify a format. The basic syntax is <code>imwrite(A,'filename')</code>.
*<code>aviinfo</code> returns the header information about a movie file in .avi format
*<code>aviread('filename', 1)</code> reads one frame of the avifile into a Matlab movie structure. If f is the movie structure, you can assign the image data of that frame to a matrix A using the command ''A = f.cdata''.


'''Also:'''
*Pay attention to the numerical data type of these images when matlab imports them.
*You may need to convert between types.
*Use the workspace panel in the Matlab main window or the <code>who</code> and <code>whos</code> commands to get details on the size and type variables
*Explore the rest of the commands in the image proessing toolbox in the Matlab help browser. You might want to take a look at: fft, fftshift, imhist, histeq, imadjust, conv, conv2, for example.


===Image processing problems===
===Problem 1:correcting poor contrast===
====Problem 1:correcting poor contrast====
Optimize the contrast for visualization of the microscope image on the left below, (dark actin.jpg) taken at too low a light level. [[Image:Image1.JPEG]]            [[Image:Image2.JPEG]]
Optimize the contrast for visualization of the microscope image on the left below, (dark actin.jpg) taken at too low a light level. [[Image:Image1.JPEG]]            [[Image:Image2.JPEG]]
====Problem 2:filtering image data====
===Problem 2:filtering image data===
Create a 3by3 and a 5by5 low pass filter. Apply these filters to remove noise from the cell image on the right above (''noisy actin.tif''). Can you make a 7by7 filter also?
Create a 3by3 and a 5by5 low pass filter. Apply these filters to remove noise from the cell image on the right above (''noisy actin.tif''). Can you make a 7by7 filter also?
====Problem 3:impulse noise====
===Problem 3:impulse noise===
Generating a long integration image using a CCD camera sometimes produces large intensity image ''spiky_actin1.tif''. Can you develop a different method to remove the spikes if you have two pictures taken one after the other (''spiky_actin1.tif'', ''spiky_actin2.tif'')?[[Image:Image3.JPEG]]            [[Image:Image4.JPEG]]
Generating a long integration image using a CCD camera sometimes produces large intensity image ''spiky_actin1.tif''. Can you develop a different method to remove the spikes if you have two pictures taken one after the other (''spiky_actin1.tif'', ''spiky_actin2.tif'')?[[Image:Image3.JPEG]]            [[Image:Image4.JPEG]]
====Problem 4:segmentation====
===Problem 4:segmentation===
Perform a segmentation to isolate the region corresponding to the actin stress fibers in the image ''actin_f.tif''. Also perform a segmentation to isolate the region corresponding to clustered actin in a cell with a chemically disrupted cytoskeleton ''actin_treated.tif''. The output of both tasks should be binary images corresponding to the desired regions.
Perform a segmentation to isolate the region corresponding to the actin stress fibers in the image ''actin_f.tif''. Also perform a segmentation to isolate the region corresponding to clustered actin in a cell with a chemically disrupted cytoskeleton ''actin_treated.tif''. The output of both tasks should be binary images corresponding to the desired regions.
(Very difficult) BONUS: can you devise a quantitative metric to quantify the degree of fiber-ness of the cytoskeleton?)[[Image:Image5.JPEG]]            [[Image:Image6.JPEG]]
(Very difficult) BONUS: can you devise a quantitative metric to quantify the degree of fiber-ness of the cytoskeleton?)[[Image:Image5.JPEG]]            [[Image:Image6.JPEG]]
====Problem 5:calculating magnification====
===Problem 5:calculating magnification===
You have two images of a "test pattern" consisting of light and dark line pairs with a spacing of 18 line-pairs per millimeter (''HiMag.bmp'' and ''LowMag.bmp''). This test pattern was imaged with a home-built microscope at two different magnifications. Calculate the magnification difference between these two images.[[Image:Image7.JPEG]]            [[Image:Image8.JPEG]]
You have two images of a "test pattern" consisting of light and dark line pairs with a spacing of 18 line-pairs per millimeter (''HiMag.bmp'' and ''LowMag.bmp''). This test pattern was imaged with a home-built microscope at two different magnifications. Calculate the magnification difference between these two images.[[Image:Image7.JPEG]]            [[Image:Image8.JPEG]]
====Problem 6:removing periodic noise====
===Problem 6:removing periodic noise===
Periodic noise often occurs in biological imaging -- ''high noise.tif'' (below, left) & ''low noise.tif''(below, center). Can you remove the noise if you know the (normalized) noise characteristics (''noise.tif'' - below, right)? [[Image:Image9.JPEG]]
Periodic noise often occurs in biological imaging -- ''high noise.tif'' (below, left) & ''low noise.tif''(below, center). Can you remove the noise if you know the (normalized) noise characteristics (''noise.tif'' - below, right)? [[Image:Image9.JPEG]]


Line 53: Line 44:
[[Image:Image10.JPEG]]
[[Image:Image10.JPEG]]


====Problem 7:particle tracking====
===Problem 7:particle tracking===
You are given a movie file (''beadtest.avi'') of a fluorescent bead in the cytoskeleton of the cell. Choose any bead in the image. Can you find the centroid of the bead as a function of frame number?
You are given a movie file (''beadtest.avi'') of a fluorescent bead in the cytoskeleton of the cell. Choose any bead in the image. Can you find the centroid of the bead as a function of frame number?

Revision as of 10:28, 28 October 2007

20.309 Fall Semester 2007
Homework Set 3
Due Tesday, November 6, 2007


General advice:

  • There is no lab work required this week, but read the fluorescence microscopy lab manual to prepare for next week.
  • Feel free to work on this homework set on your own computer. (You will need MatLAB plus the image processing toolbox.)
  • If you would like some help, instructors and TAs will be available in the lab. In particular, TAs will be available on Tuesday from 3:30-5:30, Wednesday from 3:00-6:00, Thursday from 1:00-6:00, and Friday 1:00-5:00. The lab will be open regular hours.
  • All the image files you will use in this homework can be found in the students folder of the course locker.
  • The images are of different sizes, file formats, and aspect ratios. All are grayscale. The techniques you will use to solve the problems on this homework generalize to multiple color channels, such as RGB.

Some useful commands:

  • imread loads an image from a file. The syntax is: A = imread('filename'). The image data from the file is stored in matrix A.
  • imshow displays the data of an image file in a matlab figure window. You use the imshow with or without loading the image into the matlab workspace.
  • imwrite writes an image to a file. You can specify a format. The basic syntax is imwrite(A,'filename').
  • aviinfo returns the header information about a movie file in .avi format
  • aviread('filename', 1) reads one frame of the avifile into a Matlab movie structure. If f is the movie structure, you can assign the image data of that frame to a matrix A using the command A = f.cdata.

Also:

  • Pay attention to the numerical data type of these images when matlab imports them.
  • You may need to convert between types.
  • Use the workspace panel in the Matlab main window or the who and whos commands to get details on the size and type variables
  • Explore the rest of the commands in the image proessing toolbox in the Matlab help browser. You might want to take a look at: fft, fftshift, imhist, histeq, imadjust, conv, conv2, for example.

Problem 1:correcting poor contrast

Optimize the contrast for visualization of the microscope image on the left below, (dark actin.jpg) taken at too low a light level. File:Image1.JPEG File:Image2.JPEG

Problem 2:filtering image data

Create a 3by3 and a 5by5 low pass filter. Apply these filters to remove noise from the cell image on the right above (noisy actin.tif). Can you make a 7by7 filter also?

Problem 3:impulse noise

Generating a long integration image using a CCD camera sometimes produces large intensity image spiky_actin1.tif. Can you develop a different method to remove the spikes if you have two pictures taken one after the other (spiky_actin1.tif, spiky_actin2.tif)?File:Image3.JPEG File:Image4.JPEG

Problem 4:segmentation

Perform a segmentation to isolate the region corresponding to the actin stress fibers in the image actin_f.tif. Also perform a segmentation to isolate the region corresponding to clustered actin in a cell with a chemically disrupted cytoskeleton actin_treated.tif. The output of both tasks should be binary images corresponding to the desired regions. (Very difficult) BONUS: can you devise a quantitative metric to quantify the degree of fiber-ness of the cytoskeleton?)File:Image5.JPEG File:Image6.JPEG

Problem 5:calculating magnification

You have two images of a "test pattern" consisting of light and dark line pairs with a spacing of 18 line-pairs per millimeter (HiMag.bmp and LowMag.bmp). This test pattern was imaged with a home-built microscope at two different magnifications. Calculate the magnification difference between these two images.File:Image7.JPEG File:Image8.JPEG

Problem 6:removing periodic noise

Periodic noise often occurs in biological imaging -- high noise.tif (below, left) & low noise.tif(below, center). Can you remove the noise if you know the (normalized) noise characteristics (noise.tif - below, right)? File:Image9.JPEG

Consider a case in which you do not know the noise characteristics. Can you clean up the image below (ecoli noisy.jpg)? (For bonus credit, feel free to work on any AFM images of your own that you'd like to similarly clean up.)

File:Image10.JPEG

Problem 7:particle tracking

You are given a movie file (beadtest.avi) of a fluorescent bead in the cytoskeleton of the cell. Choose any bead in the image. Can you find the centroid of the bead as a function of frame number?