[vtkusers] Pb in Marching Cubes Result Visualization

ben said tarek tarekbensaid at gmail.com
Wed May 21 11:46:42 EDT 2008


Hi everybody,
I try to apply the marching cubes algorithm on a dicom series image, I
remark that a region of the hole surface is placed in a wrong position ;
i.e. the same region of all slices is cut and placed on the opposite
direction of the image, I don't understand the pb. Here the source code :

 vtkRenderer *ren1 = vtkRenderer::New();
 vtkRenderWindow *renWin = vtkRenderWindow::New();
 vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();

 vtkVolume16Reader *v16 = vtkVolume16Reader::New();
 v16->SetDataDimensions (512,512);
 v16->SetDataByteOrderToLittleEndian();
 v16->SetFilePrefix ("C:\\test\\000000");
 v16->SetImageRange (1, 83);
 v16->SetDataSpacing (0.59, 0.59, 3);
 v16->Update();

 vtkImageMarchingCubes *iso = vtkImageMarchingCubes::New();
 iso->SetInput(v16->GetOutput());
 iso->SetValue(0,1100);
 iso->SetInputMemoryLimit(3000);
 vtkPolyDataMapper *isoMapper = vtkPolyDataMapper::New();
 isoMapper->SetInput (iso->GetOutput());
 isoMapper->ScalarVisibilityOff();
 isoMapper->ImmediateModeRenderingOn();

 vtkActor *isoActor = vtkActor::New();
 isoActor->SetMapper (isoMapper);
 isoActor->GetProperty()->SetColor(1,1,1);

 ren1->AddActor (isoActor);
 ren1->SetBackground (0.2, 0.3, 0.4);
 renWin->AddRenderer (ren1);
  iren->SetRenderWindow (renWin);
 renWin->Render();
 iren->Start();
 return 0;

If anyone can help me, thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080521/e422a52c/attachment.htm>


More information about the vtkusers mailing list