<DIV >hello,</DIV>
<DIV> </DIV>
<DIV>In the VTKData/Data/headsq/,there are some sample datas,How can I write this datas to a out.vtk file?and display it.</DIV>
<DIV> </DIV>
<DIV>I use</DIV>
<DIV> </DIV>
<DIV> vtkVolume16Reader *v16 = vtkVolume16Reader::New();<BR> v16->SetDataDimensions(64,64);<BR> v16->SetDataByteOrderToLittleEndian();<BR> v16->SetFilePrefix ("headsq/quarter");<BR> v16->SetImageRange(1, 93);<BR> v16->SetDataSpacing (3.2, 3.2, 1.5);</DIV>
<DIV> </DIV>
<DIV>to read the data,</DIV>
<DIV> </DIV>
<DIV> 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);<BR> vtkPolyDataWriter *pdw=vtkPolyDataWriter::New();<BR> pdw->SetInput(skinNormals->GetOutput());<BR> pdw->SetFileName("out.vtk");<BR> pdw->Write();</DIV>
<DIV> </DIV>
<DIV>I use these code to write datas to out.vtk,and in the java applet,I use these code to display the out.vtk file,but nothing is displayed.</DIV>
<DIV> </DIV>
<DIV>//////////////////////////////////////////////////////////////////////////</DIV>
<DIV> vtkPolyDataReader fran = new vtkPolyDataReader();<BR> fran.SetFileName("d:/lmhjava/out_tougu.vtk");<BR>// fran.SetFileName("D:\\lmhjava\\vtksource\\VTKconsole\\out.vtk");<BR> // We want to preserve topology (not let any cracks form);. This may<BR> // limit the total reduction possible, which we have specified at 90%.<BR> vtkSmoothPolyDataFilter smoother = new vtkSmoothPolyDataFilter();<BR> smoother.SetInput(fran.GetOutput());<BR> smoother.SetNumberOfIterations(50);<BR> vtkPolyDataNormals normals = new vtkPolyDataNormals();<BR> normals.SetInput(smoother.GetOutput());<BR> normals.FlipNormalsOn();<BR> vtkPolyDataMapper franMapper = new vtkPolyDataMapper();<BR> franMapper.SetInput(normals.GetOutput());<BR> vtkActor franActor = new vtkActor();<BR> franActor.SetMapper(franMapper);<BR> franActor.GetProperty().SetColor(1.0, 0.49, 0.25);<BR> // Add the actors to the renderer, set the background and size<BR> renWin.GetRenderer().AddActor(franActor);<BR> renWin.GetRenderer().SetBackground(1, 1, 1);<BR> VtkPanelUtil.setSize(renWin, 250, 250);<BR> vtkCamera cam1 = new vtkCamera();<BR> cam1.SetClippingRange(0.0475572, 2.37786);<BR> cam1.SetFocalPoint(0.052665, -0.129454, -0.0573973);<BR> cam1.SetPosition(0.327637, -0.116299, -0.256418);<BR> cam1.SetViewUp(-0.0225386, 0.999137, 0.034901);<BR> renWin.GetRenderer().SetActiveCamera(cam1);<BR> // Place renWin in the center of this panel<BR> setLayout(new BorderLayout());<BR> add(renWin, BorderLayout.CENTER);</DIV>
<DIV>////////////////////////////////////////////////////////////</DIV>
<DIV> </DIV>
<DIV>I didnot know where the error is.</DIV>
<DIV>thanks.</DIV>
<DIV> </DIV><br><!-- footer --><br><div style="border-bottom:1px solid #999"></div><br>
        <font color="black" style="font-size:14.8px"> 女 友 9 9 元 b u y 的 新 款 O N L Y </font>
        <br>
         <a href="http://adtaobao.allyes.com/main/adfclick?db=adtaobao&bid=600,597,58&cid=29985,198,1&sid=32501&show=ignore&url=http://www.taobao.com/vertical/lady/body_24.php" target="_blank" style="font-size:13px;line-height:160%;color:blue"> 秋 冬 女 人 精 品 女 装 全 场 火 热 促 销 2 9 元 - 1 9 9 元 , 抢 呀 ( 图 )
</a>