[vtkusers] vtkMarchingCubes (06F5BC18): Cannot contour data of dimension != 3
louiskoo
419655660 at qq.com
Sun Jun 30 21:54:25 EDT 2013
bmpRead.SetFilePrefix(@"d:\temp\");
bmpRead.SetFilePattern("%s%d.bmp");
bmpRead.SetFileNameSliceOffset(1);
//bmpRead.SetFileNameSliceSpacing(1);
//bmpRead.SetFileNames(array);
bmpRead.Update();
vtkImageData imageData = bmpRead.GetOutput();
// extract the skin
vtkMarchingCubes _skinExtractor = new vtkMarchingCubes();
_skinExtractor.SetInput(imageData);
_skinExtractor.Update();
Console.WriteLine("Extractor.Update(); Done");
//_skinExtractor.SetValue(0, 155);
_skinExtractor.SetValue(0, ISO);
_skinExtractor.Update();
vtkStripper _skinStripper = new vtkStripper();
_skinStripper.SetInput(_skinExtractor.GetOutput());
_skinStripper.Update();
Console.WriteLine("Stripper.Update(); Done");
vtkPolyData polyData = _skinStripper.GetOutput();
// Visualize
vtkPolyDataMapper mapper = vtkPolyDataMapper.New();
mapper.SetInput(polyData);
vtkActor actor = vtkActor.New();
actor.SetMapper(mapper);
actor.GetProperty().SetPointSize(4);
//actor.GetProperty().SetColor(255,0,0);
vtkCamera camera = vtkCamera.New();
camera.SetPosition(0, 0, 100);
camera.SetFocalPoint(0, 0, 0);
vtkRenderWindow renderWindow =
renderWindowControl1.RenderWindow;
vtkRenderer renderer =
renderWindow.GetRenderers().GetFirstRenderer();
renderer.SetBackground(0.2,0.3,0.4);
renderer.AddActor(actor);
double[] originalViewport = { 0.0, 0.0, 0.8, 0.6 };
//renderer.SetViewport(originalViewport[0] ,originalViewport[1]
,originalViewport[2] ,originalViewport[3]);
//renderer.SetActiveCamera(camera);
renderer.Render();
renderWindowControl1.Refresh();
--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkMarchingCubes-06F5BC18-Cannot-contour-data-of-dimension-3-tp5721693.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list