{"id":947,"date":"2013-07-15T09:41:00","date_gmt":"2013-07-15T13:41:00","guid":{"rendered":"http:\/\/pages.vassar.edu\/vaol\/?page_id=947"},"modified":"2013-07-15T09:48:33","modified_gmt":"2013-07-15T13:48:33","slug":"summer-2011","status":"publish","type":"page","link":"https:\/\/pages.vassar.edu\/vaol\/c-elegans-present\/summer-2011\/","title":{"rendered":"Summer 2011"},"content":{"rendered":"<p><em>This page was written by Dr. Jenny Magnes<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><strong>DATA MODELING (DIFFRACTION PATTERNS)<\/strong><\/p>\n<p>We began our summer project by experimenting with a\u00a0<em>Mathematica<\/em>\u00a0file created to take the discrete Fourier Transforms of actual raw images from a microscope of the\u00a0<em>C. elegans.\u00a0<\/em>The image data of the worm was translated into a matrix using a Mathematica function. \u00a0Since we were using actual images of the worms we knew what shapes the worms were taking as they passed through the beam. \u00a0This was an improvement over the previous Matlab method where the shapes of the modeled worms were just speculation.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/10x-bluefilter.mov\">10x-bluefilter<\/a><\/p>\n<div>\n<dl id=\"attachment_597\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/worm-bluefilter.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/worm-bluefilter.png\" width=\"257\" height=\"180\" \/><\/a><\/dt>\n<dd>Still Frame of Worm taken from Blue X10 Video Data<\/dd>\n<\/dl>\n<\/div>\n<p>However the resolution of the Fourier Transform image in Mathematica was not as good as we expected, or wanted, thus another method needed to be developed.<\/p>\n<div>\n<dl id=\"attachment_600\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/fouriermethod-mathematica.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/fouriermethod-mathematica.png\" width=\"358\" height=\"164\" \/><\/a><\/dt>\n<dd>Example of Worm Image and Resulting Fourier Transform in Mathematica<\/dd>\n<\/dl>\n<\/div>\n<p>The matrix created from the image data of the worm needed to be adjusted (made larger) in order to obtain better resolution. \u00a0The program\u00a0<em>Origin\u00a0<\/em>allows for more control over the matrix. \u00a0Thus\u00a0<em>Origin<\/em>\u00a0will probably be used to adjust the matrix and then the Fourier Transform will be taken in either\u00a0<em>Mathematica<\/em>\u00a0or\u00a0<em>Matlab.<\/em><\/p>\n<p><em>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/em><\/p>\n<p>In\u00a0<em>Mathematica\u00a0<\/em>the raw worm image could be turned into a binary matrix. (A matrix of ones and zeros). \u00a0Based on the threshold value of the image, which is the difference between the background and the worm, the binary matrix could be adjusted to make the values of the worm one and the values of the background zero. \u00a0(This matches previous worm modeling done in Matlab)<\/p>\n<p>The fast Fourier Transform of the binary worm matrix was taken. \u00a0The Fourier Transform was squared, the Log method was applied, and the Fourier image produced.<\/p>\n<p>This method gave us the resolution we needed, and we could start using a variety of worm images to match raw video data of the worm diffraction patterns.<\/p>\n<div>\n<dl id=\"attachment_626\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/NAVY.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/NAVY.png\" width=\"429\" height=\"237\" \/><\/a><\/dt>\n<dd>Raw Video Images<\/dd>\n<\/dl>\n<\/div>\n<div>\n<dl id=\"attachment_627\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/modeledNAVY.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/modeledNAVY.png\" width=\"442\" height=\"255\" \/><\/a><\/dt>\n<dd>Mathematica Modeled Diffraction Images<\/dd>\n<\/dl>\n<\/div>\n<div>\n<dl id=\"attachment_628\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/wormsNAVY.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/wormsNAVY.png\" width=\"431\" height=\"281\" \/><\/a><\/dt>\n<dd>Raw Worm Images<\/dd>\n<\/dl>\n<\/div>\n<p>Based on the size of the beam and the size of the worms we hypothesized that it was possible that many of the diffraction patterns recorded on the video data came from only part of the worm passing through the light, instead of the whole worm passing through the beam. \u00a0However we had not previously modeled the diffraction patterns of partial worms. \u00a0Thus using Mathematica, and the technique outlined above, diffraction images from partial worms were generated.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/Picture-1.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/Picture-1.png\" width=\"419\" height=\"200\" \/><\/a><\/p>\n<p>It appears that the resulting diffraction pattern from the partial worm is an even closer match to patterns seen in the raw video diffraction data than diffraction patterns generated by entire worms.<\/p>\n<p><strong>DATA MODELING (WORMS)<\/strong><\/p>\n<p>The next step for the project was to use\u00a0<em>Matlab<\/em>\u00a0to write a program in which the inverse Fourier Transform of the video data diffraction patterns could be taken. \u00a0Theoretically the result of the inverse Fourier Transform would be the shape of the worm. \u00a0(Before we were comparing diffraction patterns taken from the raw video data with modeled diffraction patterns to guess the shape of the worms)<em>.<\/em><\/p>\n<p><em>However it was not as simple as just taking the inverse Fourier Transform of the diffraction data matrix. \u00a0The data matrix created by the diffraction image is the Fourier Transform of the worm\u00a0<strong>squared<\/strong>, or simply the intensity information<strong>.<\/strong>\u00a0Since the Fourier Transform was squared, all phase information was lost. \u00a0It was necessary to regain the phase information in order to take the inverse Fourier Transform.<\/em><\/p>\n<p>In order to regain the phase information, a random phase matrix of the same dimensions as the intensity matrix was generated. \u00a0The random phase matrix was then combined with the square root of the intensity matrix. \u00a0The resulting matrix was then squared, which once again eliminated the phase information. \u00a0(This was necessary to compare the generated diffraction matrix with the original diffraction matrix).<\/p>\n<div>\n<dl id=\"attachment_668\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/intensitywithphase.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/intensitywithphase.png\" width=\"330\" height=\"261\" \/><\/a><\/dt>\n<dd>The squared intensity with random phase matrix<\/dd>\n<\/dl>\n<\/div>\n<p>The difference between the squared Fourier Transform matrix and the original intensity matrix was taken to create a new matrix. (I will be referring to this matrix as the difference matrix).<\/p>\n<p>Matrix elements that matched went to zero in the difference matrix. \u00a0(In our case we only need the elements to be fairly close to zero). \u00a0 For those elements the random phase approximately matched the actual phase. \u00a0We wanted to keep the elements where the phase matched the same while altering the other elements of the combined intensity and phase matrix. \u00a0Thus a loop was written in which matrix elements greater than a specified value went through the process of being combined with another random phase matrix while elements in which the phase matched experienced no change. \u00a0The loop stopped when all matrix elements were less than the specified value.<\/p>\n<div>\n<dl id=\"attachment_640\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/ChangingSpecifications.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/ChangingSpecifications.png\" width=\"447\" height=\"357\" \/><\/a><\/dt>\n<dd>The blue color in the images represents matrix elements that are approx. zero.<\/dd>\n<\/dl>\n<\/div>\n<p><em>Note: The loop condition was met when\u00a0&gt;2*10<\/em><em>4<\/em><\/p>\n<p>The inverse Fourier Transform of the matrix containing both intensity and phase information was taken when the generated diffraction image essentially matched the original diffraction image. \u00a0(When the image of the difference matrix was almost entirely blue).<\/p>\n<p>First a modeled diffraction pattern from\u00a0<em>Mathematica<\/em>\u00a0was used because the resulting worm shape generated by\u00a0<em>Matlab<\/em>\u00a0could be compared with the actual worm shape used to generate the diffraction pattern. \u00a0An image of the diffraction pattern was imported into\u00a0<em>Origin<\/em>\u00a0where it was turned into a data matrix. \u00a0The\u00a0data matrix was then exported out of\u00a0<em>Origin\u00a0<\/em>and imported into\u00a0<em>Matlab.<\/em>\u00a0The matrix went through the process outlined above and a worm shape was generated from the inverse Fourier Transform. \u00a0(Worm images were converted into binary images in\u00a0<em>Mathematica)<\/em>.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/TestWormSequence.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/TestWormSequence.png\" width=\"413\" height=\"145\" \/><\/a><\/p>\n<p>Since it appeared, based on\u00a0<em>Mathematica<\/em>\u00a0modeling, that the diffraction patterns in the video data were created by partial worms passing through the beam, the inverse Fourier Transform of a partial worm diffraction image, generated in\u00a0<em>Mathematica,<\/em>\u00a0was also taken. \u00a0This way when the actual video data was used there was a control for what the inverse Fourier of a partial worm diffraction image should look like.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/partialwormsequence.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/partialwormsequence.png\" width=\"427\" height=\"143\" \/><\/a><\/p>\n<p>Finally video data was used to generate worm shapes for observed diffraction patterns where the shape of the worm was unknown. \u00a0The diffraction images were taken from Cuvette 1. \u00a0A sequence of eight consecutive\u00a0diffraction images was used.<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/C1-236sequence.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/C1-236sequence.png\" width=\"450\" height=\"509\" \/><\/a><\/p>\n<p>As you can see in the above image, only part of the worm was in the beam. \u00a0The motion of the worm can be tracked by how both the diffraction pattern and worm shape change as time progresses.<\/p>\n<p>The next step is to increase the resolution of the resulting worm images.<\/p>\n<p><strong>AUTOMATED DATA COLLECTION<\/strong><\/p>\n<p>&nbsp;<\/p>\n<div>\n<dl id=\"attachment_602\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/micromotions-set-up.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/micromotions-set-up.png\" width=\"378\" height=\"98\" \/><\/a><\/dt>\n<dd>Set-up for Automated Data Collection<\/dd>\n<\/dl>\n<\/div>\n<p>The oscilloscope<em>\u00a0<\/em>used in our set-up connects to the computer for more convenient data collection. \u00a0The photodiode being used is a high-speed detector that is capable of detecting the rapidly changing intensity of the diffraction pattern.<\/p>\n<div>\n<dl id=\"attachment_605\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/picoscope-graph.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/picoscope-graph.png\" width=\"422\" height=\"261\" \/><\/a><\/dt>\n<dd>Diffraction Pattern Waveform taken from Oscilloscope Data<\/dd>\n<\/dl>\n<\/div>\n<p>When a worm passed through the laser beam large, sharp intensity peaks were produced. \u00a0(An example of the sharp peaks is shown in the image above) \u00a0The data from these peaks could be exported into an\u00a0<em>Excel\u00a0<\/em>spreadsheet. \u00a0By analyzing the graph, and searching for the well-defined peaks, sections of the data were extracted and fitted in\u00a0<em>Origin.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div>\n<dl id=\"attachment_607\">\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/origin-picograph-use.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/origin-picograph-use.png\" width=\"466\" height=\"365\" \/><\/a><\/dt>\n<dd>Origin Graph of Intensity vs. Time with a fitted sine function<\/dd>\n<\/dl>\n<\/div>\n<p>The general equation of the sine fit is given below:<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/sine-fit-equation.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/sine-fit-equation.png\" width=\"267\" height=\"65\" \/><\/a><em><\/em><\/p>\n<p><em>Origin<\/em>\u00a0gave a value for each variable. \u00a0The one we needed to calculate the thrashing frequency was\u00a0<em>w<\/em>.<\/p>\n<p>We used the formula:<\/p>\n<p><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/frequency-equations.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/frequency-equations.png\" width=\"232\" height=\"67\" \/><\/a><\/p>\n<p>to calculate the thrashing frequency. \u00a0We used both previously calculated values of thrashing frequency, as well as the knowledge that for each thrash the worm does, the diffraction pattern has the potential to go through the photodiode twice. (Whether or not the pattern actually goes through twice depends on the shape of the worm).<\/p>\n<p>We collected data for 1mm, 2mm, and 5mm sized cuvettes so that we could control how much space the worms had to move, and so we could compare our frequency findings with the previous frequency calculations from the video data. \u00a0The data was then compiled and an average thrashing frequency was found for each cuvette size.<\/p>\n<div>\n<dl>\n<dt><a href=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/Thrashing-frequency-table.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/pages.vassar.edu\/vaol\/files\/2011\/05\/Thrashing-frequency-table.png\" width=\"441\" height=\"111\" \/><\/a><\/dt>\n<\/dl>\n<\/div>\n<p>These frequency values are what we expected based on the video analysis. \u00a0The frequency for the 1mm cuvette does not fall within the std. deviation of either the 2mm or 5mm cuvette. \u00a0We expected this because the worms can actually touch the sides of the 1mm cuvette, thus they appear to be slipping rather than swimming. \u00a0For the 2mm and 5 mm cuvette their motion is not constrained by the sides of the cuvette, thus these thrashing frequencies appear to be the frequencies at which the worms swim.<\/p>\n<p>In the future the cuvette sizes may be increased to even wider than 5mm since it appears for our initial data that the thrashing frequency reaches a maximum in the 2mm cuvette and then begins to decline. \u00a0However with the data we have we cannot assign a trend to what would happen in even larger cuvettes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This page was written by Dr. Jenny Magnes &nbsp; DATA MODELING (DIFFRACTION PATTERNS) We began our summer project by experimenting with a\u00a0Mathematica\u00a0file created to take the discrete Fourier Transforms of actual raw images from a microscope of the\u00a0C. elegans.\u00a0The image data of the worm was translated into a matrix using a Mathematica function. \u00a0Since we &hellip; <a href=\"https:\/\/pages.vassar.edu\/vaol\/c-elegans-present\/summer-2011\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Summer 2011&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2606,"featured_media":0,"parent":937,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-947","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/pages\/947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/users\/2606"}],"replies":[{"embeddable":true,"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/comments?post=947"}],"version-history":[{"count":2,"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/pages\/947\/revisions"}],"predecessor-version":[{"id":955,"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/pages\/947\/revisions\/955"}],"up":[{"embeddable":true,"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/pages\/937"}],"wp:attachment":[{"href":"https:\/\/pages.vassar.edu\/vaol\/wp-json\/wp\/v2\/media?parent=947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}