[vtkusers] How to show DICOM images using vtkImageViewer?

AESN aya_taha_1991 at hotmail.com
Tue Jun 19 14:24:43 EDT 2012


                 string path;
                 vtkDICOMImageReader r;
                 vtkImageViewer v;
                 int[] dim; 
                
                // Get the path of the images(the directory that contain
images)
                path = "C:\\Images"                
        
                //reader
                r = new vtkDICOMImageReader();
                r.SetDirectoryName(path);
                r.Update();
                dim = r.GetOutput().GetDimensions();
                
                //viewer
                v = new vtkImageViewer();
                v.SetInput(r.GetOutput());
               
                /// Set the slice number of the image you want to display
               /// dim[2] is the number of images(z dimintion)
                v.SetZSlice(dim[2]/2);
               
                
                //rendering
               
renderWindowControl1.RenderWindow.AddRenderer(v.GetRenderer());
                renderWindowControl1.Refresh();

--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-show-DICOM-images-using-vtkImageViewer-tp5713941p5714004.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list