comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Region inside the CONTOUR
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Region inside the CONTOUR [message #45059] Tue, 02 August 2005 07:23
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
James writes:

> Also, I've read corresponding nice articles of David Fanning on his
> website. But I'm asking here for a robust procedure which presumably has
> been already written by someone here.

I think you pretty much ask in vain. :-)

Many of us have to deal with these kinds of problems. Ben has
given you a very thorough outline of how the problem is solved.
I've made tools that I've found helpful in solving the problem
available on my web page. But I doubt very much that there
exists a "robust procedure" that is going to work for you.
There are just too many variables to make such a procedure
possible.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Region inside the CONTOUR [message #45061 is a reply to message #45059] Tue, 02 August 2005 06:35 Go to previous message
James[1] is currently offline  James[1]
Messages: 9
Registered: August 2004
Junior Member
Hi Ben,

Thank you very much for the answer ! Actually the reason, why I'm using
the CONTOUR procedure is the following. Actually the image structure is
quite messy and the contrast between the ROIs and the background is very
low.
I tried to apply some segmentation algorithms, but without much success.

On the other hand, since I need some quantative estimations of the
parameters,
I have to start with certain sigma level above the background (a threshold
for
object detection).

Also, I've read corresponding nice articles of David Fanning on his
website. But I'm asking here for a robust procedure which presumably has
been
already written by someone here.

Cheers,
James

> First is a heads up about contour... the N field of PATH_INFO structure
> is the number of vertices that make up the contour. From your
> description, it looks like you are assuming that N describes the number
> of pixels contained within the contour. This will be a gothcha unless
> you want to use the number of vertices as a size proxy.
>
> This is a great place to start regarding the ellipse fitting, etc. You
> may find that all of your questions are answered there.
>
> http://www.dfanning.com/documents/tips.html#ImageProcessing
>
> The IDL Image Processing User Guide is very helpful, too.
>
>
> Lastly, for most image and roi processing I have graviated away from
> CONTOUR toward the following (roughly outlined) path...
>
> Segment the image into foreground and background
>
> Use LABEL_REGION to 'colorize' the foreground features. Be aware that
> LABEL_REGION treats image edge pixels as background, so depending upon
> you needs you might want to pad the image with a border of pixels.
>
> Depending upon you needs you could use IMAGE_STATISTICS if that suits
> your needs or...
>
> Use HISTOGRAM and REVERSE_INDICES to extract the ROIs (you can filter
> based upon number of pixels at this time, retrieve the flux of original
> pixels, etc.)
>
> Convert the pixels indices to XY coords. Use one of David's boundary
> finding routines if you prefer to have the boundary instead.
>
> Pass the coords to IDLanROI as a convenient place holder. It has a
> number useful methods... to which you can add your own.
>
>
> You kind of have to fill in the details - but that seems to work quite
> well for me.
>
> Cheers,
> Ben
>
Re: Region inside the CONTOUR [message #45062 is a reply to message #45061] Tue, 02 August 2005 06:13 Go to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
James wrote:
> Hi !
>
> Can anyone help me with a problem ? There is a ROI in the image for which
> I want to get some statistics. Basically what are needed: total flux of the
> area inside the ROI and the parameters of the ellipse, fitted to that
> region.
> Is there ant robust way of doing that ?
>
> I have several ROIs in the image and this is how I define them:
>
> .....
>
> contour, im1, PATH_XY=xy, PATH_INFO=info, LEVELS=[3*sigma],
> PATH_DATA_COORDS=1
>
> data_index = WHERE(info(*).N GT 15) ; ---- select regions larger than
> 15 pixels
> data_total = size (data_index,/N_ELEMENTS)
> my_roi = PTRARR (data_total, /ALLOCATE_HEAP)
>
> for i=0L, data_total-1 do begin
> s = [indgen(info(data_index[i]).N),0]
> *my_roi[i] = xy(*,info(data_index[i]).offset + s)
> endfor
>


Hi,

First is a heads up about contour... the N field of PATH_INFO structure
is the number of vertices that make up the contour. From your
description, it looks like you are assuming that N describes the number
of pixels contained within the contour. This will be a gothcha unless
you want to use the number of vertices as a size proxy.

This is a great place to start regarding the ellipse fitting, etc. You
may find that all of your questions are answered there.

http://www.dfanning.com/documents/tips.html#ImageProcessing

The IDL Image Processing User Guide is very helpful, too.


Lastly, for most image and roi processing I have graviated away from
CONTOUR toward the following (roughly outlined) path...

Segment the image into foreground and background

Use LABEL_REGION to 'colorize' the foreground features. Be aware that
LABEL_REGION treats image edge pixels as background, so depending upon
you needs you might want to pad the image with a border of pixels.

Depending upon you needs you could use IMAGE_STATISTICS if that suits
your needs or...

Use HISTOGRAM and REVERSE_INDICES to extract the ROIs (you can filter
based upon number of pixels at this time, retrieve the flux of original
pixels, etc.)

Convert the pixels indices to XY coords. Use one of David's boundary
finding routines if you prefer to have the boundary instead.

Pass the coords to IDLanROI as a convenient place holder. It has a
number useful methods... to which you can add your own.


You kind of have to fill in the details - but that seems to work quite
well for me.

Cheers,
Ben
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Region inside the CONTOUR
Next Topic: medical image registration and ITK

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:39:44 PDT 2025

Total time taken to generate the page: 0.00481 seconds