ImageJ Selections to Georeferenced Spatial Objects

August 5, 2015

(This article was first published on » R, and kindly contributed to R-bloggers)


As a result of the last UseR conference and some great spatial workshops and talks where I participated I decided to rework the selection dialog for the upcoming Bio7 2.3 to transfer ImageJ selection data as ‘Spatial Objects’ with the help of the package ‘sp‘ and the Java GDAL binding (version 1.7.1).


One reason to add this functionality is the great improvement for the use of the ‘spatstat’ package which I will present as part of a workshop at the next Imagej conference 2015 (I already gave a short overview of R and spatial packages in the 2012 conference).

In additon the supplied actions can help scientists which work with georeferenced data to profit from the wealth of ImageJ analyze methods and vice versa brings new maybe unknown GIS methods in the focus of microscopists.

The transferred objects can be converted easily to spatstat objects (ppp, psp, owin, etc.) and if equipped with a data frame converted to a marked point pattern.

Though it is already easy to convert ImageJ selections and image pixel data to spatstat objects in 2d and in 3d from ImageJ measurements with Bio7 the new actions make it easy to georeference the data (probably with some data dependent unknown limitations of projections of course – the Java API of GDAL emphasizes that for the used transform method) and add data frames to the spatial shapes (transferred ImageJ measurements data, created spreadsheet data, etc., available in the R workspace).

Below you can see a result of a dummy transfer of point data from a 7000*7000 georeferenced geotiff image where I selected and transferred points from a highly zoomed tiny region.

The right site of the image shows the selected (x,y) ImageJ selection. The left site shows the final converted (Lat, Lon) data loaded in the GIS software QGIS to control the pixel precision.


At all the georeferenced results seems to be exact in all test so far.

I think the new methods are a great help to transfer image measurements and selections to R ready for postprocessing with powerful spatial packages like, e.g., ‘spatstat’.

To leave a comment for the author, please follow the link and comment on their blog: » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)