1
$\begingroup$

I have a time-dependent system of varying number of particles (~100k particles). In fact, each particle represents an interaction in a 3D space with a particular strength. Thus, each particle has (X,Y,Z;w) which is the coordinate plus a weight factor between 0 and 1, showing the strength of interaction in that coordinate. Here http://pho.to/9Ztti I have uploaded 10 real-time snapshots of the system, with particles are represented as reddish small dots; the redder the dot, the stronger the interaction is.

The question is: how one can produce a 3D (spatial) density map of these particles, preferably in Matlab or Origin Pro 9 or ImageJ? Is there a way to, say, take the average of these images based on the red-color intensity in ImageJ?

Since I have the numerical data for particles (X,Y,Z;w) I can analyze those data in other software as well. So, you are welcome to suggest any other analytical approach/software

Any ideas/comments are welcome!

$\endgroup$
2
  • $\begingroup$ well, have you tried anything so far? $\endgroup$
    – tel
    Jul 17, 2015 at 3:27
  • $\begingroup$ yep; ImajeJ and Origin Pro; both not successful. $\endgroup$
    – deeep
    Jul 17, 2015 at 4:53

3 Answers 3

1
$\begingroup$

R packages misc3d and rgl. The function image3d in misc3d does what you need and is very parametrizable via rgl (change the transparency, the view angle, axes, etc...). I used it with fairly big arrays (~10000000 data points/plots) and it produced great 3D density plots.

Both R (e.g. package biOps) and Matlab (image processing toolbox) have very powerful tools for image analysis if you need to get for example RBG levels in your plots but as far as I understood, you have the 3D arrays containing the interaction values, right?

Matlab proposes similar tools if you prefer Matlab (don't remember the exact functions) over R and both will require a fair amount of RAM as the data must be loaded in the environment.

As your system is time dependent you can also create movies fairly easily if you wish so (e.g. rgl's movie3d function).

Here a quick example of a 3D density plot:

enter image description here enter image description here

$\endgroup$
12
  • $\begingroup$ Yep; you're right. I have the arrays of $x$ , $y$ , and $z$, and $w$ for the interactions locations and strength. $\endgroup$
    – deeep
    Jul 19, 2015 at 9:47
  • $\begingroup$ Ok, then it is quite straightforward to make such plots using those functions. $\endgroup$ Jul 19, 2015 at 10:44
  • $\begingroup$ Well, I installed R , misc3d and rgl packages. But, to use image3d, one needs a "3 dimensional data array". My collection of $(X,Y,Z)$s makes a 2D array. Should I convert it to 3D??? and how?? $\endgroup$
    – deeep
    Jul 20, 2015 at 2:34
  • $\begingroup$ @deeep how is a collection of (X,Y,Z) 2D? $\endgroup$ Jul 20, 2015 at 20:59
  • $\begingroup$ Well, here is the collection of my $(X,Y,Z)$s: $$x_{1@t1} \quad y_{1@t1} \quad z_{1@t1}$$ $$x_{2@t1} \quad y_{2@t1} \quad z_{2@t1}$$ $$...$$ $$x_{N@t1} \quad y_{N@t1} \quad z_{N@t1}$$ $$--------------$$ $$x_{1@t2} \quad y_{1@t2} \quad z_{1@t2}$$ $$x_{2@t2} \quad y_{2@t2} \quad z_{2@t2}$$ $$...$$ $$x_{M@t2} \quad y_{M@t2} \quad z_{M@t2}$$ $$--------------$$ $$.$$ $$.$$ Where $t1$ refers to time 1, $t2$ time 2, etc. Also $N$ is the number of particles (=interactions) at time 1, $M$ number of particles at time 2, and so on. To me this is a 2D array, like in Matlab. $\endgroup$
    – deeep
    Jul 21, 2015 at 11:13
1
$\begingroup$

One approach: fit a kernel density estimator to the observed coordinates $\{ (X_i,Y_i,Z_i) \}$ and color by density: https://stackoverflow.com/questions/25286811/how-to-plot-a-3d-density-map-in-python-with-matplotlib/25354417#25354417

Incorporating the weights $w$ of each observation is a bit trickier, but there's code to do this: https://stackoverflow.com/questions/27623919/weighted-gaussian-kernel-density-estimation-in-python/27623920#27623920 , which you can swap in instead of stats.gaussian_kde.

$\endgroup$
0
$\begingroup$

Trying to analyze that much data in ImageJ seems likely to end in frustration. Matlab is probably a more productive angle. Personally, I would use Python. Specifically, the numpy module. Try looking into the histogramdd function in numpy. It might be able to accomplish what you're after.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .