— Ashley Towers

I have spent a chunk of today figuring out how to take virtual microscopy slides from our Aperio Slide Scanner, saved as svs files, and make them viewable in a web browser. Scanscope already includes a flash based viewer, however, this isn’t any good if you don’t have flash installed or can’t install flash (e.g. if you are trying to view the slides on a phone or tablet). Aperio also have an iOS app for viewing slides, but again this is far from ideal and a bad answer to the problem. I wanted the slides to be viewable with nothing more than a modern web browser.

After some digging around it appeared that it should be possible, I found:

  1. OpenSlide - a C library that was able to convert between proprietary SVS files and a number of open tiled image formats
  2. OpenSeadragon - an open source and pure Javascript viewer for zoomable images.

However, knowing all the parts were available was one thing; getting them to work together took some experimentation! So this post is the distilled version of the steps that got everything working together for me.

All of these steps assume you are working on a Mac and work as of today (15th Jan 2014). You might be able to get use them as inspiration for other platforms but you’re on your own!

Install Homebrew

If you haven’t already got it, install Homebrew I believe the packages below are available via MacPorts but I haven’t verified this.

Install VIPS

The first step is to install VIPS. VIPS  is a command line image processing utility that is able to use OpenSlide and will handle the image conversion for us. To install it fire up a terminal and execute the following command:

brew install https://raw.github.com/jcupitt/homebrew-science/3fda4568544a67743b2a880ad1c5f844b4ff3515/vips.rb --with-openslide

This will take quite a while as it builds and installs VIPS and all its dependencies. If you have any problems, the full VIPS build/install instructions are available on their Wiki.

The next step is to use VIPS to convert the SVS image in to a format that OpenSeadragon can understand.

Converting SVS to DZI

To convert your SVS file to a DZI file execute the following command:

vips dzsave /path/to/your/image.svs /path/to/output/directory

For example running the following:

vips dzsave ~/mucocoele.svs ~/webMucocoele

Will create a file called mucocoele.dzi and a folder called mucocoele_files. Both of these are required.

NB if your source svs image is large this conversion can take a long time!

NB.2 if you receive a “VipsForeignLoad” error then you probably didn’t include the “–with-openslide” parameter when installing VIPS. You’ll need to brew uninstall it and rebuild including the parameter.

Putting your image on the web

With your DZI file and folder of tiles created, the next step is to get them on the web.

  1. Create a folder in a public folder on your web server (e.g. in htdocs)
  2. Copy both the .dzi file and _files folder you created with VIPS in to your newly created folder
  3. Follow the instructions on the OpenSeadragon getting started guide to create a simple html file remembering to substitute the name of your dzi image file in to the tileSources parameter.
  4. Fire up your web browser and navigate to the page!
  5. Bask in the glory of Microscopy slides on the web!

If you’d like a quick start, I have produced a very simple self contained working example which you can just drop in to your public web folder which is available here: Zip File or Github

Hope this helps!

Read More

I quite enjoyed this post by Vu Tran at Framebase  about the quickest programmers being the quickest to break out their search engine. It got me thinking; the principle of DRY – Don’t Repeat Yourself is well known. Only have one representation of any rule or truth in your code. Don’t copy and paste. If the world changes, and it frequently does, you only have to update this in one place. Good practice, bordering on basic common sense, and pretty much followed by every programmer worth his salt.

However, there’s a tendency amongst (some – not all!) programmers to reinvent the wheel; to write their own solution to already solved problems. This is also bad. Who knows, maybe even worse? To my knowledge this doesn’t have a pithy acronym. So, I propose for your delectation: DROP. Don’t Repeat Other People.

Don’t reinvent the wheel. Use pre-existing libraries; ideally use open source. There are often situations where an existing library doesn’t quite do what you want, but surely it’s better to add this functionality to an existing, battle hardened, code base than it is to start again? After all, you’ll have to re-implement the basics before you even get as far as writing your “special” bit. Use the hard won experience and lessons of the library developers to your advantage, then stand your special case on top of that.

Read More

This post is a reworked version from my now deceased Posterous blog.

As the title suggests, this is how I got Passenger installed on Ubuntu 11.10 with RVM (with 1.9.2). Hopefully this will save you the numerous blind alleys I went down.


I was getting the following error:

Checking for required software...
GNU C++ compiler... found at /usr/bin/g++
Curl development headers with SSL support... found
OpenSSL development headers... found
Zlib development headers... found
Ruby development headers... found
OpenSSL support for Ruby... not found
RubyGems... found
Rake... found at /home/ashley/.rvm/wrappers/ruby-1.9.2-p290@portfolio/rake
rack... found
Apache 2... found at /usr/sbin/apache2
Apache 2 development headers... found at /usr/bin/apxs2
Apache Portable Runtime (APR) development headers... found at /usr/bin/apr-1-config
Apache Portable Runtime Utility (APU) development headers... found at /usr/bin/apu-1-config

Some required software is not installed.
But don't worry, this installer will tell you how to install them.

Running the suggested “apt-get install libopenssl-ruby” as root didn’t work for reasons that can only be attributed to spite. The ususally successful Google-the-error approach didn’t work either.

Read More

This post is a reworked version from my now deceased Posterous blog. It’s been reproduced here because I like it :-)

When I posted the following tweet it proved to be a little more controversial than I was expecting: http://twitter.com/ashleytowers/status/16922598763

“If you can’t explain your product in one tweet it’s a) Too complicated b) Lacks Focus.”

I see a tweet as the modern elevator pitch. I’m sure you all know what an elevator pitch is – a short description of your product/service/whatever that you could reel off within an elevator journey should you ever find yourself in an elevator with someone influential. In the modern era when attention spans are at an all time low 140 characters should be ample to get the core of your product/service across. I’m not suggesting a full description of every little feature – but I believe if 140 characters isn’t enough to get across the gist of your project then you won’t have the focus your product needs. This concise definition is your product’s soul – it is the core definition that lets you instinctively *know* if you should add a feature or not. If a feature doesn’t fit in with or enhance this short definition then it is questionable as to whether it should be added.

The Space Shuttle: “A partially reusable manned space launch and reentry vehicle” 60 characters

Twitter “A web site that lets people post short update messages and receive updates from others who they find interesting” 112 characters.

The ability to define your product concisely keeps it focused on what matters – Twitter doesn’t need comments, the ability to post longer updates or share photos. They don’t fit in to that core definition – they add weight in the same way as adding a bidet to the space shuttle.

Read More


Thanks for reading. You’re awesome; you really are. I’m going to have another go at blogging. My other blog http://www.usabilityfriction.com is lying somewhat unloved. I want to write stuff for it, I really do, but theres other things I want to write about; things that bother me now and UF as a single purpose site doesn’t really facilitate that.

So the idea is that this personal site will let me get these other things off my chest, share some of the things I’m working on and maybe even unblock the pipe that is denying Usability Friction new content. We’ll see…

To kick this blog off I want to retrieve some content from my now deceased Posterous account, so please put your feet up and enjoy some vintage musings. Maybe think of these next few posts as the Dave re-runs. The new stuff will follow – I just think some of them are worth keeping…


Read More