Friday, October 14, 2016

How to read things without opening them

Brent Seales is a professor of computer science at the University of Kentucky. He drives several very cool research programs in areas ranging from robotic surgery to advanced image progressing.

Recently, the Economist (one of my favorite weekly reads) featured some of his work. Here's a link.

How to read an old scroll without opening it



Tuesday, October 11, 2016

iCite and W2P ratios - new ways of quantifying scientific productivity

What's the best way of ranking scientists based on their productivity?

There are lots of options including:
  • number of publications
  • number of citations
  • impact factor of the journals the publications are in
All have strengths and weaknesses.

Recently, leaders at my academic institution have started to talk publicly about h-indices. These are calculated for each author as the number (x) of publications he/she has that have each been cited at least x times. That's an interesting idea because it rewards impact; people who publish lots of papers that nobody cites have lower h-indices than people who publish a few manuscripts that are very influential. However the h-index has the drawback that it grows with time (because people publish more papers and they have more time to be cited). This means that it favors seasoned scientists who have been productive for a long time. It's not a great way of identifying a rising star.

I don't think that there will ever be a single perfect metric that scientists can use to quantify productivity but I was excited to see that NIH is supporting the Relative Citation Ratio with their new iCite tool.

The Relative Citation Ratio (RCR) is an article level metric that quantifies scientific influence. To quote a help box from iCite, "It is calculated as the cites/year of each paper, normalized to the citations per year received by NIH-funded papers in the same field."

The Weighted RCR is the sum of the individual RCRs for a group of papers.

This creates an interesting opportunity. If you calculate the ratio of the Weighted RCR to Total Publications (I'll call it W2P) you get a single value that defines the influence of a collection of papers.

If your W2P is greater than 1, your papers are more influential than those of your NIH-funded colleagues. If it's less than 1, your papers are being cited less often than average.

WtoP doesn't scale with the number of papers you publish so it shouldn't depend on the length of your career.

Only time will tell how scientists use these new metrics but I am going to make a bold (and probably rash) prediction. Since NIH is supporting RCRs, I think that they will take over from h-indices as the mostly commonly used measure of productivity in US biomedical science.

For the record, here are my current stats
  • 46 publications
  • h-index = 22
  • Weighted RCR = 59.98
  • W2P = 1.34
and for the truly nerdy

Monday, September 5, 2016

The Pentium Bug

I remember the Pentium Bug in 1994 (I had just started my PhD) but didn't know enough about scientific computing to understand the significance.

Here's a fascinating blog post from Cleve Moler describing what happened.

Saturday, September 3, 2016

POVRay sarcomeres - final touches

This post tidies up some loose ends about making movies of muscle sarcomeres in POV-Ray. I blogged earlier about

Putting all these techniques together allowed me to render an image of chain of sarcomeres.

The most difficult part here was defining the geometry and making sure that I was drawing each object in the correct x,y,z location. I automated this process using MATLAB. The whole scene is made up of spheres, cylinders, and boxes. A few objects are merged together as blobs.

Once I had that working for a single image, I just moved the camera around the scene until I had a sequence that I thought looked interesting. Then I rendered the images (it took a few hours on my PC) and stitched the sequence together to make a movie.

Here's the final result.



I am happy to share the code but it may take me some time to get it posted online. If you want to get it sooner, just send me a note via a comment below.

Thursday, August 25, 2016

How to learn to code?

Coding (perhaps like most things) is all about perspective.

My academic appointment is the Department of Physiology in the Medical School at the University of Kentucky. Only a few people in the department know how to program and, as a result, most of my colleagues think I'm 'pretty good with computers'.

My collaborators in Engineering and Chemistry across the street are always polite but think I code like a Geico Caveman.

Why do so few physiologists code? I used to think it's because biomedical scientists didn't think it was useful but I've changed my mind. I now think that our students don't code because they've never been taught. They've typically taken lots of courses in biology, chemistry, and genetics, but nobody has shown them how to write code, or how to break a task down into little steps so that they can create an algorithm.

What's the best way of helping these students get started?

I've blogged about how I  learned to program before but my advice won't work for everybody and I'm always looking for new resources that I can tell students about.

Today, I came across the MATLAB OnRamp. This resource has actually been around for several years but I hadn't seen it before and it looks interesting. If you have any experience with it, or can suggest better ways of getting started in scientific computing, please share your thoughts in the comments below. 


Monday, August 22, 2016

Filtering binary images by object size in MATLAB

As usual, I learned something new when I read Steve Eddin's latest blog post.

This time around, I discovered that MATLAB has some new features that make it easy to filter binary objects based on their size. There were, of course, old ways to do this but the new bwareafilt command (at least, new in MATLAB 2014B) simplifies some workflows.


Sunday, August 21, 2016

POV-Ray animation

This post continues my introduction to generating images and movies using POV-Ray.

In the last post, I showed how to render a simple scene. Now I am going to show how to animate it.

POV-Ray includes a lot of options for animation and this page provides some great tutorials and examples. However, I have always found it easier to generate animations by automatically generating different *.pov files and then rendering them as part of my workflow.

The last part is easy because you can call POV-Ray directly from the command line. (See here for many options.)

For example, once you are in the directory that contains the main POV-Ray executable, you can produce a PNG file that is 340 by 280 pixels from the scene described in c:\temp\out.pov using this command.

pvengine +W340 +H280 c:\temp\out.pov /exit

Here's some MATLAB code that will spin the camera around the previous image.

function povray_animation

r = -25;
no_of_points = 50;
x = r*cosd(linspace(0,360,no_of_points))

for i=1:no_of_points
    
    pov_file = fopen(fullfile(cd,sprintf('out%.0f.pov',i)),'w');
    fprintf(pov_file,'#include "colors.inc"\n');
    fprintf(pov_file,'background {color White}\n');
    fprintf(pov_file,'camera {location <%f,25,25>\n',x(i));
    fprintf(pov_file,'\tsky <0,0,1>\n');
    fprintf(pov_file,'\tlook_at <10,0,0>}\n');
    fprintf(pov_file,'light_source {<%f,25,25> color White}\n',x(i));
    fprintf(pov_file, ...
        'cylinder {<0,0,0>,<10,0,0>,1 texture {pigment {color Red}}}\n');
    fprintf(pov_file, ...
        'cylinder {<0,0,0>,<0,10,0>,1 texture {pigment {color Green}}}\n');
    fprintf(pov_file, ...
        'cylinder {<0,0,0>,<0,0,10>,1 texture {pigment {color Blue}}}\n');
    fprintf(pov_file, ...
        'sphere {<10,10,10>,3 texture {pigment {color OrangeRed}}}\n');
    fclose(pov_file);
    
    cd_string = 'cd c:\program files\pov-ray\v3.7\bin';
    command_string = sprintf('%s\npvengine +W340 +H280 %s +A /exit', ...
        cd_string, ...
        fullfile(cd,sprintf('out%.0f.pov',i)));
    batch_file = fopen('pov.bat','w');
    fprintf(batch_file,'%s\n',command_string);
    fclose(batch_file);
    system('pov.bat');
end

It's now easy to stitch the *.png files together to make a movie.