<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.emailstyle18
        {font-family:Arial;
        color:navy;}
span.EmailStyle19
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>When I try changing SetValue to (0, .05) I
see no change.</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Any suggestions?</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Vetria</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> vtkusers-admin@vtk.org
[mailto:vtkusers-admin@vtk.org] <b><span style='font-weight:bold'>On Behalf Of </span></b>Vetria
Byrd<br>
<b><span style='font-weight:bold'>Sent:</span></b> </span></font><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Wednesday,
April 07, 2004</span></font><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma'> </span></font><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>5:00 PM</span></font><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'><br>
<b><span style='font-weight:bold'>To:</span></b> anast.jm@pg.com;
vtkusers@vtk.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [vtkusers] marching
cubes output</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>John,</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>When I changed to
volReader->SetDataExtent(04,05,04) nothing is rendered.</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>I got the
iso->SetValue(0,1) from the Medical1, 2 and 3 example code where the 1 is
supposed to correspond to the object.</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>Thanks,</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>Vetria</span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'> </span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> vtkusers-admin@vtk.org
[mailto:vtkusers-admin@vtk.org] <b><span style='font-weight:bold'>On Behalf Of </span></b>anast.jm@pg.com<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, April 07, 2004
3:47 PM<br>
<b><span style='font-weight:bold'>To:</span></b> vtkusers@vtk.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [vtkusers] marching
cubes output</span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
1.0in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>From your description, your dataset seems to be 5x6x5 but your coded
data extent is 6x6x6...I'm suprised this didn't generate an error.</span></font>
<br>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>volReader->SetDataExtent(0,5,0,5,0,5);</span></font>
<br>
<br>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>also
I'm a bit rusty on marching cubes but don't you need a value between 0 and 1 to
create the isosurface you are after??</span></font> <br>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>iso->SetValue(0,1);</span></font>
<br>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>....john</span></font>
<br>
<br>
<br>
</p>
<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
style='width:100.0%;margin-left:1.0in'>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b><font size=1 face=Arial><span style='font-size:7.5pt;
font-family:Arial;font-weight:bold'>"Vetria Byrd"
<byrdv@cis.uab.edu></span></font></b> <br>
<font size=1 face=Arial><span style='font-size:7.5pt;font-family:Arial'>Sent
by: vtkusers-admin@vtk.org</span></font> </p>
<p><font size=1 face=Arial><span style='font-size:7.5pt;font-family:Arial'>04/07/2004
04:05 PM</span></font> <br>
<font size=1 face=Arial><span style='font-size:7.5pt;font-family:Arial'>Please
respond to byrdv</span></font> </p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=1 face=Arial><span style='font-size:7.5pt;
font-family:Arial'> </span></font><br>
<font size=1 face=Arial><span style='font-size:7.5pt;font-family:Arial'>
To: <vtkusers@vtk.org></span></font>
<br>
<font size=1 face=Arial><span style='font-size:7.5pt;font-family:Arial'>
cc: (bcc: John Anast-JM/PGI)</span></font>
<br>
<font size=1 face=Arial><span style='font-size:7.5pt;font-family:Arial'>
Subject: [vtkusers] marching
cubes output</span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
1.0in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>I have written a program to extract data from 2D slices of data files.</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Five
data files were manually created. Each of the data files look like this:</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>0 0 0
0 0</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>0 0 0
0 0</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>0 0 1
0 0</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>0 0 1
0 0</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>0 0 0
0 0</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>0 0 0
0 0</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Where
the 0's indicate the object is outside the cube and 1 indicates the object is
inside the cube.</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>When I
run the program (which compiles and runs with no problems) I expected to get a
solid object representing the center of the 5x5x5 rendered object since only
the center values of the data (input) show that the object is inside but what I
get is shown in the 1<sup>st</sup> figure. Viewing the wire frame display
(2<sup>nd</sup> figure) shows the 5x5x5 grid with an unexpected dip in the top
row.</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I am
missing something, I just don't know what that "something" is.</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>What I
want the algorithm to do is render the object based on which values of the data
indicate the object is present.</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Here's
the code:</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>//</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>//
This example reads a volume dataset, extracts an isosurface and displays it.</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>//</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkRenderer.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkRenderWindow.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkRenderWindowInteractor.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkVolumeReader.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkImageReader2.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkMarchingCubes.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkPolyDataMapper.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkActor.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkOutlineFilter.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkCamera.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkProperty.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkPolyDataNormals.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>#include
"vtkContourFilter.h"</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>int
main ()</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>{</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font><br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkRenderer *ren = vtkRenderer::New();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkRenderWindow *renWin = vtkRenderWindow::New();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
renWin->AddRenderer(ren);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
iren->SetRenderWindow(renWin);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkImageReader2 *volReader = vtkImageReader2::New();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
volReader->SetDataExtent(0,5,0,5,0,5);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
volReader->SetFilePrefix("C:/data/cube/slice");</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
volReader->SetDataSpacing(1,1,1);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
volReader->Update();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font><br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
// An isosurface, or contour value of 1 is known to correspond to the</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
// object</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkMarchingCubes *iso =vtkMarchingCubes::New();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
iso->SetInput(volReader->GetOutput() );</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
iso->SetValue(0,1); </span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkPolyDataMapper *isoMapper = vtkPolyDataMapper::New();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
isoMapper->SetInput(iso->GetOutput() );</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkActor *isoActor = vtkActor::New();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
isoActor->SetMapper(isoMapper);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font><br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkOutlineFilter *outline = vtkOutlineFilter::New();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
outline->SetInput( (vtkDataSet *) volReader->GetOutput() );</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkPolyDataMapper *outlineMapper = vtkPolyDataMapper::New();</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
outlineMapper->SetInput(outline->GetOutput() );</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
vtkActor *outlineActor = vtkActor::New();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
outlineActor->SetMapper(outlineMapper);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
outlineActor->VisibilityOff();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font><br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
//</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
// Add the actors to the renderer, set the background and size</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
//</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
ren->AddActor(outlineActor);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
ren->AddActor(isoActor);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
ren->SetBackground(0.2,0.3,0.4);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
renWin->SetSize(450,450);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
ren->GetActiveCamera()->Elevation(90);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
ren->GetActiveCamera()->SetViewUp(0,0,-1);</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
iren->Initialize();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
// render the image</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
iren->Start();</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
return 0;</span></font> <br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>}</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thanks.</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>_______________</span></font>
<br>
<font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Vetria
L. Byrd</span></font> <br>
<br>
</p>
</div>
</body>
</html>