[Insight-users] How to use itkBinaryPruningImageFilter

robert tamburo robert.tamburo at gmail.com
Wed Jun 8 07:24:45 EDT 2011


I'm not too familiar with this filter, but a quick scan of the source leads
me to believe that it expects a binary image containing zeroes and ones (see
below).

Genus is of type PixelType. If it is unsigned char and foreground pixels are
255, the result will be overflow errors during the genus calculation never
satisfying the pruning condition.

Perhaps there should be a set foreground value function then genus can be of
type int and the pruning condition can be changed to
if(genus/m_ForegroundValue < 2).

      if (ot.GetCenterPixel())
       {
         PixelType genus;
         genus  = ot.GetPixel(offset1) + ot.GetPixel(offset2);
         genus += ot.GetPixel(offset3) + ot.GetPixel(offset4);
         genus += ot.GetPixel(offset5) + ot.GetPixel(offset6);
         genus += ot.GetPixel(offset7) + ot.GetPixel(offset8);
         if (genus < 2)
           {
             genus = 0;
             ot.SetCenterPixel( genus );
           }

2011/6/7 di xiao <xiaodi68 at hotmail.com>

>  Dear all:
>
> Anyone successfully used the itkBinaryPruningImageFilter? I searched the
> Insight-users but no solution about it.
>
> My codes:
>
>   //Pruning the thinning image
>   typedef itk::BinaryPruningImageFilter<ReaderImageType, ReaderImageType>
> BinaryPruningImageFilterType;
>   BinaryPruningImageFilterType::Pointer binaryPruningFilter =
> BinaryPruningImageFilterType::New();
>   binaryPruningFilter->SetInput(binaryThinningFilter->GetOutput());
>   binaryPruningFilter->SetIteration(10);
>   binaryPruningFilter->Update();
>   binaryPruningFilter->Print(std::cout, 0);
>
> imageWriter->SetInput(binaryPruningFilter->GetPruning());
>
> My thinning image is a binary image (background = 0, thinning skeleton =
> 255).
> But I didn't get any changes after put the thinning image through the
> pruning filter.
>
> Did I understand wrongly to using the filter?
>
> Thanks,
>
> Di
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110608/cbc81dc6/attachment.htm>


More information about the Insight-users mailing list