Sunday, November 10, 2013

Scalar_data

DOWNLOAD CODE



DATA READER
I started the assignment by loading the data into a 1-D array and then mapping the highest and lowest pixel values as 1 and 255, respectively.  This should create a grey scale image.  I then displayed this image on the screen using the width and height values parsed from the NRRD file. Below is the image as it appeared on the screen and mapped to the same coordinates as the NRRD file.

COLOR MAP
I then changed the grey scale to a color mapped image. I did this by using colorLerp() and choosing between two different saturation levels of the same color (below) and also two different colors, red and green (below).

Questions
  • Where did you get your color map?
    • I used color sphere linked under the color lecture to choose my colors.  For the red and green I just picked them to see what they looked like.
  • What makes it an appropriate color map for this data?
    • The colors need to show the contrast in order to see the image details

INTERPOLATE THE GRID
Next I adjusted the grid size to have a fixed height of 800 px.  The major change in drawing the image was to use rect() instead of point(), so that I could fill in the white space that was created by stretching the image. Below is the image stretched.
To do the bilinear interpolation I changed to the test set so that I could have a smaller data set.  Here is an image of the test set without interpolation.
While in the end I found the bilinear interpolation to be straight forward. I did have a difficult time conceptualizing it.  To make it a little easier I modified my code and put the data into a 2-D array.  Then I looped through each data points getting the color values of each of the four corners. I used the map function to convert them to values between 1-255.  Then I used lerp() to get the first x and 2nd x values.  Then those two values were used to get the corresponding y value.  This was done for every pixel position.  The following image was produced after implementing the bilinear interpolation.
Now I looked at the brain data and produced the following interpolated image.  The image does look smoother than the first stretched image.

Questions
  • What, if anything, makes interpolation of your data tricky?
    • The interpolation is made a little tricky by not having only integers.  
  • Do you notice anything odd about the data? Do any values stick out? 
    • I did not notice anything odd the data seemed to work fine once the algorithm was implemented.

ISOCONTORS - MARCHING CUBES
I went back to the test data to test the marching cubes.  I first implemented the algorithm without interpolating the data but just by figuring out the cell binary values and then using those values to draw the possible cubes.  I drew the following image using this approach.
 This matched the example on the assignment page with the exception that some of my ambiguous cube cases were flipped.  I then used the map() function to help mapping the values to the grid range. The following image is achieved after this adjustment.
Next I loaded the brain data set with an isovalue of 176.
To explore the isovalues, I added an up-down-arrow interaction which will increment the isovalue by 2.  On the low end the image will disappear when the isovalue is set around 100 on the high end it disappears around 230.  Below is an image with an isovalue of 210 and 144.


I also implement the 'c' keystroke to switch between marching cubes and the bilinear interpolation image.

Questions
  • Are there any problems with your marching squares algorithm?
    • it works as described
  • What is an interesting isovalue on the brain data set? Why?
    • the isovalue 210 is interesting because it highlights the skull rather than the brain.
  • Compared to a color map, are there any tasks that isocontours seem more effective for? Why or why not? Which technique do you think is better?
    • I don't think one technique is better that the other.  The ability to change the isovalues is useful for the isocontors, this would be useful to focus attention to a particular feature.  
DATA EXPLORATION
Below is the Mt. Hood with the color values I used for the brain data.
The following is the Mt. Hood data with a three toned color map.  Negative values in the file make a clear demarcation between the high contrast areas.
For marching squares the image did not show up until the isovalue was set to 126 or lower.  The highest peaks are not seen until the isovalue is less than zero.

Questions
  • How did you adjust your color map for the mt Hood data set?
    • I added a third tone to the color map to make the peak area less saturated.
  • Did the isocontors in the mt Hood dataset differ from the brain data set? Why?
    • Yes there are far less points that have similar values. The effect is only a few parts of the image are contoured at any one isovalue.
  • For the brain and mt Hood data sets, were either color maps or isocontors more effective for either one of these data sets? Why?
    • I think the brain set work much better with the contors because of the issue mentioned in the previous question. the color map that I had set for the brain was not as effective with the mount hood data. Once adjusted the color map seemed to be similar for both.
the mt. hood adjusted color map on the brain data.

No comments:

Post a Comment