[vtkusers] How to threshold vtkimage data

Ali Habib ali.mahmoud.habib at gmail.com
Wed Oct 13 08:38:09 EDT 2010


Dear Jim,

I use this pipline to extract the softtissue only (the human face skin ) but
internal objects be extracted too , do you any suggestion regarding that


Best regards

On Wed, Oct 13, 2010 at 9:43 AM, Jim Peterson <jimcp at cox.net> wrote:

>  Ali Habib wrote:
>
>> 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
>>
> So what were you expecting to have happen and what happened for you? What
> did you change to cause this to "not effect any more"? Have you been reading
> the vtk class documentation? See
> http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html for the
> contour filter class doc. what are you expecting GenerateValues(1,-300,300)
> to set as contour values? Does that sound like a appropriate use of that
> function? how is one output value supposed to include the min and max
> values?
>
> My gut feeling is the island filter with threshold 1000 is removing all
> features.
>
> HTH,
> Jim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101013/377d0d91/attachment.htm>


More information about the vtkusers mailing list