[vtkusers] How to decrease the poly data element
Jérôme
jerome.velut at gmail.com
Tue Dec 8 03:25:54 EST 2009
Hi Ali,
I read 78 DICOM files , and the result is a big vtkpolydata ,
The result of a DICOMImageReader is an vtkImageData. Can you precise when
occurs this error? Maybe by using a step-by-step debugging?
I think it is not the DICOMReader (78 slices, even with high plane
resolution, is not so much).
If the contour filter is generating the error, you can first try to
down-sample your image (vtkImageResample->SetAxisMagnificationFactor), or
crop it (vtkExtractVOI).
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.
Jerome
> which I can't
> apply any filter on it because it give the attached error ( it's a
> snapshot)
> even using Vtkshrinkpolydata , the used code is:
> vtkRenderer *aRenderer = vtkRenderer::New();
> vtkRenderWindow *renWin = vtkRenderWindow::New();
> renWin->AddRenderer(aRenderer);
> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
> iren->SetRenderWindow(renWin);
>
>
> vtkDICOMImageReader *v16 = vtkDICOMImageReader::New();
> v16->SetDirectoryName("C:\\1");
> v16->SetDataOrigin(0, 0, 0);
> v16->Update();
>
> vtkContourFilter *skinExtractor = vtkContourFilter::New();
> skinExtractor->SetInputConnection(v16->GetOutputPort());
> skinExtractor->SetValue(0, 500);
> vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();
> skinNormals->SetInputConnection(skinExtractor->GetOutputPort());
> skinNormals->SetFeatureAngle(60.0);
>
> /////////////////////Decrease the
> dataset/////////////////////////////////
>
> vtkShrinkPolyData *shrink = vtkShrinkPolyData::New();
> shrink->SetInputConnection(skinNormals->GetOutputPort());
> shrink->SetShrinkFactor(0.90);
>
> vtkPolyDataToTetrahedralGrid* gridder =
> vtkPolyDataToTetrahedralGrid::New();
> gridder->SetInputConnection(shrink->GetOutputPort());
>
>
> vtkDataSetMapper *skinMapper = vtkDataSetMapper::New();
> skinMapper->SetInputConnection(gridder->GetOutputPort());
>
> skinMapper->ScalarVisibilityOff();
> vtkActor *skin = vtkActor::New();
> skin->SetMapper(skinMapper);
>
>
> vtkCamera *aCamera = vtkCamera::New();
> aCamera->SetViewUp( 0, 0, -1);
> aCamera->SetPosition( 0, 1, 0);
> aCamera->SetFocalPoint( 0, 0, 0);
> aCamera->ComputeViewPlaneNormal();
>
> aRenderer->AddActor(skin);
> aRenderer->SetActiveCamera(aCamera);
> aRenderer->ResetCamera();
> aCamera->Dolly(1.5);
>
>
> renWin->SetSize(640, 480);
>
> aRenderer->ResetCameraClippingRange();
>
>
>
> iren->Initialize();
>
> return 0;
> http://old.nabble.com/file/p26684126/error_screen.jpg error_screen.jpg
> --
> View this message in context:
> http://old.nabble.com/How-to-decrease-the-poly-data-element-tp26684126p26684126.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091208/ccf74a5e/attachment.htm>
More information about the vtkusers
mailing list