Image J and R compatability
On Wed, 14 Mar 2007, Andrew Niccolai wrote:
Hi. I have written a few macros in Image J that allows me to output a series of summary statistics after calling the "Analyze Particles" function to run over a series of .tiff images that R created. My questions are the following: 1). Aside from Zooplankton software, is there a way within R to call for ImageJ software to open and then execute the ImageJ macro. I suppose I would be willing to leave ImageJ open if I can have R "run" the macro.
It might be worth seeing whether you can run the java through the rJava interface.
2). Is there any R equivalent to ImageJ's Analyze Particles function? (This function essentially finds the edges of pixel values above a certain threshold and creates polygons around these isolated clusters).
Are the thresholds known already? Are the images large? My guess would be that once you can find the patches, that there ought to be ways. The current functions in sp and maptools for turning grid cells into polygons, then taking the union of cells with specific factor levels might be a way to go for a prototype, but will be slow for all but small grids. You might look at getting the grid centres of grid cells belonging to the patch, then using a trick in deldir to identify the external points (those with larger tesselation areas than the grid cell) - because a convex hull would miss concavities. You could set an aspatial threshold, and later drop patches that are too small. I think there may be ideas in EBimage and rimage, possibly also in one or other of the medical imaging packages (AnalyseFMRI perhaps). Roger
Thanks for any assistance! Andrew Niccolai Doctoral Candidate Yale School of Forestry 203-432-5144
Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no