home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / graphics / 14182 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  1.8 KB

  1. Xref: sparky comp.graphics:14182 comp.graphics.visualization:2075
  2. Newsgroups: comp.graphics,comp.graphics.visualization
  3. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!centi!mavuduru
  4. From: mavuduru@centi.cs.umn.edu (Rama Mavuduru)
  5. Subject: Re: Contouring advice/code sought
  6. Message-ID: <mavuduru.727984162@centi>
  7. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  8. Nntp-Posting-Host: centi.cs.umn.edu
  9. Organization: University of Minnesota
  10. References: <30707@castle.ed.ac.uk>
  11. Distribution: comp
  12. Date: Mon, 25 Jan 1993 17:49:22 GMT
  13. Lines: 42
  14.  
  15. In <30707@castle.ed.ac.uk> eonu24@castle.ed.ac.uk (I Reid) writes:
  16.  
  17. >I need advice (or preferably code) to convert 2D data sets (512 x 298 of
  18. >8 bit integer data) to contour lines.
  19.  
  20. >I have a number of microscopy images which I want to contour and my
  21. >attempts to find explanations/code to do this have failed so far, so...
  22.  
  23.  
  24.     Here's the trick:
  25.  
  26.     The data is function values on uniform rectangular grid.
  27.  
  28.     Consider a rectangle of the grid. 
  29.  
  30.         Split the rectangle into two triangles along a diagonal.
  31.  
  32.             Consider a triangle. Let the function values
  33.             be F1, F2, and F3, at the vertices V1, V2, and
  34.             V3, respectively.
  35.  
  36.             Let Fc be the contour value. 
  37.  
  38.             If F1 <= Fc < F2, the contour passes through
  39.             the edge V1V2. The contour point on this edge
  40.             is found by linear interpolation.
  41.  
  42.             Similary for other edges of the triangle.
  43.  
  44.             This procedure will yeild two points per triangle if
  45.             the contour passes through the triangle.
  46.  
  47.             Join these two points with a line. 
  48.  
  49.             Repeat this for the other triangle in the rectangle.
  50.         
  51.         Repeat this for other rectangles of the grid.
  52.  
  53.     This will give the contour of the value Fc on the rectangular grid.
  54.  
  55. ---
  56. Rama Mavuduru
  57.