/// <summary> /// The main entry method called by the CSharp driver /// </summary> /// <param name="argv"></param> public static void AVTestExtractVOI(String [] argv) { //Prefix Content is: "" // to mark the origin[] sphere = new vtkSphereSource(); sphere.SetRadius((double)2.0); sphereMapper = vtkPolyDataMapper.New(); sphereMapper.SetInputConnection((vtkAlgorithmOutput)sphere.GetOutputPort()); sphereMapper.ImmediateModeRenderingOn(); sphereActor = new vtkActor(); sphereActor.SetMapper((vtkMapper)sphereMapper); rt = new vtkRTAnalyticSource(); rt.SetWholeExtent((int)-50,(int)50,(int)-50,(int)50,(int)0,(int)0); voi = new vtkExtractVOI(); voi.SetInputConnection((vtkAlgorithmOutput)rt.GetOutputPort()); voi.SetVOI((int)-11,(int)39,(int)5,(int)45,(int)0,(int)0); voi.SetSampleRate((int)5,(int)5,(int)1); // Get rid ambiguous triagulation issues.[] surf = new vtkDataSetSurfaceFilter(); surf.SetInputConnection((vtkAlgorithmOutput)voi.GetOutputPort()); tris = new vtkTriangleFilter(); tris.SetInputConnection((vtkAlgorithmOutput)surf.GetOutputPort()); mapper = vtkPolyDataMapper.New(); mapper.SetInputConnection((vtkAlgorithmOutput)tris.GetOutputPort()); mapper.ImmediateModeRenderingOn(); mapper.SetScalarRange((double)130,(double)280); actor = new vtkActor(); actor.SetMapper((vtkMapper)mapper); ren = vtkRenderer.New(); ren.AddActor((vtkProp)actor); ren.AddActor((vtkProp)sphereActor); ren.ResetCamera(); camera = ren.GetActiveCamera(); //$camera SetPosition 68.1939 -23.4323 12.6465[] //$camera SetViewUp 0.46563 0.882375 0.0678508 [] //$camera SetFocalPoint 3.65707 11.4552 1.83509 [] //$camera SetClippingRange 59.2626 101.825 [] renWin = vtkRenderWindow.New(); renWin.AddRenderer((vtkRenderer)ren); iren = new vtkRenderWindowInteractor(); iren.SetRenderWindow((vtkRenderWindow)renWin); iren.Initialize(); //deleteAllVTKObjects(); }
/// <summary> /// The main entry method called by the CSharp driver /// </summary> /// <param name="argv"></param> public static void AVTestExtractVOI(String [] argv) { //Prefix Content is: "" // to mark the origin[] sphere = new vtkSphereSource(); sphere.SetRadius((double)2.0); sphereMapper = vtkPolyDataMapper.New(); sphereMapper.SetInputConnection((vtkAlgorithmOutput)sphere.GetOutputPort()); sphereMapper.ImmediateModeRenderingOn(); sphereActor = new vtkActor(); sphereActor.SetMapper((vtkMapper)sphereMapper); rt = new vtkRTAnalyticSource(); rt.SetWholeExtent((int)-50, (int)50, (int)-50, (int)50, (int)0, (int)0); voi = new vtkExtractVOI(); voi.SetInputConnection((vtkAlgorithmOutput)rt.GetOutputPort()); voi.SetVOI((int)-11, (int)39, (int)5, (int)45, (int)0, (int)0); voi.SetSampleRate((int)5, (int)5, (int)1); // Get rid ambiguous triagulation issues.[] surf = new vtkDataSetSurfaceFilter(); surf.SetInputConnection((vtkAlgorithmOutput)voi.GetOutputPort()); tris = new vtkTriangleFilter(); tris.SetInputConnection((vtkAlgorithmOutput)surf.GetOutputPort()); mapper = vtkPolyDataMapper.New(); mapper.SetInputConnection((vtkAlgorithmOutput)tris.GetOutputPort()); mapper.ImmediateModeRenderingOn(); mapper.SetScalarRange((double)130, (double)280); actor = new vtkActor(); actor.SetMapper((vtkMapper)mapper); ren = vtkRenderer.New(); ren.AddActor((vtkProp)actor); ren.AddActor((vtkProp)sphereActor); ren.ResetCamera(); camera = ren.GetActiveCamera(); //$camera SetPosition 68.1939 -23.4323 12.6465[] //$camera SetViewUp 0.46563 0.882375 0.0678508 [] //$camera SetFocalPoint 3.65707 11.4552 1.83509 [] //$camera SetClippingRange 59.2626 101.825 [] renWin = vtkRenderWindow.New(); renWin.AddRenderer((vtkRenderer)ren); iren = new vtkRenderWindowInteractor(); iren.SetRenderWindow((vtkRenderWindow)renWin); iren.Initialize(); //deleteAllVTKObjects(); }
///<summary> A Set Method for Static Variables </summary> public static void Setrt(vtkRTAnalyticSource toSet) { rt = toSet; }