Sunday, January 27, 2008

Brain Theory = Game Theory?

Harvard scientists are attempting to create a high resolution map of a mouse brain. They want to understand the anatomical properties of the brain and map the connections between different neurons.

Researchers all over the world are rushing to understand the brain; the problem is that they all think their method of research is the only correct method.

Connectomic researchers believe that the only way to understand the brain is by mappingnhow all the neurons interact with each other.

Geneticists believe that the path to greater cerebral understanding is by noting which genes affect brain development.

Biochemists think that we must notate every chemical path way for every brain mechanism.

Brain signal analysts feel that analyzing the brain's methods of signal processing is the only route to understand our brains.

All of these researchers have one thing in common, they are all wrong. Whatever happened to collaboration? If an ornithologist claimed that the only way to understand the ecosystem was by studying birds, and the study of any other creature was a waste of time, most people would think that ornithologist is out to lunch, right? So how can brain researcher understand the mind if they only study one of its properties?

All of the aforementioned research methods have the common goal of exploring the brain, but most researchers do not want to collaborate because they do not want to share the glory. The only way we will really begin to understand the brain is if researchers in different fields start working together and we try to learn in small, modular steps. Mapping an entire neural network is great, if you share that data with thousands of researcher groups who all look at different components and use different methods of analysis; but, it is pointless for thousands of research groups to independently study an entire neural network. Didn't Nash have a theory on this?

Thursday, January 24, 2008

Label Persistence on an Image in WPF

One of my side projects is an application that presents the user with an image of the human body with labels on different parts of the anatomy. The user can then click on the label and be presented with information about that body part. Here is an example of a skeleton with its skull labeled:

I am writing my application in Visual Basic using WPF. WPF is a very powerful technology that allows rapid user interface development; however, it does not have a native mechanism for label persistence. That is, if I label a part of an image, the label will not automatically reconfigure itself with the image if the user resizes the application. This means if the user resizes my application while it is displaying the above image, the skull label will no longer be on top of the skull in the image.

The solution to this problem turned out to be trivial, I am just surprised that Microsoft did not create a feature to handle this user scenario; a scenario that, I would think, is relatively common.
To solve this problem, I had to store several data points.
  1. The original height and width of the image.

  2. The 4 margin distances (distances between the left, right, top, and bottom of the label from the left, right, top, and bottom of the image, respectively).

  3. The width and height of the label itself.

Normally a control object in a user interface is only represented by two data points, its x and y coordinates; however, I had to represent the label with the 6 data points mentioned in 2. and 3. to maintain label persistence.

Now for the algorithm:

  1. On a resize event, I calculate the change of both the height and the width of the image.

    Dim widthMultiplier As Double = AnatomyImage.ActualWidth / oldWidth

    Dim heightMultiplier As Double = AnatomyImage.ActualHeight / oldHeight

  2. I then use these multipliers to reevaluate the margins, height, and width of the label.

    Dim x As New Thickness With {.Top = Label1.Margin.Top * heightMultiplier, _
    .Bottom = Label1.Margin.Bottom * heightMultiplier, _
    .Left = Label1.Margin.Left * widthMultiplier, _
    .Right = Label1.Margin.Right * widthMultiplier _
    Label1.Margin = x
    Label1.Width = Label1.ActualWidth * widthMultiplier
    Label1.Height = Label1.ActualHeight * heightMultiplier

Thus, the label is always in the same relative location on the image because its height, width, and margins still "own" the same relative percentage of the image.

...Seriously though, why was label persistence not a property in WPF?!

Monday, January 14, 2008

The Cocktail Party Problem

The cocktail party problem is a common problem in digital signal processing. It describes a scenario where a number of guests are in the same room at a cocktail party having simultaneous, mutually exclusive conversations. For our example, let's assume there are 5 speakers having mutually exclusive conversations. We want to record the conversations and play them at a later date.

If we place a single microphone in the middle of the room and record all of the conversations, we will hear distorted bits of different conversation when we play back the recording. We may be able to tease apart bits and pieces of the conversation from the speaker who was closest to the microphone; however, this is far from ideal and we can do much better. If we place five or more microphones in different parts of the room and record all of the conversations, then we can tease apart each conversation by analyzing the collective recordings.

This is done through Independent Componenet Analysis (ICA). ICA is a mathematical process that takes n linear equations as input and produces n linearly independent equations as output. Thus, if we take the five recordings, one from each mic, and process it through ICA, five independent speeches will be produced as output. These independent speeches correspond to the different conversations that were being recorded.

ICA is useful in EEG brain research because the EEG produces a cocktail party scenario. The brain has many componenets that may be "talking" at the same time, like the speakers at the party, and the EEG channels record voltage readings from the brain, like the microphones in the room. Thus, ICA allows us to seperate the data into independent equations that we believe correspond to different components in the brain.