comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: 3D images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: 3D images [message #39844 is a reply to message #39843] Mon, 21 June 2004 06:31 Go to previous messageGo to previous message
Timm Weitkamp is currently offline  Timm Weitkamp
Messages: 66
Registered: August 2002
Member
On 18.06.04 at 13:49 -0700, Aleks wrote:

> Hello,
> this board has been very helpful and I was wondering if anyone could
> help me with the following.
> I'm trying to construct a cylinder. I made a circle in photoshop and
> made 10 copies of the file just renaming it. (example circle_01.tiff,
> ...._02.tiff etc)
>
> [...]

If those images do not contain anything more than a binary image of a
cylinder, then the best is to forget Photoshop and do everything in IDL.
Like this, for example:


;; (code starts here)

nx = 1600
ny = 1200
nz = 80
radius = 500.0


;; Define coordinates

xVec = FINDGEN(nx) - (nx -1 ) / 2.0
yVec = FINDGEN(ny) - (ny -1 ) / 2.0
x = xVec # (1.0 + FLTARR(ny))
y = yVec ## (1.0 + FLTARR(nx))
r = SQRT(x^2 + y^2)


;; Calculate image of filled circle

circle = r LT radius


;; Extend circle into third dimension

cylinder = REBIN(circle, nx, ny, nz)


;; "Cap" cylinder with zero slice on top and bottom

cylinder[*, *, 0] = 0
cylinder[*, *, nz-1] = 0


;; Fire up Slicer3 to visualize interactively

SLICER3, PTR_NEW(cylinder)


;; (code ends here)

In "Slicer3" you can then simply have a 3D isosurface plot drawn by
selecting "Mode: Surface", then "Low", and clicking on "Display". After
that, there are lots of ways to change angles, color, etc.

There are alternatives to SLICER3, among which are XVOLUME and Volume
Objects. Just try and see which suits you best.

Hope this helps

Timm

--
Timm Weitkamp <http://people.web.psi.ch/weitkamp>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Saving an application state
Next Topic: TeXtoIDL update: Easy Greek letters in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 15 17:46:28 PDT 2025

Total time taken to generate the page: 1.50942 seconds