and a combination of r.clump and r.stats in grass (which is "linked" to R) can also do the job.
Agus Andrew Niccolai escribió: > If you aren't dedicated to an R specific solution, ImageJ is open source and > does this under Analysis/Binary. > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Murray Richardson > Sent: Wednesday, March 12, 2008 12:59 PM > To: r-sig-geo@stat.math.ethz.ch > Subject: [R-sig-Geo] enumerate grid clusters/patches with size of contiguous > cluster > > Hello friends, > > I am trying to take a binary input grid of patches (connected cells with > value = 1), and assign to each non-zero cell the total number of pixels > comprising the patch to which it belongs. > > So for a connected patch of 27 pixels, all cells belonging to that patch > will have a value of 27. > > Just wondering if anyone has any suggestions. Maybe a function I don't > know about yet... > > Thanks in advance, > > Murray Richardson > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > -- Dr. Agustin Lobo Institut de Ciencies de la Terra "Jaume Almera" (CSIC) LLuis Sole Sabaris s/n 08028 Barcelona Spain Tel. 34 934095410 Fax. 34 934110012 email: [EMAIL PROTECTED] http://www.ija.csic.es/gt/obster _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo