[vtkusers] How to threshold vtkimage data

Ali Habib ali.mahmoud.habib at gmail.com
Wed Oct 13 03:29:59 EDT 2010


Hi All,

I read a series of DICOM files , and I want to apply threshold (for further
segmentation) but the below cod not effect any more

 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.ThresholdByLower(100);
            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); // 1123 extract mandible  //
            skinExtractor.GenerateValues(1, -300, 300);
            skinExtractor.ComputeGradientsOn();

any suggestion pelase

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101013/d70dc846/attachment.htm>


More information about the vtkusers mailing list