Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Voxel analysis?

Subject: Voxel analysis?

From: boggie

Date: 1 Dec, 2008 10:34:45

Message: 1 of 9

Hi all,

has anyone heard of a 3-D voxel analysis (other than image
processing)? The data I have is in spatio-temporal format (time
plotted against 2-D coordinates). Thanks!

Best,
Jie

Subject: Voxel analysis?

From: David

Date: 1 Dec, 2008 11:24:01

Message: 2 of 9

boggie <Jie.Bao@gmail.com> wrote in message <c27fb948-a131-474f-9641-e2ee22a285d8@d32g2000yqe.googlegroups.com>...
> Hi all,
>
> has anyone heard of a 3-D voxel analysis (other than image
> processing)? The data I have is in spatio-temporal format (time
> plotted against 2-D coordinates). Thanks!
>
> Best,
> Jie

google has, about 365k times:
http://www.google.com/search?hl=en&q=3-D+voxel+analysis+

Subject: Voxel analysis?

From: Thomas Clark

Date: 1 Dec, 2008 12:46:01

Message: 3 of 9

All a voxel is is a data point. So you can do any analysis which is possible for a 3D field.

Explain your problem a bit better (what do you have, what are you trying to achieve) and we might be able to help a bit more...

Tom

Subject: Voxel analysis?

From: boggie

Date: 1 Dec, 2008 18:10:00

Message: 4 of 9

Thanks for the feedback. The data I've got is basically a point set,
each point has its x,y 2-D coordinates and a time. Let's say I now
have multiple such data sets, and I wanna analyse it in a quite
intuitive way (e.g. if there are any clusters). I heard there's a
method to first discretize the 3-D space into voxels and apply a
certain filter if needed, etc. Any idea?

Jie

Subject: Voxel analysis?

From: ImageAnalyst

Date: 1 Dec, 2008 18:30:40

Message: 5 of 9

On Dec 1, 1:10=A0pm, boggie <Jie....@gmail.com> wrote:
> Thanks for the feedback. The data I've got is basically a point set,
> each point has its x,y 2-D coordinates and a time. Let's say I now
> have multiple such data sets, and I wanna analyse it in a quite
> intuitive way (e.g. if there are any clusters). I heard there's a
> method to first discretize the 3-D space into voxels and apply a
> certain filter if needed, etc. Any idea?
>
> Jie

---------------------------------------------------------
Jie:
So you have a N by 3 array dataSet(N,3) where the first index is the
data point index, and the second index gives the value:
dataSet(N,1) is the x coordinate
dataSet(N,2) is the y coordinate
dataSet(N,3) is the time coordinate
You can convert this into a 3D data set you just need to decide how
you want to quantize the values. For example, let's say that you want
to chop the x, y, and time ranges into 1000 bins each. Then create an
integer array of (1000,1000,1000) and scan through your dataSet. Get
the x coordinate and convert that into an index (pixel) and do the
same for y and time. Then you have an index in 3D. Increment the
integer array at that 3D index by 1. Some 3D indices may occur more
than once, for example, if your dataset has some points duplicated
(but probably won't happen many times). So you will now have a 3D
image matrix where there is a lot of empty space (0's) and some voxels
that have a value (mostly 1 but possibly 2 or 3 or 4...).
Now you can do cluster analysis (e.g. K-means or similar,
http://en.wikipedia.org/wiki/Data_clustering)
Regards,
ImageAnalyst

Subject: Voxel analysis?

From: boggie

Date: 1 Dec, 2008 18:51:32

Message: 6 of 9

Let me be a bit more specific, say I have a n-by-3 matrix, where n is
the number of points, the 1st column is x, the 2nd column being y and
the last column being time. Certainly I can plot this matrix in 3-D
and discretize the space arbitrarily. Now I have more than one such
matrices, and I'd like to know if they are similar to each other, any
thoughts? From what I understood, one can cluster the data points
directly in 3-D, so how does discretization or partitioning come into
play here? Thanks!

Jie

Subject: Voxel analysis?

From: Oliver Woodford

Date: 2 Dec, 2008 21:46:01

Message: 7 of 9

boggie <Jie.Bao@gmail.com> wrote in message <2b2019db-c37f-4918-8fd5-0c2e95cb5a35@y18g2000yqn.googlegroups.com>...
> Let me be a bit more specific, say I have a n-by-3 matrix, where n is
> the number of points, the 1st column is x, the 2nd column being y and
> the last column being time. Certainly I can plot this matrix in 3-D
> and discretize the space arbitrarily. Now I have more than one such
> matrices, and I'd like to know if they are similar to each other, any
> thoughts? From what I understood, one can cluster the data points
> directly in 3-D, so how does discretization or partitioning come into
> play here? Thanks!
>
> Jie

Similar? Similar how? Define a similarity metric first... Do you care about relative point density, or just minimum distance between points in the two sets?

Subject: Voxel analysis?

From: Thomas Clark

Date: 3 Dec, 2008 12:20:18

Message: 8 of 9

Let's think about a hypothetical example where you'd have that kind of data... recording brownian motion.

So, I'm not a big physicist, but let's take brownian motion: Drop a light particle onto a water surface. Observe it's x,y position on the surface over time; it'll jitter around with some 'random' motion, which will give a data set similar to yours.

A few different ways of analysing that, let's look at one example:
Say we want to see whether there is any coherent motion toward the y direction over time (this is your 'similarity metric' mentioned above). Basically, we want to plot a histogram. Instead of the normal histogram (the bell-curve 2D plot that you might get if you look at the MATLAB help page for hist() function), we want one which varies in 2 directions, y and t, with the z axis indicating the frequency with which the particle lies at a given y-position during a given timeframe.

This is where the previous poster's 'bins' comment is applicable. You need a grid, where each point in the grid represents a bin. Say t varies between 0 and 1000 seconds, and y varies between -20 and 20 mm:

% A code snippet:
y_bins = -19:2:19;
t_bins = 50:100:950;

... gives you 20 bins in the y direction (e.g. the first bin spans y_bins(1)-1 to y_bins(1)+1 ), 10 bins in the t direction (first bin spans t_bins(1)-50 to t_bins(1)+50 ). Your z-coordinate of the 3D histogram should be a 20 by 10 array.

Each element of this array corresponds to one y bin and one t bin; For each element of the array, count how many times in your datasets that the particle is in the y bin AND in the t bin corresponding to this element. Store the total number in that element.

Assuming you've called your z-elements array 'Z', type:
surf(Z)

and you plot a 3D histogram. You can adjust the x and y axes either manually or by creating X and Y matrices (see the meshgrid command) and inputting them to the surf command... see help(surf) and help(meshgrid) for this.

If your surface plot turns out spiky, with no particular pattern; then there is no correlation between time and the y position. You have truly random data.

If it turns out to be a smooth hump; you're able to see a trend... in the example of brownian motion (correct me if I'm wrong, physicists), you'd see a hump in the y direction, centred on y = 0 (because the particle jitters about it's original position); but no correlation over time (so you'd see the same hump in each time bin).

AAAaaannnnnddd.... I'm done.

Hope this helps

Tom Clark

Subject: Voxel analysis?

From: ImageAnalyst

Date: 3 Dec, 2008 14:19:17

Message: 9 of 9

On Dec 3, 7:20=A0am, "Thomas Clark" <t.cl...@remove.spamcantab.net>
wrote:
> Let's think about a hypothetical example where you'd have that kind of da=
ta... recording brownian motion.
>
> So, I'm not a big physicist, but let's take brownian motion: Drop a light=
 particle onto a water surface. Observe it's x,y position on the surface ov=
er time; it'll jitter around with some 'random' motion, which will give a d=
ata set similar to yours.
>
> A few different ways of analysing that, let's look at one example:
> Say we want to see whether there is any coherent motion toward the y dire=
ction over time (this is your 'similarity metric' mentioned above). Basical=
ly, we want to plot a histogram. Instead of the normal histogram (the bell-=
curve 2D plot that you might get if you look at the MATLAB help page for hi=
st() function), we want one which varies in 2 directions, y and t, with the=
 z axis indicating the frequency with which the particle lies at a given y-=
position during a given timeframe.
>
> This is where the previous poster's 'bins' comment is applicable. You nee=
d a grid, where each point in the grid represents a bin. Say t varies betwe=
en 0 and 1000 seconds, and y varies between -20 and 20 mm:
>
> % A code snippet:
> y_bins =3D -19:2:19;
> t_bins =3D 50:100:950;
>
> ... gives you 20 bins in the y direction (e.g. the first bin spans y_bins=
(1)-1 to y_bins(1)+1 ), 10 bins in the t direction (first bin spans t_bins(=
1)-50 to t_bins(1)+50 ). Your z-coordinate of the 3D histogram should be a =
20 by 10 array.
>
> Each element of this array corresponds to one y bin and one t bin; For ea=
ch element of the array, count how many times in your datasets that the par=
ticle is in the y bin AND in the t bin corresponding to this element. Store=
 the total number in that element.
>
> Assuming you've called your z-elements array 'Z', type:
> surf(Z)
>
> and you plot a 3D histogram. You can adjust the x and y axes either manua=
lly or by creating X and Y matrices (see the meshgrid command) and inputtin=
g them to the surf command... see help(surf) and help(meshgrid) for this.
>
> If your surface plot turns out spiky, with no particular pattern; then th=
ere is no correlation between time and the y position. You have truly rando=
m data.
>
> If it turns out to be a smooth hump; you're able to see a trend... in the=
 example of brownian motion (correct me if I'm wrong, physicists), you'd se=
e a hump in the y direction, centred on y =3D 0 (because the particle jitte=
rs about it's original position); but no correlation over time (so you'd se=
e the same hump in each time bin).
>
> AAAaaannnnnddd.... I'm done.
>
> Hope this helps
>
> Tom Clark

-------------------------------------------------
If Brownian motion is like a random walk, then this is an interesting
situation. I, probably like most people, once thought that if you add
a random number between -1 and +1 to a number, then the average value
(location) will stay the same after many, many hundreds of
iterations. It may drift away but eventually will drift back, and
you'd get a symmetrical distribution. However it's not true. It will
wander away from the starting point indefinitely (forever) with only
minor backtracks due to randomness. There's a bunch of math
describing this phenomenon. For example,
http://en.wikipedia.org/wiki/Random_walk
http://www.statistics-help-online.com/node48.html
The stock market people have fun with this - basis for all kinds of
predictions (google it).

(It's sometimes also called the drunkard's path or walk)
Just a fun aside . . . . . . .
Regards,
ImageAnalyst

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us