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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Region inside the CONTOUR
Next Topic: medical image registration and ITK

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

Current Time: Thu Oct 09 23:56:18 PDT 2025

Total time taken to generate the page: 0.64068 seconds