[Insight-users] 'delete' a region from an image

Luis Ibanez luis.ibanez at kitware.com
Sat Aug 8 12:47:21 EDT 2009


Hi David,

As we discussed during the tcon, there are (at least) two ways of
doing this.

A) In your filter you can keep a helper image of pixel type unsigned
     char, of the same size as the output image. Every time that you
     accept a pixel in the region growing process you mark this pixel
     in this helper image, and of course, you avoid adding any pixel
     that is already marked.

or

B) The FloodFilled iterator happens to already do (A) internally.
     You could therefore modify this iterator in order to expose
     the internal mask so that you can copy it, or you could add
     a boolean to the iterator in order to enable / disable the
     process of clearing up the mask.

     The pointer to this mask image is:

                m_TemporaryPointer

     and it is declared in

           Insight/Code/Common/
                itkFloodFilledFunctionConditionalConstIterator.h

     The image is cleared up in

           Insight/Code/Common/
                itkFloodFilledFunctionConditionalConstIterator.txx

      in the method InitializeIterator() in line 87:

 m_TemporaryPointer->FillBuffer(NumericTraits<ITK_TYPENAME
TTempImage::PixelType>::Zero);



  Regards,


         Luis


-------------------------------------------
On Wed, Aug 5, 2009 at 11:52 AM, David Doria
<daviddoria+itk at gmail.com<daviddoria%2Bitk at gmail.com>
> wrote:

> I'm implementing an algorithm that uses region growing to find a connected
> region of an image and label it, say, Region A. It should then "throw away"
> Region A so the next iteration (another region growing) cannot grow into the
> Region A. If the image is though of as a graph, this "throw away" operation
> would be equivalent to deleting the edges in the graph that connect vertices
> in Region A. Is this possible in ITK?
>
> Thanks,
>
> David
>
> _____________________________________
> 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 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/20090808/0b7a0766/attachment.htm>


More information about the Insight-users mailing list