Hi Ali,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I read 78 DICOM files , and the result is a big vtkpolydata , </blockquote><br>The result of a DICOMImageReader is an vtkImageData. Can you precise when occurs this error? Maybe by using a step-by-step debugging?<br>I think it is not the DICOMReader (78 slices, even with high plane resolution, is not so much).<br>
If the contour filter is generating the error, you can first try to down-sample your image (vtkImageResample->SetAxisMagnificationFactor), or crop it (vtkExtractVOI).<br>If you cannot trace step-by-step during runtime, call Update then PrintSelf on your outputs (Reader, Contour and Normal filters) sequentially. this will help in finding the real allocation problem.<br>
<br>Jerome<br><div><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">which I can't<br>
apply any filter on it because it give the attached error ( it's a snapshot)<br>
even using Vtkshrinkpolydata , the used code is:<br>
vtkRenderer *aRenderer = vtkRenderer::New();<br>
vtkRenderWindow *renWin = vtkRenderWindow::New();<br>
renWin->AddRenderer(aRenderer);<br>
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>
iren->SetRenderWindow(renWin);<br>
<br>
<br>
vtkDICOMImageReader *v16 = vtkDICOMImageReader::New();<br>
v16->SetDirectoryName("C:\\1");<br>
v16->SetDataOrigin(0, 0, 0);<br>
v16->Update();<br>
<br>
vtkContourFilter *skinExtractor = vtkContourFilter::New();<br>
skinExtractor->SetInputConnection(v16->GetOutputPort());<br>
skinExtractor->SetValue(0, 500);<br>
vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();<br>
skinNormals->SetInputConnection(skinExtractor->GetOutputPort());<br>
skinNormals->SetFeatureAngle(60.0);<br>
<br>
/////////////////////Decrease the dataset/////////////////////////////////<br>
<br>
vtkShrinkPolyData *shrink = vtkShrinkPolyData::New();<br>
shrink->SetInputConnection(skinNormals->GetOutputPort());<br>
shrink->SetShrinkFactor(0.90);<br>
<br>
vtkPolyDataToTetrahedralGrid* gridder =<br>
vtkPolyDataToTetrahedralGrid::New();<br>
gridder->SetInputConnection(shrink->GetOutputPort());<br>
<br>
<br>
vtkDataSetMapper *skinMapper = vtkDataSetMapper::New();<br>
skinMapper->SetInputConnection(gridder->GetOutputPort());<br>
<br>
skinMapper->ScalarVisibilityOff();<br>
vtkActor *skin = vtkActor::New();<br>
skin->SetMapper(skinMapper);<br>
<br>
<br>
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();<br>
<br>
aRenderer->AddActor(skin);<br>
aRenderer->SetActiveCamera(aCamera);<br>
aRenderer->ResetCamera();<br>
aCamera->Dolly(1.5);<br>
<br>
<br>
renWin->SetSize(640, 480);<br>
<br>
aRenderer->ResetCameraClippingRange();<br>
<br>
<br>
<br>
iren->Initialize();<br>
<br>
return 0;<br>
<a href="http://old.nabble.com/file/p26684126/error_screen.jpg" target="_blank">http://old.nabble.com/file/p26684126/error_screen.jpg</a> error_screen.jpg<br>
--<br>
View this message in context: <a href="http://old.nabble.com/How-to-decrease-the-poly-data-element-tp26684126p26684126.html" target="_blank">http://old.nabble.com/How-to-decrease-the-poly-data-element-tp26684126p26684126.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<div class="im"><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
</div>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<div class="im"><br>
Follow this link to subscribe/unsubscribe:<br>
</div><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>