<DIV>Hi, all</DIV>
<DIV> </DIV>
<DIV>
<DIV><FONT face=Verdana><I><FONT face=宋体><FONT face=Verdana>I am having some trouble in creating a visualisation from aseries of tif images.<BR>I took the Medical1.cxx script as a template and edited it.<BR>basically changing the image reader to a TIFFReader.<BR>but when i run the whole thing i always get the folloeing error:</FONT><BR></FONT><BR>vtkPolyDataNormals (0x0221FC48): No data to generate normals for!<BR><BR>There is 60 images named 001.tif through 060.tif.<BR>they are monochrome 1760x1024 tif images<BR><BR>Can anyone help me?<BR></I></FONT></DIV>
<DIV><FONT face=Verdana><I>Thanks a lot,</DIV></I></FONT>
<DIV><FONT face=Verdana><I> --
<DIV><I>Jerry</I><BR><BR>Here is the script:<BR><BR> vtkRenderer *aRenderer = vtkRenderer::New();<BR> vtkRenderWindow *renWin = vtkRenderWindow::New();<BR> renWin->AddRenderer(aRenderer);<BR> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<BR> iren->SetRenderWindow(renWin);</I></FONT></DIV></DIV>
<DIV><FONT face=Verdana><I> </I></FONT><FONT face=Verdana><I>vtkTIFFReader *v16 = vtkTIFFReader::New();<BR> v16->SetFilePrefix ("");<BR> v16->SetFilePattern("%s%03d.TIF");<BR> v16->SetDataExtent(0,1760,0,1024,1,60);</I></FONT></DIV>
<DIV><FONT face=Verdana><I> v16->SetDataSpacing(0.8,0.8,4.0);<BR> v16->SetDataByteOrderToLittleEndian ();<BR> v16->Update();<BR></I></FONT></DIV>
<DIV><FONT face=Verdana><I> vtkContourFilter *skinExtractor = vtkContourFilter::New();<BR> skinExtractor->SetInput( (vtkDataSet *) ( v16->GetOutput() ) );<BR> skinExtractor->SetValue(0, 500);<BR> vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();<BR> skinNormals->SetInput(skinExtractor->GetOutput());<BR> skinNormals->SetFeatureAngle(60.0);</I></FONT></DIV>
<DIV><FONT face=Verdana><I><BR> vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();<BR> skinMapper->SetInput(skinNormals->GetOutput());<BR> skinMapper->ScalarVisibilityOff();<BR> vtkActor *skin = vtkActor::New();<BR> skin->SetMapper(skinMapper);</I></FONT></DIV>
<DIV><FONT face=Verdana><I> vtkOutlineFilter *outlineData = vtkOutlineFilter::New();<BR> outlineData->SetInput( (vtkDataSet *) ( v16->GetOutput() ) );</I></FONT></DIV><FONT face=Verdana><I>
<DIV><BR> vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();<BR> mapOutline->SetInput(outlineData->GetOutput());<BR> vtkActor *outline = vtkActor::New();<BR> outline->SetMapper(mapOutline);<BR> outline->GetProperty()->SetColor(0,0,0);</DIV>
<DIV></I></FONT> </DIV>
<DIV><FONT face=Verdana><I> vtkCamera *aCamera = vtkCamera::New();<BR> aCamera->SetViewUp (0, 0, -1);<BR> aCamera->SetPosition (0, 1, 0);<BR> aCamera->SetFocalPoint (0, 0, 0);<BR> aCamera->ComputeViewPlaneNormal();</I></FONT></DIV>
<DIV><FONT face=Verdana><I> aRenderer->AddActor(skin);<BR> aRenderer->SetActiveCamera(aCamera);<BR> aRenderer->ResetCamera ();<BR> aCamera->Dolly(1.5);</I></FONT><FONT face=Verdana><I><BR> aRenderer->SetBackground(1,1,1);<BR> renWin->SetSize(640, 480);</I></FONT></DIV>
<DIV><FONT face=Verdana><I> aRenderer->ResetCameraClippingRange ();</I></FONT></DIV>
<DIV><FONT face=Verdana><I><BR> iren->Initialize();<BR> iren->Start(); </I></FONT></DIV>
<DIV><FONT face=Verdana><I><BR> v16->Delete();<BR> skinExtractor->Delete();<BR> skinNormals->Delete();<BR> skinMapper->Delete();<BR> skin->Delete();<BR> outlineData->Delete();<BR> mapOutline->Delete();<BR> outline->Delete();<BR> aCamera->Delete();<BR> iren->Delete();<BR> renWin->Delete();<BR> aRenderer->Delete();</DIV><!--endarticle--></I></FONT>
<DIV><FONT face=Verdana><I><BR></I><I> </I><I><BR></I></DIV></FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV><br><!-- footer --><br><hr>
<a style="font-size:14px;line-height:15px; color:#000; text-decoration:none" href="http://event.mail.163.com/chanel/xyq.htm?from=163" target="_blank"><span style="text-decoration:underline; color:blue">免费试玩2006中国最佳网络游戏--梦幻西游 </span> </a>