<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [vtkusers] artifacts with vtkMarchingCubes </TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi Nadine,<BR>
<BR>
I would suggest that you take a look at the original data and double check<BR>
that the heart data doesn't contain any errors, if its easy.<BR>
<BR>
Otherwise you could use the following filter to extract just the heart from<BR>
your polydata.<BR>
<BR>
(sorry python)<BR>
<BR>
cfSurf = vtkPolyDataConnectivityFilter()<BR>
cfSurf.SetExtractionModeToLargestRegion()<BR>
cfSurf.SetInput(iso.GetOutput())<BR>
<BR>
then send it to the mapper.<BR>
<BR>
regards,<BR>
<BR>
Henrik<BR>
<BR>
Hi at all!<BR>
<BR>
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:<BR>
<BR>
vtkMarchingCubes *iso = vtkMarchingCubes::New();<BR>
<BR>
iso->SetInput(imageData);<BR>
iso->SetNumberOfContours(1);<BR>
iso->SetValue(0, 1.0); <BR>
iso->Update();<BR>
<BR>
<BR>
Lookup = vtkLookupTable::New();<BR>
Lookup->Build();<BR>
Lookup->SetTableRange(0,1);<BR>
Lookup->SetHueRange(0.1, 0.1);<BR>
Lookup->SetSaturationRange(1.0, 1.0);<BR>
Lookup->SetValueRange(1.0, 1.0);<BR>
<BR>
<BR>
// Map to polys and create the actor.<BR>
vtkPolyDataMapper* isoMapper = vtkPolyDataMapper::New();<BR>
isoMapper->SetInput(iso->GetOutput());<BR>
isoMapper->SetLookupTable(Lookup);<BR>
<BR>
vtkActor *modelActor = vtkActor::New();<BR>
modelActor->VisibilityOn();<BR>
modelActor->SetMapper(isoMapper);<BR>
modelActor->GetProperty()->SetOpacity(1.0);<BR>
modelActor->GetProperty()->SetColor(0, 0, 0);<BR>
<BR>
// Add the actor to the scene<BR>
this->RenderWidgetSE->RenderWidget->GetRenderer()->AddViewProp(modelActor);<BR>
this->RenderWidgetSE->RenderWidget->GetRenderer()->ResetCamera();<BR>
this->RenderWidgetSE->RenderWidget->GetRenderer()->Render();<BR>
<BR>
<BR>
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.<BR>
<BR>
These artifacts sometimes get bigger, and sometimes there are not there at all.<BR>
<BR>
Has anybody an idea or can give me some adivse?<BR>
<BR>
Help is very appreciated! Thanks in advance for your time!<BR>
Greetings<BR>
Nadine<BR>
--<BR>
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!<BR>
Jetzt dabei sein: <A HREF="http://www.shortview.de/?mc=sv_ext_mf@gmx">http://www.shortview.de/?mc=sv_ext_mf@gmx</A><BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>