Coding

R

Use R and support open source science!

Recently I have been using R for much of our data handling and analysis.

I am also interested in encouraging graduate and undergraduate students to adopt computational analytical skills early and strongly encourage them to learn how to code. I have started an informal coding group for biology students in the department who want to get started using R.   Please see the following site:

https://www.facebook.com/groups/1011582272248163/


I also maintain scripts for analyzing data in my lab on the programming website github:

https://github.com/gtatters

All scripts written here are used in the normal data analysis in my research laboratory. They are provided here for ease of access to my students and to facilitate updates.

If you are interested in using or improving these scripts, feel free to do so. At present, they are not very transferrable, being written with a particular problem in mind.


I have also made an on-line software tool using Shiny in R that helps perform the simple calculations used in an instrument in my lab that calibrates gas flow meters:

https://gtatters.shinyapps.io/FlowRateCalibration/


I have also developed a package for R, called “Thermimage”, which is really a collection of functions to assist in some of the nitty gritty calculations involved in thermal imaging.  Some of these are related to a desire to get thermal images converted into a structure that can be analysed in ImageJ (not quite there yet), but the functions have allowed me to streamline various correction factors that should be applied to thermal image analysis.

https://cran.r-project.org/web/packages/Thermimage/index.html

I have included a simple “tutorial” for Thermimage on github:

https://www.github.com/gtatters/Thermimage/

If you do get into trying to model your heat exchanges, maybe read through this link:

https://github.com/gtatters/Thermimage/blob/master/heatcalc.pdf

Working with FLIR’s software can be a challenge.  It is powerful for certain, but not suited for biological applications. It is also only available for users of Windows (FLIR has no useful Mac OSX alternative despite the heavy prevalence of Macs in Academia: hint, hint).  Software updates cost thousands of dollars and often crash (I spent $5K on Researcher R&D software, which could only run on one machine, eventually crashed and would not operate on a 64 bit OS).  So, for biologists on low budgets, if you are able to borrow a thermal camera to capture images, how do you analyse them without sacrificing a limb?  Solution: convert them to a file format that can be analysed with open source image analysis (ImageJ) which is far superior to the FLIR software anyway.  If you have a FLIR jpg, try this script out to convert your files into .csv, .png, or .pdf files to import into imageJ:

https://github.com/gtatters/FLIRJPGConvert/blob/master/FLIRJPG_Convert.pdf


ImageJlogoFIJI

We also work with open source image analysis software, such as ImageJ, to analyse videos (image stacks) or import thermal image text files.  Having access to the array of open-source plug-ins offered from other scientists is a an excellent resource.

The easiest way to facilitate access to all the latest plugins is to install FIJI, which is a wrapper for ImageJ with all the custom add-ons.

Not everything you need is installed in FIJI.  We have been importing text image files (csv files that are simply a c x r dimension matrix of temperature data that can be viewed in Excel numerically, or imported as an image into ImageJ/FIJI.  To do this, you have to install a custom batch macro.  Here is brief video tutorial showing how to install the custom macro to your start-up macros for easier access:

Once installed, you can now import a folder full of images for analysis of temperature (ImageJ calls these intensity values) as follows:

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s