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

Home » Public Forums » archive » IsoSurface
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IsoSurface [message #39727] Wed, 09 June 2004 14:44 Go to next message
siliconcube is currently offline  siliconcube
Messages: 11
Registered: June 2004
Junior Member
Hi all,
ok here is the problem I have: I'm trying to run a test on different
images to figure out how things work. Previously I was helped to find
the size of my tiff image. I modified the code accordingly.
Unfortunatelly, when I try to run this code on my images the first
Window function shows me all my images but when the execution gets to
the second Window Function I lose IDL ie it crashes. I have 81 nearly
identical image. (if you would like to see the image you can check it
out here http://www.geocities.com/siliconcube/tree_01.tif
images were modified with MatLab). Can anyone help me identify the
problem, is my image not suitable for Iso Surface or am I doing
somethign wrong =/.

Thanks
Aleks


files=findfile('*.tif')
index=bsort(files, sortedfiles)


volume=bytarr(761,671,81)

for j=0,80 do begin
image=read_tiff(sortedfiles[j])
volume[0,0,j] = image
endfor

Window, Title='Original Image Slices', XSize=800, YSize=500, 1,
XPos=0, YPos=0
LoadCT, 0
Device, Decomposed=0
FOR j=0,49 DO TV, volume[*,*,j], j

Window, 6, XSize=800, YSize=800, Title='Test IsoSurface'
Scale3, XRange=[0,760], YRange=[0,670], ZRange=[0,80], AZ=-150
Shade_Volume, volume, 81, vertices, polygons, /Low
theHead = PolyShade(vertices, polygons, /T3D)
TV, theHead



end
Re: IsoSurface [message #39790 is a reply to message #39727] Fri, 11 June 2004 06:47 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1b324f1129a39d0d989798@news.frii.com...
> Aleks writes:
>
>> This is the compilation log that I have when I run the program:
>>
>> IDL Version 6.0, Microsoft Windows (Win32 x86 m32). (c) 2003, Research
Systems, Inc.
>>
>> IDL> .compile test
>> % Compiled module: $MAIN$.
>> IDL> .go
>> % Compiled module: BSORT.
>> % Loaded DLM: TIFF.
>> % Compiled module: LOADCT.
>> % Compiled module: FILEPATH.
>> % Compiled module: PATH_SEP.
>> % LOADCT: Loading table B-W LINEAR
>> % Compiled module: SCALE3.
>> % Compiled module: T3D.
>> % POLYSHADE: Expression must be an array in this context: POLYGONS.
>> % Execution halted at: $MAIN$ 19 C:\RSI\IDL60\test.pro
>>
>> And this is the code
>
> Yes, well, the polygons are suppose to be coming
> from the command you have commented out:
>
>> ;Shade_Volume, volume, 81, vertices, polygons, /Low
>> theHead = PolyShade(vertices, polygons, /T3D)
>
> Why did you comment that line out? Have you figured out
> what is a better contouring value than 81? What is the
> minimum and maximum of your data? How is your data
> distributed?
>
> Are you getting all of the messages in this thread? :-)

Aside from the good advice David gave about making sure you are really
calling Shade_Volume and picking the right isovalue, you might try the
ISOSURFACE procedure. It has the same arg list (not kwds) as Shade_Volume,
but uses a different algorithm. It is easy to give it a try.

The error message you got above from POLYSHADE indicates that your vertices
variable is empty, because either you didn't really call SHADE_VOLUME or the
call to SHADE_VOLUME resulted in no surface being generated. The latter can
happen if you don't pick an isovalue appropriate for your data.

Karl
Re: IsoSurface [message #39793 is a reply to message #39727] Thu, 10 June 2004 18:41 Go to previous message
siliconcube is currently offline  siliconcube
Messages: 11
Registered: June 2004
Junior Member
David Fanning <davidf@dfanning.com> wrote in message news:<MPG.1b3230cefddeb8fa989796@news.frii.com>...
> Aleks writes:
>
>> I'm not sure if memory is the problem in my case because my machine
>> has 5GB of RAM ='(
>
> I think you probably have enough memory. But how did you
> get the keys to the Ferrari is what I'm wondering. :-)
>
> Cheers,
>
> David

Ferarri? Is that a nickname for my '94 Altima because I like it =).
Hehehe I run my programs on university cluster computers. I don't
think I can afford 5GB of DDR yet on my salary
thanks for the help, gonna try to figure this out
the night is young
Aleks
Re: IsoSurface [message #39797 is a reply to message #39727] Thu, 10 June 2004 10:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Aleks writes:

> This is the compilation log that I have when I run the program:
>
> IDL Version 6.0, Microsoft Windows (Win32 x86 m32). (c) 2003, Research Systems, Inc.
>
> IDL> .compile test
> % Compiled module: $MAIN$.
> IDL> .go
> % Compiled module: BSORT.
> % Loaded DLM: TIFF.
> % Compiled module: LOADCT.
> % Compiled module: FILEPATH.
> % Compiled module: PATH_SEP.
> % LOADCT: Loading table B-W LINEAR
> % Compiled module: SCALE3.
> % Compiled module: T3D.
> % POLYSHADE: Expression must be an array in this context: POLYGONS.
> % Execution halted at: $MAIN$ 19 C:\RSI\IDL60\test.pro
>
> And this is the code

Yes, well, the polygons are suppose to be coming
from the command you have commented out:

> ;Shade_Volume, volume, 81, vertices, polygons, /Low
> theHead = PolyShade(vertices, polygons, /T3D)

Why did you comment that line out? Have you figured out
what is a better contouring value than 81? What is the
minimum and maximum of your data? How is your data
distributed?

Are you getting all of the messages in this thread? :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: IsoSurface [message #39802 is a reply to message #39727] Thu, 10 June 2004 08:48 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Aleks writes:

> I'm not sure if memory is the problem in my case because my machine
> has 5GB of RAM ='(

I think you probably have enough memory. But how did you
get the keys to the Ferrari is what I'm wondering. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: IsoSurface [message #39803 is a reply to message #39727] Thu, 10 June 2004 08:46 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Aleks writes:

> Previously I used MatLab to combine slices of data and construct 3D
> models. My advisor chose to switch to IDL because of its "powerfull"
> features. 81 came from the number of slices I have. I'm not really
> sure what you mean by range of my values?

When you use Shade_Volume you are trying to create
a 3D contour of your data at some "value". If your
data values range from 100 to 200 and you contour
at 81, and look for the values "lower" than the
contour value, you are not likely to see much in
your plot. :-)

So, in the above example, if your data ranges in
value from 100 to 200, setting a contour level of
150 might be reasonable. The contour level should
be set based on the data values in the volume, not
the number of frames in the volume.

One way to see what range of data values you have is
to plot a histogram of the data values in the volume:

IDL> Plot, Histogram(vol)

You might see some likely looking peaks in the
histogram. Just above or below, or perhaps right
in the middle of a peak might be an appropriate
place to choose a contouring value for a 3D contour.

For a quick test to see if your contouring value is
"reasonable" you might pick something between the
minimum and maximum of the data:

IDL> Print, Min(vol), Max(vol)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Array indices and lookup tables
Next Topic: Super/sub-script in widget program?

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

Current Time: Wed Oct 08 18:39:44 PDT 2025

Total time taken to generate the page: 0.00535 seconds