[vtkusers] Visualization of vessel skeleton obtained from Binary3DThinningImageFilter

Xiaopeng Yang yxp233 at postech.ac.kr
Tue Jan 11 03:13:24 EST 2011


Hi Krishnan,

 

I got it worked by setting the value from 1 to 0.1. Thank you very much for your help!

 

Yang

 

发件人: Karthik Krishnan [mailto:karthik.krishnan at kitware.com] 
发送时间: 2011년 1월 10일 월요일 오후 11:19
收件人: Xiaopeng Yang
抄送: vtk
主题: Re: [vtkusers] Visualization of vessel skeleton obtained from Binary3DThinningImageFilter

 

You use an isovalue of 1 in your code, or is it meant to be 0.5 (half way between Foreground and background). 

You could try also using vtkThresholdPoints. This will generate a polydata with vertex cells at each voxel. You can visualize the result with a vtkPolyDataMapper.

A more appropriate way to visualize is to construct a polydata out of the skeletonized data. Just visit every voxel and its neighbors add to a vtkCellArray, the centers of the voxels with any connected neighbors. You can then visualize the construcuted polydata. You get to set the line width etc... 
Or you get can pass the data through a tube filter and use a vtkPolyDataMapper...

On Mon, Jan 10, 2011 at 3:20 PM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:

Hi guys,

 

How are you doing?

 

I applied ITK Binary3D Thinning Image Filter to skeletonize portal vein of liver. Then I tried to visualize the result as Iso-surface generated by vtk. But in the screen, I can just see a few discrete and very small point (if you do not see carefully, you cannot recognize these points). Then I visualized my result as Iso-surface by MITK. The vessel skeleton is shown continuously and looks very good. Here are the two results (the former one is generated by my code; the later one is from MITK):

 

 cid:image006.jpg at 01CB9EAA.770905A0 <https://mail.google.com/a/kitware.com/?ui=2&ik=856cfef1d6&view=att&th=12d6f5686e9e9c6a&attid=0.0.1&disp=emb&zw>  cid:image007.jpg at 01CB9EAA.770905A0 <https://mail.google.com/a/kitware.com/?ui=2&ik=856cfef1d6&view=att&th=12d6f5686e9e9c6a&attid=0.0.2&disp=emb&zw> 

 

Here is my code:

 

  reader->SetFileName( "D:/Hybrid Method/Hybrid/BSP/PortalSkeleton/3D.dcm" );

  reader->Update();

  

  typedef itk::VTKImageExport< InputImageType > ExportFilterType;

 

  ExportFilterType::Pointer itkExporter = ExportFilterType::New();

    

  itkExporter->SetInput( reader->GetOutput() );

    

  vtkImageImport* vtkImporter = vtkImageImport::New();  

  ConnectPipelines(itkExporter, vtkImporter);

 

  vtkRenderer *ren4 = vtkRenderer::New();

 

  vtkRenderWindow *renWin = vtkRenderWindow::New();

  renWin->AddRenderer(ren4);

 

  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();

  iren->SetRenderWindow(renWin);

 

  //Create an iso-surface using Marching Cubes

  vtkContourFilter *iso = vtkContourFilter::New();

  iso->SetInput(vtkImporter->GetOutput());

  iso->ComputeScalarsOn();

  iso->SetValue(1, 1);

 

  //vtkDataSetMapper *isoMapper = vtkDataSetMapper::New();

  vtkPolyDataMapper *isoMapper = vtkPolyDataMapper::New();

  isoMapper->SetInput(iso->GetOutput());

  isoMapper->ScalarVisibilityOff();

 

  vtkActor *isoActor = vtkActor::New();

  isoActor->SetMapper(isoMapper);

  isoActor->GetProperty()->SetColor(1, 0, 0);

 

  ren4->AddActor(isoActor);

 

  renWin->SetSize(512,512);

  ren4->ResetCamera();

ren4->SetBackground(1,1,1);

 

 

Thank you,

Yang


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110111/1c3ccde3/attachment.htm>


More information about the vtkusers mailing list