Re: 3D Density Plots? [message #13709] |
Fri, 04 December 1998 00:00 |
steinhh
Messages: 260 Registered: June 1994
|
Senior Member |
|
|
In article <3666E8C4.A4BC3E8@optics.rochester.edu>
Scott Norton <norton@optics.rochester.edu> writes:
> Does anyone know how to generate 3D density plots? In other words
> given a set of x,y,z positions, produce a 3D image which establishes a
> voxel value as the "density" of positions in a region. This is
> essentially a 3D scatterplot with a sort of fuzzy cloud function around
> the dense regions.
> Any clues? Please email directly to me as well as the newgroup, since
> I'm a little desperate and short on time.
How about building a 3D volume and filling it with the density,
something like the program included below.
For some reason I had to edit the SLICER3 program to get it
running properly, line 5338 has a reference to demo_filepath(),
which I don't seem to have..... Changing it to just filepath()
seems to work... Although I think it still needs some work,
because starting SLICER3 gobbles up the data pointed to
by its argument even if you exit as the first thing after
it starts... Bug? Or just me/my site? What about others?
When slicer3 starts, select e.g. the Projection mode,
use Projection type "Avg." and press display. A funny
thing is that pressing "Display" repeatedly changes
the display.... guess that's ok, since stuff will be
piling up in the Z-buffer until you do an Erase (under
Tools)....
Regards,
Stein Vidar
PRO dcube
N = 20
cube = fltarr(N,N,N)
cubx = (findgen(N,N,N) MOD N)-N/2.0
cuby = transpose(cubx,[1,0,2])
cubz = transpose(cubx,[1,2,0])
particles = randomn(seed,3,50) ;; Particle positions
FOR i=0,(size(particles,/dim))(1)-1 DO BEGIN
px = particles(0,i)
py = particles(1,i)
pz = particles(2,i)
gauss = exp(-((cubx-px)^2+(cuby-py)^2+(cubz-pz)^2)/5.0)
cube = temporary(cube)+gauss
END
pdata=ptr_new(bytscl(cube))
slicer3,pdata
END
|
|
|
Re: 3D Density Plots? [message #13720 is a reply to message #13709] |
Thu, 03 December 1998 00:00  |
Scott Norton
Messages: 6 Registered: October 1998
|
Junior Member |
|
|
PS. I forgot to mention. I have IDL 5.2
Thanks.
Scott Norton wrote:
> Does anyone know how to generate 3D density plots? In other words
> given a set of x,y,z positions, produce a 3D image which establishes a
> voxel value as the "density" of positions in a region. This is
> essentially a 3D scatterplot with a sort of fuzzy cloud function around
> the dense regions.
> Any clues? Please email directly to me as well as the newgroup, since
> I'm a little desperate and short on time.
> Thanks!
> -Scott Norton, SurroMed, Inc.
> Scott_Norton@surromed.com
|
|
|