[vtkusers] select individual iso-lines

Amy Henderson amy.henderson at kitware.com
Thu Feb 20 15:15:41 EST 2003


Since you changed the parameters of the connectivity filter and re-executed 
it, the output will change, so you should only have the output from the 
last execution of that filter (endosteum in your case).

If you change this line
m_periosteumMapper->SetInput(m_connectivityFilter->GetOutput());

to
vtkUnstructuredGrid *grid = vtkUnstructuredGrid::New();
grid->DeepCopy(m_connectivityFilter->GetOutput());
m_periosteumMapper->SetInput(grid);
grid->Delete();

then both contours should stay around.  Of course, this breaks the 
pipeline, so you'd have problems if you re-executed this pipeline.  (You'd 
again get only one contour -- actually 2 actors rendering the same one -- 
unless you did a deep copy of the first output each time the pipeline runs.)

- Amy

At 02:59 PM 2/20/2003 -0500, Dean Inglis wrote:
>Hi,
>
>thanks, vtkPolyDataConnectivityFilter does the trick
>I'm just not sure how to get each one separately from
>the same filter so that the data persists for both:
>
>  m_contour->SetInput(temp);
>  m_contour->ComputeScalarsOff();
>  m_contour->ComputeGradientsOff();
>  m_contour->ComputeNormalsOff();
>  m_contour->SetValue(0,0.5);
>  m_contour->SetNumberOfContours(1);
>  m_contour->Update();
>
>  m_stripper->SetInput(m_contour->GetOutput());
>  m_stripper->Update();  // the stripper generates two vtkPolyLine cells
>
>  m_connectivityFilter->SetExtractionModeToCellSeededRegions();
>  m_connectivityFilter->SetInput(m_stripper->GetOutput());
>  m_connectivityFilter->InitializeSeedList();
>  m_connectivityFilter->AddSeed(0);
>  m_connectivityFilter->Update();
>
>  m_periosteumMapper->SetInput(m_connectivityFilter->GetOutput());
>
>  m_periosteumActor->SetMapper(m_periosteumMapper);
>
>  m_connectivityFilter->InitializeSeedList();
>  m_connectivityFilter->AddSeed(1);
>  m_connectivityFilter->Update();
>
>  m_endosteumMapper->SetInput(m_connectivityFilter->GetOutput());
>
>  m_endosteumActor->SetMapper(m_endosteumMapper);
>
>
>So what I get is the endosteum and not the periosteum too...
>
>Dean







More information about the vtkusers mailing list