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

Home » Public Forums » archive » 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
Contour [message #8458] Mon, 17 March 1997 00:00 Go to next message
NOYON Mario is currently offline  NOYON Mario
Messages: 1
Registered: March 1997
Junior Member
Is there a way to make a contour manualy with the mouse with IDL.
Does someone thinks that is possible or perhaps one of you has done it
before.

Thanks in advance.

************************************************************ *******
NOYON Mario
ENSERB
3eme annee informatique
http://www.enserb.u-bordeaux.fr/~noyon/index.html
noyon@info.enserb.u-bordeaux.fr
Re: contour [message #10066 is a reply to message #8458] Fri, 03 October 1997 00:00 Go to previous messageGo to next message
hcp is currently offline  hcp
Messages: 41
Registered: August 1995
Member
|> R. Bauer wrote:
|> > Who can explain me the cell_fill flag by contour.
[and Martin Schultz replied]
|> cell_fill splits the area to be filled into a number of smaller
|> cells (I think they are rectangles) instead of using some sophisticated
|> fill algorithm that uses the outline (contourline) of the area to be
|> filled. There are occasions when the standard fill produces very weird
|> results (I encountered these, but forgot how I made it), in these cases
|> cell_fill will be much more robust. It may be a good idea to try out
|> both algorithms (with and without cell_fill) if you have contour plots
|> with a lot of variety, many gaps in the data or other somewhat ill-posed
|> problems.

Also, be warned that in IDL 5.0 the cell_fill keyword does the same
as the fill keyword.

In IDL 5.0.2 /cell_fill is back but has bugs which occur on
map projections (one of the main places where you need cell_fill in
the first place). RSI are aware
of this. The workaround they suggest is to use this short program as
a wrapper around contour.

; ************************************************************ **
PRO CONTOUR_CELL, z, x, y, _EXTRA=e
; This program was supplied by RSI as a fix for the bigs in the
; cell_fill algorithm of the contour
; routine. contour_cell,data,xgrid,ygrid,/cell_fill will work where
; contour ,data,xgrid,ygrid,/cell_fill will not

nx = n_elements(x) ;Divide a rectangular grid into
;triangles
ny = n_elements(y)
tr = lonarr(6, nx-1, ny-1, /NOZERO)
for iy=0, ny-2 do for ix=0,nx-2 do $ ;Make the triangles
tr(0, ix, iy) = [0, 1, nx+1, 0, nx+1, nx] + (ix + iy*nx)
;2/cell
CONTOUR, z, x # replicate(1,ny), replicate(1,nx) # y, $
TRIANGULATION=tr, _EXTRA=e
end
; ************************************************************ **

Hugh

--

============================================================ ==============
Hugh C. Pumphrey | Telephone 0131-650-6026
Department of Meteorology | FAX 0131-662-4269
The University of Edinburgh | Replace 0131 with +44-131 if outside U.K.
EDINBURGH EH9 3JZ, Scotland | Email hcp@met.ed.ac.uk
OBDisclaimer: The views expressed herein are mine, not those of UofE.
============================================================ ==============
Re: contour [message #10072 is a reply to message #8458] Thu, 02 October 1997 00:00 Go to previous messageGo to next message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
R. Bauer wrote:
>
> Hi
>
> Who can explain me the cell_fill flag by contour.
>
> Thanks
>
> --
> R.Bauer
>
> Institut fuer Stratosphaerische Chemie (ICG-1)
> Forschungszentrum Juelich
> email: R.Bauer@fz-juelich.de
Hi Reimar,

cell_fill splits the area to be filled into a number of smaller
cells (I think they are rectangles) instead of using some sophisticated
fill algorithm that uses the outline (contourline) of the area to be
filled. There are occasions when the standard fill produces very weird
results (I encountered these, but forgot how I made it), in these cases
cell_fill will be much more robust. It may be a good idea to try out
both algorithms (with and without cell_fill) if you have contour plots
with a lot of variety, many gaps in the data or other somewhat ill-posed
problems.

Regards,
Martin


------------------------------------------------------------ ------------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-9837
Please indicate name and room (186 Pierce) when sending a fax

e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ ------------
Re: Contour [message #15318 is a reply to message #8458] Fri, 30 April 1999 00:00 Go to previous message
VU KHAC Tri is currently offline  VU KHAC Tri
Messages: 25
Registered: March 1999
Junior Member
Hi,
Suppose you have 2D BW image (0-black, 1-white)
img1 = AddBorderToImage(img, 1, 1, 1, 1)
img2 = shift(img1,1,1)
img3 = shift(img1,0,1)
img4 = shift(img1,-1,1)
img5 = shift(img1,0,1)
img6 = shift(img1,0,-1)
img7 = shift(img1,-1,1)
img8 = shift(img1,-1,0)
img9 = shift(img1,-1,-1)
My_Contour = (img1 EQ 1) AND ((img1 NE img2) OR (img1 NE img3) OR (img1 NE
img4) OR ...(img1 NE img())
My_Contour = TrimBorderOfImage(My_Contour, 1,1,1,1)

My_Contour now is the image of the contour of BW image.
Regards,
Tri.


> Ciao,
>
> I want to extract the contour of lungs in CT-images. Therefore I created
> an black/white image, where the threshold can be selcted by the user. I
> want to overlay the resulting contour of black/white image with the
> original image. Unfortunatly the returned contour is tiny and is not
> congruent with the original. How can I magnify the contour and fit it in
> the given frame?
> So far my code is looking like that:
>
> contour, contrast,path_xy=x,y,Path_info=pafo
>
> FOR I=0,(n_Elements(pafo)-1) DO BEGIN
> s=[ indgen(pafo(I).N),0]
> Ploats,xy(*,pafo(I).Offset + s),/Norm
> ENDFOR
>
> Regards, Ruth
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Problems reading HDF after 5.2 upgrade
Next Topic: Numerical Recipes in IDL

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

Current Time: Wed Oct 08 15:53:03 PDT 2025

Total time taken to generate the page: 0.00596 seconds