[vtkusers] Surface discontinuity of 3D reconstructed isosurface from 5 mm CT data

Xiaopeng Yang yxp233 at postech.ac.kr
Thu Mar 22 21:56:02 EDT 2012


Dear VTK users,

 

I loaded a mask dataset which is a segmented liver based on 5 mm DICOM
images. Then I applied vtkContourFilter to generate iso surface from the
mask dataset. And then I tried to visualize the surface and found that the
surface were discontinuous stairs. 

 

So I tried vtkImageReslice to resample the mask dataset and set the
outputspacing to be (inputspacing[0], inputspacing[1], 1.0). However, it
seemed not working. Could you please check my code and tell me where I made
a mistake? Thanks.

 

  vtkMetaImageReader * reader_mt1 = vtkMetaImageReader::New();

  reader_mt1->SetFileName( "C:/Patient/JSM(749718)/5_Output/Liver.mha" );

  reader_mt1->Update();

 

  vtkImageReslice * reslice = vtkImageReslice::New();

  reslice->SetInput(reader_mt1->GetOutput());

  reslice->SetOutputSpacing(0.730469,0.730469,1.0);

  reslice->Update();

  vtkContourFilter *CT = vtkContourFilter::New();

  CT->SetInput(reslice->GetOutput());

  CT->ComputeScalarsOn();

  CT->SetValue(0,128.1);

  CT->Update();

 

  vtkPolyDataMapper *maceMapper = vtkPolyDataMapper::New();

  maceMapper->SetInput(CT->GetOutput());

  maceMapper->ScalarVisibilityOff();

 

  vtkActor *maceActor = vtkActor::New();

  maceActor->SetMapper(maceMapper);

  maceActor->GetProperty()->SetColor(1.0, 0.49, 0.25);

  maceActor->VisibilityOn();

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120323/81206d9f/attachment.htm>


More information about the vtkusers mailing list