Category Archives: R

Bio7 2.3 Released!

28.08.2015

As a result of the useR conference 2015 with fantastic workshops and presentations where I also presented my software I released a new version of Bio7 with many improvements and new features inspired by the R conference and important for the next ImageJ conference 2015 where I will give a Bio7 workshop.

For this release I didn’t bundle R for MacOSX (so R is easier to update, etc.).
So for MacOSX and Linux R and Rserve have to be installed. But this becomes very easy because Bio7 uses now the default OS systems paths which normally point to the default R installation (as long as no path in the Bio7 preferences is specified).
In addition some precompiled Rserve binaries (cooperative mode) are available and can be installed easily from within R – see the installation section below.

Download Bio7: http://bio7.org

Release notes:

R

  • Updated R to 3.2.2 (Windows).
  • Added new R Markdown functionality – see video below (installation of ‘rmarkdown’, ‘knitr’ package and ‘pandoc’ binary required).

  • Added an option to use the JavaFX browser to open HTML markdown knitr documents to allow a fullscreen view (primary F1,F2, secondary F3, tertiary F4, quartary F5 monitor).
  • Added a simple default markdown editor to Bio7.
  • Added a new wizard for markdown documents.
  • In the ‘Navigator’ view you can now set the working dir of R (context menu action).
  • Added a new convert to list action in the context menu of the R-Shell.
  • Added a new default hidden „Custom“ perspective“ in which custom views can be opened in a predefined layout.
  • Added two new actions to open Bio7 views more easily (as a replacement for the disfunctional open view actions).
  • Improved the ImageJ ‘Zoom In’ and ‘Zoom Out’ action (now zooms correctly to the mouse pointer).
  • Improved the default paths for Linux and MacOSX.
  • Now the R system path, the R default library path and the pdflatex path is fetched from the PATH environment (as long as no specific location is set in the Bio7 preferences ).
  • Improved the installation of Rserve on Linux and Mac with precompiled Rserve libraries which can be installed easily from within R (R version 3.2.2 required!) .
  • Compiled Rserve in cooperative mode for MacOSX and Linux. This will make the installation process of Rserve very easy.
  • Deactivated some R editor options by default (can be enabled in the R preferences).

HTML GUI editor

  • Mouse selection now works again (thanks to Java 1.8.60).

ImageJ and R

  • Changed the variables names for the size of the image in the Particles transfer to ‘imageSizeX’, ‘imageSizeY’ (to be in accordance with the image matrix transfer).
  • Improved the ‘ImageMethods’ view ‘Selection’ action (see video below). Now it is opened as a view for multiple transfers.
  • Added new actions to transfer ImageJ selections as SpatialPolygons, SpatialLines or Spatial Points (or SpatialPolygonsDataframe, etc., if an available dataframe is selected). Selected objects can be transferred georeferenced if a georeferenced raster file (*.geotiff) is selected – see video below:

Linux

  • More stability improvements.
  • Fixed some Eclipse 4.5 bugs, feature? which opened an extra shell when opening an SWT ‘InputDialog’ class.
  • Improved the visual appearance of menus (menu size can be set in the Bio7 ImageJ preferences).
  • Improved the path to the native OS applications by using the systems path by default. So normally no paths have to be adjusted.

MacOSX

  • Improved the stability by fixing a bug/feature? in the Nebula grid spreadsheet components.
  • Now R has to be installed seperately. The default path will be fetched from the OS environment PATH (as long as no path is given in the preferences).
  • Rserve has to be installed from within R. A compiled binary is available and can be installed easily (see installation details below).
  • Fixed some Font bugs (especially for the console). Fonts can be customized in the default Bio7 CSS!

Java

  • Updated  Java to Jre 1.8.60.

ImageJ

  • Updated to version 1.50.a

Bug Fixes:

Many other improvements and bug fixes for Linux and MacOSX and Bio7 in general (see the Bio7 Bitbucket repository for details).

Installation:

Simply unzip the archive of Bio7 2.3 (Windows, Linux) in your preferred OS location. The MacOSX version can be installed easily with the available *.dmg file installer. To start the application simply double click on the  Bio7 binary file.

R and Rserve installation

For Linux and MacOSX R and Rserve has to be installed. Bio7 will fetch the default paths from the OS System PATH (so hopefully no other adjustments have to be made).

Rserve has to be available in cooperative mode which can be installed from the Bio7 Bitbucket website from within R with:

MacOSX:

install.packages(“https://bitbucket.org/maustenfeld/bio7-new/downloads/Rserve_1.8-4_Mac_cooperative.tgz”, repos=NULL)

Linux (compiled with Linux Mint 17.2):

install.packages(“https://bitbucket.org/maustenfeld/bio7-new/downloads/Rserve_1.8-4_Linux_cooperative.tar.gz”, repos=NULL)

Or simply download from the Bio7 Bitbucket repository:

https://bitbucket.org/maustenfeld/bio7-new/downloads

Compilation of Rserve (if necessary):

Rserve can be compiled and installed in the local R application with the shell command:

sudo PKG_CPPFLAGS=-DCOOPERATIVE R CMD INSTALL Rserve_1.8-4.tar.gz

 

R Markdown:

To use the R Markdown features please install the rmarkdown package, knitr from within R and the pandoc binaries from here:

https://github.com/jgm/pandoc/releases/latest

For Windows and MacOSX pandoc must be on the system PATH – Linux adds the path by default.

You can also add the path in R with:

MacOSX: Add pandoc to the OS PATH. Else type in the R console:

> Sys.setenv(PATH=”/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$HOME/bin”)

or with the LaTeX path added:

>Sys.setenv(PATH=”/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/TeX/texbin:$HOME/bin”)

Linux: After installation available. Else type in the R console:

> Sys.setenv(PATH=”/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$HOME/bin”)

Windows: Add pandoc path to the Windows PATH (evtl restart). Else type in the R console:

Sys.setenv(PATH=paste(Sys.getenv(“PATH”),”C:/pandoc”, sep=””))

The commands can be copied and saved for each startup (only if necessary) in the R preferences textfield: R->Preferences->Rserve Preferences->R startup commands

LaTeX:

To use LaTeX with Bio7 please install a LaTeX environment e.g.

Windows: MiKeTX (http://miktex.org/)

MacOSX: MacTeX (https://tug.org/mactex/)

Linux: TeX Live (http://www.tug.org/texlive/)

Then adjust the Bio7 path to the pdflatex binary (only necessary if not on the OS path!):

R->Preferences->Rserve preferences->pdflatex path

To get the installation location folder on Linux or on MacOSX type:

> which pdflatex

For Windows MikeTeX pdflatex can be typically found at:

C:\Program Files (x86)\MiKTeX 2.9\miktex\bin

 

Screenshots:

Linux

linuxbio723

MacOSX

macosxbio723

Windows

windowsbio723

ImageJ Selections to Georeferenced Spatial Objects

05.08.2015

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).

Video:

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.

giscomparison

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’.

Bio7 at the useR! Conference 2015

I recently released a new version of Bio7 just in time and planned for the useR conference 2015 where I will present Bio7 in the Ecology oral session titled:

“A Graphical User Interface for R in an Integrated Development Environment for Ecological Modeling, Scientific Image Analysis and Statistical Analysis “.

I hope to see you there and if you have any questions about Bio7 don’t hesitate to contact me. I’m looking forward to the conference.

Bio7 2.2 for Windows, Linux and MacOSX released

26.06.2015

I released a new version of Bio7 for Windows, Linux and MacOSX simultaneously. This release is based on Eclipse 4.5 which was published on Wednesday.
It comes bundled with the latest ImageJ version (1.49u) and the latest R version (bundled with Windows and Mac).

Download at: http://bio7.org

New features:

  • Based on Eclipse 4.5 (Mars)
  • Updated ImageJ to 1.49u
  • Updated R to version 3.2.1
  • HTML editor has now an enabled “Outline” view (with the help of a HTML parser)
  • New feature and action (main toolbar) to create knitr HTML reports easily  (just add R commands in a HTML div layer which can be created with the knitr action in the GUI HTML editor toolbar – see screenshot below)

knitr

  • Added default knitr HTML preferences
  • Added more R editor preferences
  • Improved the MacOSX GUI
  • Updated all scientific libraries for Java (Commons Math, etc.)
  • Improved the dynamic invocation of the Java main method (now an empty string is passed)
  • Updated the Groovy interpreter

Installation:

Simply unzip the archive of Bio7 2.2 (Windows, Linux) in your preferred OS location. The Mac version can be installed easily with the available *.dmg file installer.

Linux only: R and Rserve have to be installed. Please install Rserve in cooperative mode for Bio7: sudo PKG_CPPFLAGS=-DCOOPERATIVE R CMD INSTALL Rserve_1.8-1.tar.gz

See: Bio7 documentation

Screenshots:

Linux:

linux

MacOSX:

mac

Windows;

windows

 

Bio7 2.1 Release Candidate RC2 for MacOSX Available

29.05.2015

I published a MacOSX release candidate for Bio7 2.1 based on Eclipse 4.5 RC2. This release was tested on MacOSX 10.10. The final release will be published after the official Eclipse 4.5 release.

macscreen

Installation:

  • Bio7 2.1 comes as a regular *.dmg installation package. Just drag the Bio7.app to the Applications folder.
  • Bio7 2.1 comes with a bundled jre 1.8.45. No need to install an extra Java Runtime Environment.
  • Bio7 2.1 comes bundled with R 3.2.0 and Rserve 1.8.2 installed.

Eventually XQuartz has to be installed to use the default custom R plotting device of Bio7 on MacOSX. If you plot the first time with R and XQuartz is not available a dialog will inform about the missing package.

Download Bio7 at:

http://bio7.org