[vtkusers] artifacts with vtkMarchingCubes

Nadine Kempe n.kempe at gmx.net
Fri Feb 22 16:57:35 EST 2008


Hi at all!

I have a problem with vtkMarchingCubes. I try to render a segmented heart in a vtkImageData. This  means, the imageData only contains 0 for background and 1 for heart. My code looks like this:

vtkMarchingCubes *iso = vtkMarchingCubes::New();
  
iso->SetInput(imageData);
iso->SetNumberOfContours(1);
iso->SetValue(0, 1.0);  
iso->Update();


Lookup = vtkLookupTable::New();
Lookup->Build();
Lookup->SetTableRange(0,1); 
Lookup->SetHueRange(0.1, 0.1);
Lookup->SetSaturationRange(1.0, 1.0);
Lookup->SetValueRange(1.0, 1.0);


// Map to polys and create the actor.
vtkPolyDataMapper* isoMapper = vtkPolyDataMapper::New();
isoMapper->SetInput(iso->GetOutput());
isoMapper->SetLookupTable(Lookup);
  
vtkActor *modelActor = vtkActor::New();
modelActor->VisibilityOn();
modelActor->SetMapper(isoMapper);
modelActor->GetProperty()->SetOpacity(1.0);
modelActor->GetProperty()->SetColor(0, 0, 0);

// Add the actor to the scene
this->RenderWidgetSE->RenderWidget->GetRenderer()->AddViewProp(modelActor);
this->RenderWidgetSE->RenderWidget->GetRenderer()->ResetCamera();
this->RenderWidgetSE->RenderWidget->GetRenderer()->Render();


The problem is, that sometimes I see some kind of artifacts at the border of my rendered region, it is hard to explain, that's why I attached a screenshot.

These artifacts sometimes get bigger, and sometimes there are not there at all.

Has anybody an idea or can give me some adivse?

Help is very appreciated! Thanks in advance for your time!
Greetings
Nadine
-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arifactsSmall.png
Type: image/png
Size: 28356 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080222/1fd50eeb/attachment.png>


More information about the vtkusers mailing list