Category Archives: R

Image Data Transfer to R with ImageJ and Bio7 2.0

09.12.2014

In the new version of Bio7 2.0 i added some new easy to use functions to transfer image data from ImageJ to R. For example, you can now drag a folder of images on the ImageJ-Canvas
view, open them memory efficient as a virtual stack in ImageJ and transfer them with one action as a list (or raster stack) to R.

With the new or improved actions it is possible to:

  • Transfer an ImageJ stack or virtual stack to R (RGB data or selected datatype will be transferred as a list).
  • Optionally transfer the stack as a raster stack (if the “raster” package is installed).
  • Transfer measured “Particles”  values from the “Results Table” from ImageJ to R.
  • Transfer values from an opened ImageJ “Results Table”.

Video:

Beside this new or improved actions there are many other methods available to transfer image data, selected pixel or selected coordinate data from ImageJ to R.

For an overview of the different functions i created a video playlist on YouTube how Bio7 can effectively asssist in the transfer and statistical analysis of image data (with the help of ImageJ and R).

Playlist:

Bio7 2.0 for Windows Released!

01.12.2014

A new Windows version of Bio7 is available. Many new features have been added to Bio7 2.0 which is now based on Eclipse 4.4. Highlights are the improved R editor, the R debugging Graphical User Interface (using the standard R debugger), the integrated Java Development Tools (JDT) to create Java simulation models with a powerful Java editor and the embedded JavaFX SceneBuilder to create embeddable GUI’s on the fly.

Here an overview of the new features:

R

  • Updated R to Version 3.1.2
  • Updated Rserve to version 1.7.3
  • Rserve is now started by default within a R process in a pseudo-terminal in Bio7.
  • The R pseudo-terminal can also be started without Rserve.
  • If started only in the native pseudo-terminal some Rserve functions are not available (e.g. the plots will be displayed in the default R graphic device and not in ImageJ!)
  • The R terminal and Rserve are now sharing the same process.
  • If you switch from Rserve to the R native pseudo-terminal all R Objects will be preserved and vice versa (same process).
  • Implemented a debugging GUI interface for the R debugger visible if a breakpoint in the editor has been set.
  • Added two special debug views to the R perspective.

Video:

  • If a debugging process is started Rserve automatically switches to the native connection.
  • Added an interrupt action to the R-Shell and the R console to interrupt an R evaluation (Strg+c in the console).
  • Added console actions to kill a native process and to kill a native R (Rterm) process if necessary.
  • Created a new single preferences page for the plot setting .

R Editor

  • Integrated an ANTLR R parser for the R editor.
  • Created an editor outline from parsed R scripts.
  • Added a format action (using “formatR” package if installed).
  • Extended the code completions for the R editor.
  • Syntactical errors are now indicated in the editor.
  • Implemented code folding for functions.
  • Implemented hoover actions for the editor (R help for e.g. a function).
  • Improved the recognition of numbers in the R editor.
  • Implemented a marker for matching brackets.
  • Implemented a function to mark reoccuring words in the editor.

Video:

ImageJ and R

  • Added a new action to transfer the values of the ImageJ “Results Table” to R.
  • Improved the Particles action. Now the Particle measurements are transferred from the “Results Table” to R which means that now all values from a stack can be transferred, too.
  • Added a new action to transfer all stack images of an opened stack (also from a nearly non memory consuming virtual stack) to R.
  • A new option is available to convert the stack images to a RasterStack (if the “raster” package is installed).
  • With this action it is also possible to transfer R,G,B values from all slices (images) of a stack, too.
  • Improved the ImageJ image to R API to create matrices from transferred image values.
  • Created an new API method to transfer particle analysis values programmatically.

ImageJ

  • Improved the display. The default image layout now works better after a resize event.
  • ImageJ tabs can now be detached like an image window (see below).

detachedviews

  • Added some improvements for external ImageJ plugins.
  • Updated ImageJ to the latest version.
  • Added more image examples from the ImageJ website.
  • The size of the “Image-Methods” view and the ImageJ toolbar dialog can be adjusted in the Bio7 preferences.

Table

  • Improved the table editing in the “Table” view of Bio7. If you now edit a value and press the return key automatically the next cell is selected for editing (arrow keys for left and right, Tab key for selecting the upper cell).
  • Now the table scales if you paste values or if you transfer vector values from R.
  • The scrollbars now follow the location of the next edited cell.
  • The sheet tabs handle is now located at the bottom of a sheet.
  • The speed of the table component has been improved.

Video:

Java

Video:

  • Embedded the SceneBuilder panels as Bio7 views.
  • Created several new Java wizards to create Bio7 projects, JavaFX projects, etc. in Bio7.  They are creating a Bio7 JDT project with all necessary Bio7 classpath libraries. In addition a wizard for a WindowsBuilder project is available, too.
  • Bio7 is now compatible with the most Eclipse plugins which can be installed with the Update Manager of Bio7 (see “General” section below).
  • Improved the compilation which now can detect main classes organized in Java packages.
  • Added a new action to fix the JDT classpath (also invoked if a Bio7 JDT project gets imported). This is necessary to recalculate the JDT library paths for a local Bio7 installation.
  • Hid unnecessary GUI elements from JDT.
  • Updated all scientific and custom Bio7 libraries.
  • Integrated two new SWT libraries to create scientific components and components in general (Nebula visalization – see below, Opal).

visualizationlib

  • The Eclipse jobs API can now be used from within Bio7.
  • Ported all Java examples to JDT projects and reorganized the examples.

WorldWind

  • Updated WorldWind to version 2.0.
  • Added an option to select the ImageJ image tab for WorldWind (nice if you want to render a film with ImageJ images).
  • An RGB image can now have transparent alpha values (RGBA) which appear translucent if rendered on the globe.

HTML Editor

  • Added some actions to the editor toolbar to add Knitr templates, links and images.

General

  • It is now possible to install most of the available Eclipse plugins with the update manager of Bio7 (see below – Bio7 with WindowsBuilder installed).

windowbuilder

  • Reorganized the Bio7 preferences for a better usability.
  • Created a new CSS theme for Bio7 (Eclipse Themes plugin for a custom theme can be installed, too)
  • Addded a LaTex editor (Texlipse) to Bio7 for the use with KnitR and Sweave.
  • Added toolbar actions to start the native consoles easier (R, OS Terminal, Python).
  • If you switch from one console to another the process won’t be killed and you can resume a native session (R, Python, OS Terminal).
  • Improved the layout of the “Control” view.
  • Many Eclipse improvements like a split editor action are available by default (Bio7 is based on Eclipse 4.4)
  • Many bugfixes and other improvements.

This release can be downloaded from the Bio7 website:

http://bio7.org

Documentation and videos tutorials can be found here:

Documentation (1.7.1)

YouTube Videos

R Debugging GUI Improvements for Bio7

20.11.2014

In my last post i presented the first version of a debugging GUI for R in Bio7 which is just a visual wrapper for the default R debugging functions. In the meantime i added some new methods and also improved the visualization. For the upcoming Bio7 release i have to make some cleanups but however here is a short video showing some basic functionalities of the GUI.

Simple R Debugging GUI for Bio7

26.09.2014

For the next release of Bio7 I implemented a first simple debugging GUI (Graphical User Interface) for R scripts. For the debugging process a change from Rserve to an available Java R console connection in Bio7 is necessary (with Rserve alone a debugging interface wouldn’t be possible).
Both connections runs in the same process and all objects will be preserved if you switch from one connection to another (shutting down RServe or start R in the console).
Technically in the next version of Bio7 Rserve is started by default within a native Java R connection!

Still there is some work and testing to do but here is a short video about the new debugging interface:

Debugging With Bio7 and R

Bio7 R Documentation and Plot Examples

18.07.2014

A very time expensive process is the documentation of software you created yourself. I was finally able to update and improve the documentation for Bio7 and the embedded R “Graphical User Interface”. For the documentation this time i used Lyx to export the LaTeX document as HTML with the available eLyXer export module.

The R Graphical User Interface is documented here:

http://bio7.org/documentation/Main.html#toc-Section-4.6

The documentation to transfer images and image data from ImageJ to R and vice versa can be found in this section:

http://bio7.org/documentation/Main.html#toc-Subsection-4.3.3

I hope that this documentation will make it easier to explore the Bio7 R functionalities beside the flash videos i created.

In addition i created a new video (the first time i used Screencast-O-Matic) which explains how you can easily create a R plot with Bio7 using ImageJ as the default plot device or different available devices (PDF, SVG):