[vtkusers] Visualization of vessel skeleton obtained from Binary3DThinningImageFilter
Karthik Krishnan
karthik.krishnan at kitware.com
Mon Jan 10 09:19:20 EST 2011
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):
>
>
>
> [image: cid:image006.jpg at 01CB9EAA.770905A0][image:
> cid:image007.jpg at 01CB9EAA.770905A0]
>
>
>
> 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/20110110/849ce201/attachment.htm>
More information about the vtkusers
mailing list