[vtkusers] (no subject)
chens
chens at mail.ncku.edu.tw
Thu Jan 8 09:17:31 EST 2009
We used the following codes for the surface generation of a medical object
in DICOM files.
The resultant 3D images were excellent.
Originally, we thought that the marching cube algorithm was used for the
surface generation of the medical object since the vtkMarchingCubes method
was invoked.
However, we were surprised that it seemed that the "vtkMarchingCubes" was
not invoked when we set breakpoint in that method in the debugging mode.
Does anyone know whether the marching cube algorithm was used or not? If it
was, which method implements the marching cube algorithm?
How can we invoke marching cube algorithm in vtk? Are there any other sample
codes?
Thank you very much for your help.
Chen
vtkMarchingCubes *m_cube=vtkMarchingCubes::New();
vtkPolyData *m_polydata=vtkPolyData::New();//define an object frm the
filter
m_cube->SetValue(0,500); // set value corresponding to which the
isosurface will be created
m_cube->ComputeNormalsOff(); // turn Normals Creation off (u can do it
later...and only if u have light settings)
m_cube->ComputeGradientsOff(); // gradients off
m_cube->SetInput(m_reader->GetOutput()); // set input for the volume
from which u'll extract iso surface
m_polydata= m_cube->GetOutput(); // get o/p (it's of polydata type)
m_polydata->Update();
vtkPolyDataMapper *m_polydataMapper = vtkPolyDataMapper::New();
m_polydataMapper->SetInput(m_polydata);
m_polydataMapper->SetScalarRange(0,7);
m_polydataMapper->Update();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090108/e6ba6b28/attachment.htm>
More information about the vtkusers
mailing list