[vtkusers] vtkDICOMImageReader -> vtkCutter -> vtkMarchingCubes

superzz jxdw_zlf at yahoo.com.cn
Thu Dec 24 20:23:31 EST 2009


Hello Jinyoung Hwang
Thank you for your example. But the data is passed as reader -> vtkCutter ->
vtkMarchingCubes your example, not as vtkDICOMImageReader -> vtkCutter ->
vtkMarchingCubes as I requested.

May you take a look at it again?

Thanks

superZZ


Jinyoung Hwang wrote:
> 
> Hello,
> 
> I made an example you want, but it may not be.
>  If not, repost again, then other will help you.
> 
> Jinyoung
> 
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>  // data load
>  vtkSmartPointer<vtkStructuredPointsReader> reader =
> vtkSmartPointer<vtkStructuredPointsReader>::New();
>  reader->SetFileName("test.vtk");
>  reader->Update();
>  // MC is used to display in 3D
>  vtkSmartPointer<vtkMarchingCubes> cubes =
> vtkSmartPointer<vtkMarchingCubes>::New();
>  cubes->SetInputConnection(reader->GetOutputPort());
>  cubes->ComputeNormalsOn();
>  cubes->ComputeGradientsOn();
>  cubes->SetValue(0, 20);
>  cubes->Update();
> // create a plane, and specify it
>  vtkSmartPointer<vtkPlane> plane = vtkSmartPointer<vtkPlane>::New();
>  plane->SetOrigin(100,0,0);
>  plane->SetNormal(1,0,0);
> // create a cutter
>  vtkSmartPointer<vtkCutter> cutter = vtkSmartPointer<vtkCutter>::New();
>  cutter->SetInputConnection(cubes->GetOutputPort());
>  cutter->SetCutFunction(plane);
>  cutter->GenerateCutScalarsOn();
>  cutter->SetValue(0, 0.5);
>  // create a mapper
>  vtkSmartPointer<vtkPolyDataMapper> mapper =
> vtkSmartPointer<vtkPolyDataMapper>::New();
>  mapper->SetInputConnection(cutter->GetOutputPort());
>  mapper->ScalarVisibilityOn();
>  mapper->Update();
> 
> _______________________________________________
> 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
> 
> 

-- 
View this message in context: http://old.nabble.com/vtkDICOMImageReader--%3E-vtkCutter--%3E-vtkMarchingCubes-tp26902455p26918409.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list