[Insight-users] How to get the boundary points of an image
Susana
sumercav at ono.com
Tue Apr 4 15:55:45 EDT 2006
Hello,
I'd like to make a filter that generates a signed distance from a contour
without previous knoledge of which region is inside the contour, and which
is outside, so in order to change the sign of the outer region, I want to
take the external points of the image. For a 2D image, I've tried to do
this:
typename OutputImageType::SizeType size =
output->GetLargestPossibleRegion().GetSize();
typename OutputImageType::IndexType index;
//Take all the border pixels on the first direction
for ( unsigned long k = 0 ; k < size[0] ; k++ )
{
index[0] = k;
index[1] = 0;
m_ContornoExterno->Push( index );
index[1] = size[1] - 1;
m_ContornoExterno->Push( index );
}
//Take all the border pixels on the second direction
for ( unsigned long k = 1 ; k < size[1]-1 ; k++ )
{
index[0] = 0;
index[1] = k;
m_ContornoExterno->Push( index );
index[0] = size[0] - 1;
m_ContornoExterno->Push( index );
}
m_ContornoExterno behaves like a FIFO queue. The problem is that it would
only work for 2D images, and I'd like to extend it to 3D (and preferably
ND). I've looked for iterators, but I haven't found any that does exactly
that; the closest is ImageBoundaryFacesCalculator. Could you give me some
advice about what to do?
Thank you,
Susana
----- Original Message -----
From: "Luis Ibanez" <luis.ibanez at kitware.com>
To: <sumercav at ono.com>
Cc: <insight-users at itk.org>
Sent: Tuesday, April 04, 2006 3:28 PM
Subject: Re: [Insight-users] How to get the boundary points of an image
>
> Hi Susana,
>
> What you want is to get the physical coordinates of the image corners ?
>
> Do you want to do this in 3D ? or ND?
>
> The ImaggeBoundaryFacesCalculator is a more sophisticated object,
> it actually decompose your image in pieces suitable for running
> neighborhood iterators in them. It is probably too complicated for
> what you actually want to compute.
>
> Please give us more details of what you want to do.
>
>
> Regards,
>
>
> Luis
>
>
>
> -----------------------
> sumercav at ono.com wrote:
>> Hello everybody,
>>
>> I'd like to get all the boundary points of an N-dimensional image. In the
>> software guide I've found the ImageBoundaryFacesCalculator, but it seems
>> that it also takes the points of the inside, and it's not clear to me how
>> to get just the boundary points without the others. How could I do that?
>> I need it to apply later a breadth-first search on the rest of the image.
>>
>> Thank you,
>>
>>
>> Susana
>>
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>
>
> __________ Información de NOD32, revisión 1.1454 (20060321) __________
>
> Este mensaje ha sido analizado con NOD32 antivirus system
> http://www.nod32.com
>
>
More information about the Insight-users
mailing list