Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
IDL 5.0 Bug Report: SEARCH2D.PRO Platform: Sun Sparc 2/10/20/Ultra, Solaris 2.5, OpenWindows The following is an excerpt from a notice I sent to RSI concerning a bug in the SEARCH2D.PRO function. The bug occurs when the seed point for your 2D search is on one of the edges of the image. The results from SEARCH2D() are almost the exact opposite of what you would expect! This problem can be easily reproduced by the following code (note that in this example you are searching for "non-object" pixels): window, xsize=512, ysize=256, /free array = bytarr(256,256) array(*) = 100 array(0:100,*) = 0 array(200:255,*) = 0 array(*,0:100) = 0 array(*,200:255) = 0 tvscl, array, 0 ; Display image with "object" in middle xseed = 0 yseed = 0 roi = search2d(array, xseed,yseed, 0,1) ; Search for 0 >= pixels <=1 array(roi) = 1 tvlct, 255,0,0, 1 ; Mark pixels found as red tv, array, 1 The SEARCH2D.PRO function was modified considerably for IDL 5.0, and keyword were added, others were obsoleted, yet these changes are not reflected in the Online help!! Nor are they documented in the "New and enhanced routines" section of "What's New in IDL 5.0". Since SEARCH2D() was changed so that it now uses LABEL_REGION() to find the region, the bug may actually be in LABEL_REGION(), so be aware of this if you use either of these routines. Hope this is useful info. Dave -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ David S. Foster Univ. of California, San Diego Programmer/Analyst Brain Image Analysis Laboratory foster@bial1.ucsd.edu Department of Psychiatry (619) 622-5892 8950 Via La Jolla Drive, Suite 2200 La Jolla, CA 92037 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ "I have this theory that if we're told we're bad, then that's the only idea we'll ever have. But maybe if we are surrounded in beauty, someday we will become what we see." - Jewel Kilcher