August 3, 2009

A MATLAB Update

Hey all! Just a quick update as to what’s going on with the MATLAB side of the programming. As of now, the majority of what needs to be done is complete. The code can import text files that David is creating, iterate through the matrices to find all the 1’s, resize the matrices to accommodate for resizing the image and iterate through those, generate matrices of X, Y, and Z coordinates based on the index at which there is a 1, and update the Z coordinate based on which layer is being examined. The only major part remaining is to program a way to export all this data into a text file so that the data can be expressed in a meaningful way.

Mayank also linked me to a site that had a box counting function for MATLAB (website: http://www.mathworks.com/matlabcentral/fx_files/13063/1/content/boxcount/html/demo.html). I want to try and implement this function into my code so that it’ll make the box counting a lot easier, and we won’t have to do it by hand. For now though, it’s just food for thought.

Anyways, that’s what I’ve done so far. I’d like to post some of the code I’ve written but unfortunately I’m not on my computer so I can’t, and I’ll be out of town for the next two weeks so I figure I should make a post before I leave whether or not I am on my computer.

-Sorabh

July 13, 2009

Bitmap Conversion Update

So….after a little bit of tinkering, I managed to get the automated bitmap conversion ready. It essentially converts all compatible bitmap files in a directory and all sub-directories into the correct text matrix. It does not require lots of computing power and is very very easy to use; any computer should be able to run it and be able to convert many files quickly (150 files took about 4 seconds).

The next step is to figure out a way to divide the bitmap into squares for examination.

Also, I could develop the program to accept JPEGs. It is just a possibility though.

July 9, 2009

Current Prospects

Hello everyone! Just a quick introduction about myself before I jump into the current prospects of the programming side to this project. My name is Sorabh Gupta and I am a student at the Georgia Institute of Technology. I came across this project when I met Mayank Tahilramani at a family friend’s wedding where he described it to me. And although I do not know much (if anything) about the biological aspects regarding this project, I have had experience in programming using MATLAB.

With that said, it’s time to let you know what I’m currently doing in terms of programming in MATLAB. To date, I’ve been on the project for about 4 days so I have not done a significant amount of coding. However, I have spent the last few days planning and structuring the way I’d like to code the matrix manipulations. Here’s what I’m thinking in terms of structuring the code:

(1) Right now, we’re creating the matrices from the image files and storing them into text files to be read into MATLAB which is a good starting point. In order for MATLAB to interpret data from a text file, functions that MATLAB relies on for file I/O will need to be utilized.

(2) After getting that to work, the next step would be to begin manipulating the matrix. In order to account for different levels of magnification, there will need to be code that iterates through the matrix to remove rows and columns (preferrably every other row and column for consistency). As the matrix gets resized into a smaller matrix, it’ll represent lower levels of magnification.

(3) There also needs to be a count variable that keeps track of the number of 1’s (the “white” in the grayscale representation) for the original matrix as well as the resized matrices. Note: the count needs to be able to differentiate between various levels of the matrix depending on how far along the Z-axis we are. Since we’re working on a 3 dimensional scale, this minor detail will be very important.

(4) Another task is to keep track of X, Y, and Z values which are represented by the index at which a 1 occurs within the matrix. I’m thinking the best way is to build another matrix that keeps track of this information where the row number will represent the point along the X-axis and the index from the imported matrix and stored in the, let’s call it “coordinate matrix,” will represent the Y-axis. I’ll also append another column at the end of the matrix so that the final value will represent the Z-axis, but only after the coordinate matrix is already filled. One issue that came about was that there could be a mismatch of dimensions because the number of 1’s may not necessarily be the same in each row. In order to get around that, I’m proposing to create a matrix of zeros that is the same size as the imported matrix from (1) and fill it in. This way, any leftover zeros will just end up becoming a point along the X-axis and not interfere with the data we want.

(5) The final thing is to export all the new matrices created into a text file with a consistent nomenclature. For this step, it’s just more File I/O.

To accomplish all these tasks, I’m thinking of using many for loops, and more likely nested for loops. There will definitely be if statements to account for some special cases, such as the count. Hopefully, all goes well but for now everything is in the testing phase.

-Sorabh G.

June 29, 2009

Bitmap Manipulation Update

So, my program, PicCon, which will go ahead and convert supplied bitmap files into a .txt matrix file is pretty much complete. The only thing that I need to work out are all the small problems regarding bits per pixel, but otherwise the program is in a working state.

Basically, I looped through all the pixels in the bitmap and checked the RGB values for each pixel. If the R, G, and B value all add up to zero, I know that the pixel is black, and in turn will write a ‘0′ into my text file. Anything else get’s registered as white.

So bascially, the program is 95% percent complete. Here’s a sample to show you what the program does…

Here’s the sample apple you gave me Mayank (Stand about 3 feet away from the screen to see the apple):

111111111111111111111111111111111111111111110
111111111111111111111111111111111111111111110
111101111111111111111111111111111111000011110
111000111111111111111111111111111000000011110
111000001111111111111111111111100011110011110
111000000000011111111111111111001111111111110
111000000000000001111111111110011111111111110
111000000000000000011111111101111111111111110
111100000000000000001111111001111111111111110
111100000000000000001111111011111111111111110
111100000000000000000111110111111111111111110
111110000000000000000011110111111111111111110
111111000000000000000011101111111111111111110
111111100000000000000011101111111111111111110
111111111000000011100001101111111111111111110
111111111111111111111001011111111111111111110
111111111111111111111101011111111111111111110
111111111111111111111110011111111111111111110
111111111000000011111110011111111000001111110
111111100000000000011111011111000000000011110
111111000000000000001111010000000000000001110
111110000000000000000011111111110000000000110
111100000000000000000000111111110000000000010
111000000000000000000000000111100000000000010
111000000000000000000000000000000000000000000
111000000000000000000000000000000000000000000
110000000000000000000000000000000000000000000
110000000000000000000000000000000000000000000
110000000000000000000000000000000000000000000
110000000000000000000000000000000000000000000
110000000000000000000000000000000000000000000
110000000000000000000000000000000000000000000
110000000000000000000000000000000000000000000
110000000000000000000000000000000000000000000
111000000000000000000000000000000000000000000
111000000000000000000000000000000000000000000
111000000000000000000000000000000000000000000
111100000000000000000000000000000000000000010
111100000000000000000000000000000000000000010
111110000000000000000000000000000000000000010
111110000000000000000000000000000000000000110
111111000000000000000000000000000000000000110
111111000000000000000000000000000000000001110
111111100000000000000000000000000000000011110
111111110000000000000000000000000000000011110
111111111000000000000000000000000000000111110
111111111100000000000000000000000000001111110
111111111110000000000000000000000000011111110
111111111111000000000000000000000000011111110
111111111111100000000000000000000001111111110
111111111111110000000111111000000011111111110
011110000000011000001111011100000110000000010