[vtkusers] artifacts with vtkMarchingCubes

Henrik Westerberg henrik.westerberg at crg.es
Thu Feb 28 06:35:26 EST 2008


Hi Nadine,

I would suggest that you take a look at the original data and double check
that the heart data doesn't contain any errors, if its easy.

Otherwise you could use the following filter to extract just the heart from
your polydata.

(sorry python)

cfSurf = vtkPolyDataConnectivityFilter()
cfSurf.SetExtractionModeToLargestRegion()
cfSurf.SetInput(iso.GetOutput())

then send it to the mapper.

regards,

Henrik
 
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 --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080228/ae551752/attachment.htm>


More information about the vtkusers mailing list