[vtkusers] what's the contour iso surface of human skin
Ali Habib
ali.mahmoud.habib at gmail.com
Mon Oct 11 23:49:03 EDT 2010
Dear Jim
I used the below code but the output still contain internal structure as
attached output display
vtk.vtkDICOMImageReader VDR = new vtk.vtkDICOMImageReader();
VDR.SetDirectoryName(@"E:\Master
Degree\DataSet\case2\DICOM\PA1\ST1\SE2");
VDR.SetDataOrigin(0, 0, 0);
VDR.Update();
vtkImageThreshold VIT = new vtkImageThreshold();
VIT.ThresholdBetween(-300, 300);
VIT.SetInputConnection(VDR.GetOutputPort());
VIT.Update();
vtk.vtkImageIslandRemoval2D ImageIslandRemoval2D = new
vtk.vtkImageIslandRemoval2D();
ImageIslandRemoval2D.SetInput(VIT.GetOutput());
ImageIslandRemoval2D.SetAreaThreshold(1000);
vtk.vtkContourFilter skinExtractor = new vtk.vtkContourFilter();
skinExtractor.SetInputConnection(ImageIslandRemoval2D.GetOutputPort());
//skinExtractor.SetValue(0, -500);
skinExtractor.GenerateValues(1, -300, 300);
skinExtractor.ComputeGradientsOn();
vtk.vtkPolyDataConnectivityFilter VPDC = new
vtk.vtkPolyDataConnectivityFilter();
VPDC.SetInput(skinExtractor.GetOutput());
VPDC.SetExtractionModeToLargestRegion();
VPDC.Update();
// map to graphics library
vtkPolyDataMapper map = new vtkPolyDataMapper();
map.SetInput(VPDC.GetOutput());
// actor coordinates geometry, properties, transformation
vtkActor aSphere = new vtkActor();
aSphere.SetMapper(map);
aSphere.GetProperty().SetColor(0, 0, 1); // sphere color blue
// a renderer and render window
vtkRenderer ren1 = new vtkRenderer();
vtkRenderWindow renWin = new vtkRenderWindow();
renWin.AddRenderer(ren1);
// an interactor
vtkRenderWindowInteractor iren = new
vtkRenderWindowInteractor();
iren.SetRenderWindow(renWin);
// add the actor to the scene
ren1.AddActor(aSphere);
ren1.SetBackground(1, 1, 1); // Background color white
// render an image (lights and cameras are created
automatically)
renWin.Render();
// begin mouse interaction
iren.Start();
// release memory and return
VPDC.Dispose();
map.Dispose();
aSphere.Dispose();
ren1.Dispose();
renWin.Dispose();
iren.Dispose();
Any suggestion please
Best regards
On Sun, Oct 10, 2010 at 12:02 PM, Jim Peterson <jimcp at cox.net> wrote:
> Ali Habib wrote:
>
>> I'm sorry for disturbance , but could you give me sample example
>> Best regards
>>
>> Ali,
>
> vtkContourFilter has a function GenerateValues() that creates contours for
> an equally distributed set of values between low and high specified. in the
> snippet below, VoxelData is an instance of vtkImageData.
>
> ...
> vtkContourFilter skinExtractor = new vtkContourFilter();
> skinExtractor.SetInput(VoxelData);
> skinExtractor.GenerateValues(3, -200, 2300);
> ...
>
> This example gives 3 contours at -200, 1050 and 2300. to search for tissues
> I think I would look in the range of -300 to 300. I think there is a fairly
> wide range of values that all resolve to some aspect of skin.
>
> HTH,
> Jim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101012/e344526f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OuPut.jpg
Type: image/jpeg
Size: 46436 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101012/e344526f/attachment.jpg>
More information about the vtkusers
mailing list