<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear All:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; During the past two days, I got really 
nice from this group list and&nbsp;finally installed the VTK 5.2 (upgraded from 
VTK 5.0) and QT 4.4.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; Since it is my first time to use QT to 
design GUI, I tried two simple examples recommended by Dr. Eric E Monson at Duke 
University, and both run very well.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;Now, I copy and paste some simple codes from 
my previous program,, which&nbsp;worked very well under VTK 5.0.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; But I do not know why&nbsp;those two 
problems&nbsp;appeared. Any hint or clue should be&nbsp;highly 
appreciated.</FONT></DIV>
<DIV><FONT face=Arial 
size=2>----------------------------------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>SimpleView4.cxx<BR></FONT></DIV>
<DIV><FONT face=Arial 
size=2>E:\QT_Practice\QT_SimpleView\src\SimpleView4.cxx(93) : error C2664: 'void 
__thiscall vtkPolyDataAlgorithm::SetInput(class vtkDataObject *)' : cannot 
convert parameter 1 from 'class vtkImageData *' to 'class vtkDataObject 
*'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types pointed to are unrelated; 
conversion requires reinterpret_cast, C-style cast or function-style 
cast<BR>E:\QT_Practice\QT_SimpleView\src\SimpleView4.cxx(136) : error C2664: 
'void __thiscall vtkAlgorithm::SetInputConnection(class vtkAlgorithmOutput *)' : 
cannot convert parameter 1 from 'class vtkPolyData *' to 'class 
vtkAlgorithmOutput *' <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types 
pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or 
function-style cast<BR>Error executing cl.exe.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The first error refers to&nbsp; 
isoSurface-&gt;SetInput(readerSegmented-&gt;GetOutput());<BR>while the second 
error refers to 
mapper-&gt;SetInputConnection(normals-&gt;GetOutput());<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>------------------------------------------Directly 
modify the SimpleView 
code-------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>void SimpleView::fileOpen()<BR>{<BR>&nbsp; // 
Geometry<BR>&nbsp; //source = vtkCylinderSource::New();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; //starting from here, modified by Dongqing 
Chen, <BR>&nbsp;//load in pgm firstly, then dicom&nbsp;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;// Load&nbsp; Segmented 
Volume<BR>&nbsp;&nbsp;&nbsp; int N1, N2, m_Slices, m_X, m_Y, m_Z;<BR>&nbsp;char 
SourcePath[256];</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;vtkPNMReader *readerSegmented = 
vtkPNMReader::New();<BR>&nbsp;&nbsp;&nbsp; readerSegmented-&gt;SetDataExtent(0, 
N1-1, 0, N2-1, 1, m_Slices);<BR>&nbsp;readerSegmented-&gt;SetDataSpacing(m_X, 
m_Y, m_Z);<BR>&nbsp;&nbsp;&nbsp; readerSegmented-&gt;SetFilePrefix 
(SourcePath);<BR>&nbsp;&nbsp;&nbsp; 
readerSegmented-&gt;SetFilePattern("%s.%03d.pgm");&nbsp; // %s is prefix, '.', 
then number taken from DataExtent (1, Slices).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; // Create 
IsoSurface<BR>&nbsp;&nbsp;&nbsp; vtkMarchingCubes *isoSurface = 
vtkMarchingCubes::New();<BR>&nbsp;isoSurface-&gt;SetInput(readerSegmented-&gt;GetOutput());<BR>&nbsp;isoSurface-&gt;SetValue(0, 
200); //you need to change this value to get the good result</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; //Clean the Data<BR>&nbsp;&nbsp;&nbsp; 
vtkCleanPolyData *cleaner = vtkCleanPolyData::New();<BR>&nbsp;&nbsp;&nbsp; 
cleaner-&gt;SetInput(isoSurface-&gt;GetOutput());<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; 
//Decimate the volume<BR>&nbsp;&nbsp;&nbsp; vtkDecimatePro *deci = 
vtkDecimatePro::New();<BR>&nbsp;&nbsp;&nbsp; 
deci-&gt;SetInput(cleaner-&gt;GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
deci-&gt;SetTargetReduction(0.25);<BR>&nbsp;deci-&gt;PreserveTopologyOn();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;//Linear SubdivisionFilter to make the mesh 
surface more denser<BR>&nbsp;&nbsp;&nbsp; vtkLinearSubdivisionFilter *linear = 
vtkLinearSubdivisionFilter::New();<BR>&nbsp;&nbsp;&nbsp; 
linear-&gt;SetInput(cleaner-&gt;GetOutput());<BR>&nbsp;int times=0; //iteration 
times, 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
//Each subdivision iteration create 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
//4 new triangles for each triangle in the polydata.<BR>&nbsp;&nbsp;&nbsp; 
linear-&gt;SetNumberOfSubdivisions(times);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; &nbsp;//Smooth the volume<BR>&nbsp;int 
m_SmoothIterations=20;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;vtkWindowedSincPolyDataFilter *smooth = 
vtkWindowedSincPolyDataFilter::New();<BR>&nbsp;&nbsp;&nbsp; 
smooth-&gt;SetInput(linear-&gt;GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
smooth-&gt;SetNumberOfIterations(m_SmoothIterations);<BR>&nbsp;&nbsp;&nbsp; 
smooth-&gt;BoundarySmoothingOn();<BR>&nbsp;&nbsp;&nbsp; 
smooth-&gt;SetFeatureAngle(120);<BR>&nbsp;&nbsp;&nbsp; 
smooth-&gt;SetEdgeAngle(90);<BR>&nbsp;&nbsp;&nbsp; 
smooth-&gt;SetPassBand(0.01);<BR>&nbsp;<BR>&nbsp;&nbsp;//Create Normal Vectors 
to enhance smoothness &amp; illumination&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp; vtkPolyDataNormals *normals = 
vtkPolyDataNormals::New();<BR>&nbsp;&nbsp;&nbsp; 
normals-&gt;SetInput(smooth-&gt;GetOutput());<BR>&nbsp;normals-&gt;SetFeatureAngle(60.0);<BR>&nbsp;&nbsp;&nbsp; 
normals-&gt;FlipNormalsOff();<BR>&nbsp;&nbsp;&nbsp; 
normals-&gt;ComputePointNormalsOn();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; // Mapper<BR>&nbsp; mapper = 
vtkPolyDataMapper::New();<BR>&nbsp; 
mapper-&gt;ImmediateModeRenderingOn();<BR>&nbsp; 
//mapper-&gt;SetInputConnection(source-&gt;GetOutputPort());<BR>&nbsp; 
mapper-&gt;SetInputConnection(normals-&gt;GetOutput());<BR>&nbsp; 
mapper-&gt;ScalarVisibilityOff();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; // Actor in scene<BR>&nbsp; actor = 
vtkActor::New();<BR>&nbsp; actor-&gt;SetMapper(mapper);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; // Add Actor to renderer<BR>&nbsp; 
ren-&gt;AddActor(actor);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; // Reset camera<BR>&nbsp; 
ren-&gt;ResetCamera();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; 
ren-&gt;GetRenderWindow()-&gt;Render();<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>void SimpleView::fileExit() {<BR>&nbsp; 
qApp-&gt;exit();<BR>}</FONT></DIV>
<DIV><FONT face=Arial 
size=2>------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Best 
Wishes,<BR>-----------------------------------------------------------------------------<BR>Dongqing 
Chen, Ph.D.<BR>Computer Vision &amp; Image Processing (CVIP) Lab<BR>Department 
of Electrical &amp; Computer Engineering<BR>Speed School of 
Engineering<BR>University of Louisville<BR>Louisville, KY, 
40292<BR>U.S.A<BR>email: <A 
href="mailto:dqchen@cvip.louisville.edu">dqchen@cvip.louisville.edu</A><BR>phone: 
1-502-852-2789 
(Lab)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
1-502-852-6130 
(Office)<BR>----------------------------------------------------------------------------</FONT></DIV></BODY></HTML>