[ITK-users] region inside points

Fabian Torres dae.wong at gmail.com
Wed Oct 8 06:51:51 EDT 2014


Hi all.

Just wanted to let you know I solved the problem for 2D by doing the next:

Arrange the white pixels in clockwise order
  1. Calculate the centroid of the region define by the white pixels
  2. Calculate the angle between the white pixels and the centroid using
atan2( )
  3. Sort the white pixels in clockwise order.

Draw a line between the pixels to fill the gap between points to obtain a
closed contour
  1. Using LineIterator to draw lines between the clockwise ordered points

Fill the region inside the close contour.
 1. Using GrayScaleFillholeImageFilter.

I don´t know if this is a nice solution but it works for now.

I will try to use this approach for 3D images, processing them slice by
slice. I think I can use the itkSliceBySliceImageFilter, since I create an
itk filter that outputs the closed contour image, but I don´t know if this
is going to work.

If any one have any advice on this matter it would be appreciated.

Greetings

On Tue, Oct 7, 2014 at 4:08 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

>  Maybe there is a way to use a rolling ball.  Richard Beare has some
> morphological filters that might be applicable, but I think it will always
> be a bit complicated.
>  ------------------------------
> *From:* Fabian Torres [dae.wong at gmail.com]
> *Sent:* Tuesday, 7 October 2014 9:05 p.m.
> *To:* Gib Bogle
> *Cc:* insight-users
>
> *Subject:* Re: [ITK-users] region inside points
>
>   Hi Gib.
>
> Thanks for the quick response. The problem of using dilation and
> skeletonization is that some times the gap between pixels is big, and I
> will have to work with different and big structural elements to be sure
> that all the gaps were eliminated.
>
>  I was hoping to find a class that works similar to a convex hull (it
> does not have to be convex) algorithm and then find the region surrounded
> by the hull.
>
>  Thanks
>
> On Tue, Oct 7, 2014 at 3:46 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:
>
>>  Sorry, I misread your post Fabian - I read it as you wanting the region
>> _surrounding_ the white pixels.  But dilate might be usable to fill the
>> gaps, followed by skeletonization.
>>  ------------------------------
>> *From:* Insight-users [insight-users-bounces at itk.org] on behalf of Gib
>> Bogle [g.bogle at auckland.ac.nz]
>> *Sent:* Tuesday, 7 October 2014 8:40 p.m.
>> *To:* Fabian Torres; insight-users
>> *Subject:* Re: [ITK-users] region inside points
>>
>>    Maybe you could do something with BinaryImageDilateFilter.
>>  ------------------------------
>> *From:* Insight-users [insight-users-bounces at itk.org] on behalf of
>> Fabian Torres [dae.wong at gmail.com]
>> *Sent:* Tuesday, 7 October 2014 8:38 p.m.
>> *To:* insight-users
>> *Subject:* [ITK-users] region inside points
>>
>>   Hi all.
>>
>>  I have an image that represents some pixels over the surface of an
>> object. Pixels in the surface have value of 1 while any other pixel has
>> value of 0.
>> The pixels are not a continuous line, there are some gaps between pixels.
>> I want to know the region surrounded by the white pixels in my image.
>>
>>  I will be working with 2D and 3D data. Is there any class implemented
>> in ITK that I can use?
>>
>>  Thanks
>>  --
>> Fabián Torres Robles
>> Maestria en Ciencias en Ingeniería Electrónica
>> Ingeniería en Sistemas Electrónicos
>> tel. 58081280, 0445534661338
>> e-mail fabian.trobles at gmail.com, dae.wong at gmail.com
>>
>
>
>
>  --
> Fabián Torres Robles
> Maestria en Ciencias en Ingeniería Electrónica
> Ingeniería en Sistemas Electrónicos
> tel. 58081280, 0445534661338
> e-mail fabian.trobles at gmail.com, dae.wong at gmail.com
>



-- 
Fabián Torres Robles
Maestria en Ciencias en Ingeniería Electrónica
Ingeniería en Sistemas Electrónicos
tel. 58081280, 0445534661338
e-mail fabian.trobles at gmail.com, dae.wong at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20141008/41725f4d/attachment.html>


More information about the Insight-users mailing list