Saturday, January 28, 2012

Filmcrop

This week has been all downtime due to family reasons. With little to do but wait and without access to the Internet (I really should look up those mobile Wifi router thingys from E-Mobile and B-Mobile) I've had plenty of time to fill up with something.

That something is filmcrop.

I use film cameras quite a lot, and scan the developed film for posting online. But while scanning software is good at the scanning itself, they're usually quite painful to use for anything else. In particular, VueScan, the software I use, is unable to automatically find and crop the individual frames from a scanned film strip, and manual cropping is slow and error-prone.

So I've written a small utility called — imaginatively — "filmcrop", that takes a set of scanned film strips and tries to crop them into individual frames. Scan the film strips all at once, then filmcrop will find the probable spaces between the frames and crop them all into same-size images for you.

Crop Illustration
Filmcrop in action.

It is a very early version. It only works on positive films for now; you have to reverse your scans first for negative films. I've only tested it on one single roll of slide film — that's all I had to test on this laptop — and it's likely to fail in interesting ways once I start using it for more scans.

Filmcrop uses Ruby and RMagick, the Ruby bindings of ImageMagick. It runs fine on Ubuntu 11.10; it should work fine on other Linux systems too, but I don't know how to make it work for OSX or Windows.

You can find the latest version — 0.1 right now — of the script on the Filmcrop page on Github. If you find it useful, if you have ideas for improvement or if you've found a bug, please drop me a line at jan.moren@gmail.com.




Wednesday, January 18, 2012

US Forbids Open Access Publishing?

Library

There's a proposed law in the US to prohibit researchers paid with public money to, well, make the results available to the public. They would not be allowed to publish in Open Access journals or to submit to public-access repositories. And not surprisingly it is slimeball companies like Elsevier (you know, the charming guys who created fake medical journals so pharmaceutical companies could push made-up data in support for their products) and Wiley Publishing that are behind it.

I've said it before, but I will no longer publish anywhere that is not Open Access. OK, if you look at my publication record that's not exactly a threat of earth-shaking significance. But I will also no longer review papers for closed journals. I do review quite a lot of papers; it's fun and it's a good way to stay abreast of a wider range of subjects. And publishers depend critically on a good supply of reviewers to do their (unpaid, unacknowledged) work.

I will — I already do, to some extent — make a point of using Open Access sources for citations and other resources when I can. I've said before that there's two kinds of citations in your papers. A few are central to your own work, and pretty much unavoidable. But most papers are really about establishing background for your work and give references to general knowledge, and there you often have any number of papers to choose from. The same group may have half a dozen papers that all cover the point you want to make, there may be several groups all working on the same thing, and any of them would be fine as a general reference.
 
I will make a special point of not dealing with Elsevier in any way, shape or form. Which leaves me with one issue: I'm a member of the Japanese Neural Network Society. I need to be a member to be able to attend and publish in their conferences and meetings. They have a Japanese journal of their own, but also co-publish an English language journal together with the European and International societies. Published by, you guessed it, Elsevier.

Resigning from the society is unproductive, and feels like overkill. I'm not dealing with Elseview when I'm going to a conference or something after all. As I'm not Japanese1 and just a simple post-doc I have zero clout in the society, protesting a long-standing publishing arrangement is futile. What I will do is simply ignore the English-language journal. Not publish, not review, and, where feasible and honest, not reference. Should not be too difficult as I have yet to do either.

Remember, while this suggested law is recent and US-centric, the instigators — the for-profit journal publishers — have been fighting to stay gatekeepers of research across the globe for years. It is a very profitable business, and they have shown there is little they would not do to stay in it no matter how much it hurts science, the scientists who they depend on, or the public that pays for it all.

#1 It's a question of language. Your ability to convince others about a controversial position is tightly coupled to your ability to make a strong rhetorical case. As my Japanese is barely usable I am unable to make good, coherent arguments, fully understand voiced objections, or formulate convincing answers.

Monday, January 16, 2012

Sunday

Yesterday I spent most of the day writing a tool that takes a scanned film strip and automatically crops it into individual frames. It mostly works, but needs some refinement; an option to make all cropped frames the exact same size would be nice, for instance.

Towards evening we went out for a walk, then had omuraisu for dinner at Hokkyokusei. Popular place with tourists but the omuraisu is really good, so who could blame them? Back at home we had coffee and strawberries while watching a TV drama.

This, too, is happiness.

Hokkyokusei

Monday, January 9, 2012

Badger Problems?

Library

The title in this recent paper in PLoS One says it all, really: Effectiveness of Biosecurity Measures in Preventing Badger Visits to Farm Buildings. What is a paper on badger control doing in a highly respected science publication?

For one thing, it shows us an important fact about science: Science is a method. It is not about what you study, but about how you study it. Preventing badger incursions is legitimate science when you go about finding out in the proper way.

What is that proper way? There's many descriptions out there, focusing on philosophical or practical aspects. But the gist really is that you find answers to questions without getting fooled — fooled by bad data, fooled by badly posed questions or fooled by your own biases and expectations. It boils down to making sure that your results are real, not an artefact of noisy data or influenced by what you wish were true.

This paper is a well-done bit of science, and it also addresses a real problem. Badgers visit farms, presumably to find stuff to eat, and when they do they can infect the cattle with a version of TBC. Badgers and cows don't come into direct contact very often, so the disease probably spreads indirectly, through badger faeces and urine. Stopping badger visits seems like a good idea.

But farms are big and badgers are small. Stopping them altogether is difficult and expensive. It would be great if you could use simple ways to just keep badgers out of the cattle feed storage, where the risk of spreading infection is greatest. But you also want to know what happens if you do that. Say that you stop badgers from getting into the feed but the badgers simply spend more time where the cows sleep instead, then you may have gained nothing.
 
The authors set up surveillance cameras on a number of farms. For a whole year they simply recorded the number of badger visits to various areas on the farms. Then they picked farms with badger visits (not all of them had a badger problem) and divided them into three groups: One got badger barriers around the cattle feed area; one around the sleeping area and one got both. Spend another year recording (and analysing all those those hours of recording must have been painful for some poor graduate student) then analyse the results.

What did they find? All barriers were effective in reducing badger visits, and barriers around one area reduced, not increased, visits to other areas as well. Barriers around both areas were most effective, but the feed area barriers were almost as effective.

Think of what they did to get to that result. They decided at the outset what question to ask and what would be an acceptable kind of answer. They first just recorded visits so that they'd know the baseline of visits, and they spent a whole year doing so, since the badger frequency likely changes over the seasons. Then they changed things systematically — add barriers to one, other or both areas, covering all possibilities — and recorded for another year.

And they were careful to set precise criteria for the recording and analysis beforehand — what does and does not count as badger visit, what to do with the data if a camera doesn't work part of the night, if a barrier was down, that sort of thing — so that their own expectations wouldn't influence the analysis. They were careful to use statistics to find out how likely the changes they saw were real and not just due to chance.

Whether you're looking for badgers or bosons, it's this painstaking attention to remove errors, uncertainty and biases that makes it science.


Thursday, January 5, 2012

PhD at OIST on Okinawa

OIST — Okinawa Institute of Science and Technology — is looking for PhD candidates for next year.

Briefly, OIST is a new, graduate-level research institute on Okinawa, Japan. The labs range from neuroscience to math to physics to chemistry, but the work is very interdisciplinary. Up until now they have been "just" a research facility as they've been building up the organization, but from this year they are accredited as a graduate school.

They aim for a very international research and graduate student body, and all teaching and interaction is in English. About half of the staff is non-Japanese and I believe the aim is to have the same kind of proportion among students as well.

I was a tutor at the OCNC summer course on computational neuroscience last year. The facilities are very good, and there's a wide variety of research going on. The summer school itself is very high quality.

The one possible drawback with OIST is that the location is decidedly rural. Even grocery shopping is a chore without a car. On the other hand, it gives you plenty of uninterrupted time, and the location is excellent if you happen to be into diving or snorkelling.

If I were a budding graduate student, I'd grab this chance without second thoughts.

Patch Clamp
Patch clamp microscope at OIST. I was going to add a scenic picture here, but in all honesty, you're more likely to stare at something like this all day long than at any tropical island view.

Tuesday, January 3, 2012

2011 Pictures

Here's my pick of pictures from last year, with one picture per month. Well, more or less; with film scans I often don't know or remember the exact date a picture was taken. Each image is at least guaranteed to be close to the intended month. Also, I still have rolls from December still waiting to be scanned, so the selection for the last month is a bit limited.

January

EEG
EEG recorder demonstration. Lots of work throughout the year, and frustratingly little tangible progress. That happens.

February

A Fossil
Valentine's day, and Ritsuko gave me the single most amazing Valentines chocolates possible. A white-chocolate fossil, covered in chocolate gravel and hard chocolate crust, with actual tools — spoon, brush and hammer — to dig it out myself. Blog post with the whole series of pictures: Jurassic Chocolat.

March

Umeda Back Street
March was a bad, bad month for a lot of people, with a millennium-level disaster hitting northern Japan. Osaka was not physically affected but of course a disaster this scale has profound effects on the entire country. Here a side street in Umeda, chosen in part because of the mood.

April

Kita
Kita-kun of American Shokudo. Spring is coming and it's finally getting a bit warmer at night.

May

Ishigaki Harbour
We went to the Yaeyama islands in Okinawa for the Golden week holidays. The sea and the views are fantastic, though the weather was more than a little unsteady. This is Ishigaki harbour at dusk.

June

Argument
June, and I'm back in Okinawa, but this time at OIST and this time for work. I was tutoring the OCNC computational neuroscience course. Here a tutor and a student in an argument.

July

Have A Seat
Mikage station. On our way for a birthday dinner on Rokko mountain.

August

Hipster
Hipster on the phone, with a fan to cool off in the peak summer heat.

September

Coffee Break
Maiko in shouchikuza theater, Osaka. If you've never gone to see Kabuki, do take the chance if you can. It's a lot of fun.

October

Psychedelic
Very little time for anything this autumn. Here a quick phonecam snap of a moth on a grating on my way to work. The color is authentic; the intensely blue morning sky is reflected in the grating.


November

JR Umeda Station
We take a walk around the recently opened JR Umeda station. Impressive building.

December

Uniqlo Christmas
The Uniqlo flagship store in Namba runs a Christmas-themed color scheme.