[vtkusers] How to write or change a DICOM file?

AESN aya_taha_1991 at hotmail.com
Tue Jun 19 15:12:49 EDT 2012


           //Definitions
           public vtkRenderer ren3d = vtkRenderer.New();
           public vtkRenderWindow renWin3d;
           public vtkRenderWindowInteractor iren3d =
vtkRenderWindowInteractor.New();
           vtkImageThreshold thresh = vtkImageThreshold.New();
           
            ren3d = vtkRenderer.New();
            renWin3d = vtkRenderWindow.New();
            renWin3d = renderWindowControl4.RenderWindow;
            renWin3d.AddRenderer(ren3d);

            //////////////////steps of reconstruct/////////////


            thresh.SetInput(DICOMReader.GetOutput());
            thresh.ThresholdBetween(2300, 3000); //the range of gray level
(from 2300 to 3000 will extract      
                                                                      the
surface of teeth only)

            thresh.ReplaceInOn();
            thresh.ReplaceOutOn();
            thresh.SetInValue(1.0);
            thresh.SetOutValue(0.0);
            thresh.Update();


            vtkContourFilter skinExtractor = new vtkContourFilter();
            vtkSmoothPolyDataFilter smoother = new
vtkSmoothPolyDataFilter();
            vtkPolyDataNormals skinNormals = new vtkPolyDataNormals();
            vtkPolyDataMapper skinMapper = vtkPolyDataMapper.New();
            vtkActor skin = new vtkActor();

            skinExtractor.SetInputConnection(thresh.GetOutputPort());
            skinExtractor.SetValue(0, 1);

            smoother.SetInputConnection(skinExtractor.GetOutputPort());
            smoother.SetNumberOfIterations(10);


            skinNormals.SetInputConnection(smoother.GetOutputPort());
            skinNormals.SetFeatureAngle(60.0);

            skinMapper.SetInputConnection(skinNormals.GetOutputPort());
            skinMapper.ScalarVisibilityOff();


            //skin actor

            skin.SetMapper(skinMapper);
            ren3d.AddActor(skin);

            //zooming
            ren3d.ResetCamera();
            ren3d.GetActiveCamera().Zoom(1.3);

            //rotation
            vtkTransform transform3d = new vtkTransform();
            transform3d.RotateX(-90);

           
            ren3d.GetActiveCamera().ApplyTransform(transform3d);


            renderWindowControl4.Refresh();

--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-write-or-change-a-DICOM-file-tp5713993p5714007.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list