[Insight-users] Problem trying to visualize vtkImageMarchingCubes
Juan Ramírez
juanchoramirez at gmail.com
Thu Nov 3 18:33:56 EST 2005
Hello, I am working in the extraction of surfaces with
vtkImageMarchingCubes but I cannot visualize the result. The
following is the process.
1. First i capture the image itk and pass it to vtk.
2. I pass the vtkImage how input of vtkImageMarchingCubes.
3. I apply the filter and pass it to vtkPolyDataMapper.
4. vtkPolyDataMapper to vtkActor and after to vtkRenderer.
The code is the following
////////////////////
void CDlgFiltroExtSup::OnMarchingCubes()
{
this->marcher->SetInput(this->connector->GetOutput());
double *value = this->connector->GetOutput()->GetScalarRange();
double isovalue = 0.5*(value[0]+value[1]);
marcher->SetValue(0,isovalue);
try{
marcher->Update();
marching=true;
}
catch( itk::ExceptionObject & exp )
{
MessageBox("Alerta",exp.what(),MB_OK);
}
}
//////////// for render
if(marching==true)
{
//this->vtkIToPDF->SetInput(this->marcher->GetOutput());
this->Mapper->SetInput(this->marcher->GetOutput());
this->m_Actor->SetMapper(this->Mapper);
this->m_ren->SetBackground(0,0,0);
this->m_ren->AddActor(this->m_Actor);
this->marching=false;
this->m_RenderWindow->Render();
}
//////////////////////////////
if you can suggest something to me I am thankful to them
--
Juan G. Ramírez
Estudiante Ingenieria de Sistemas UPTC.
Colombia.
More information about the Insight-users
mailing list