As part of the 2018 CCI Imaging Workshop, I ran a guided hands-on about using Fiji for Image Analysis. The workshop was aimed at complete novice and intermediate level users. The slides and materials were delivered through a web browser using the Reval.js framework, and this post will be a few more details on that framework and how (and why) I think it’s really useful for this sort of thing. Let’s get revealing!
I’ve seen browser-based presentations before at the OME users’ meeting and also from the LOCI group (chiefly Ellen Arena and Curtis Rueden). When others are fiddling with arcane adaptors and worrying about movies not playing, they roll up, open a web browser and go. It sounds silly but it’s impressive to behold something that just works.
So what is it?
The problems with running workshops
Here are some of the problems I’ve had (or seen people experience) with workshops in the past:
- I can’t keep up! Everyone goes at their own pace, and if the presenter is going too fast, not everyone is comfortable putting their hand up and asking them to slow down. It’s so easy to miss instructions, references or code examples.
- I can’t see! Many computer labs are not designed for everyone to be able to see the teaching screen well and some people’s eyesight is not great.
- I can’t get to the workshop! Regular listeners will know I love Live Tweeting, and one of the reasons to do this (the less selfish one) is to make conference content open and accessible to people who can’t get to meetings (parents on leave, people whos funds don’t cover travel or accommodation to get to conferences etc). If slides are ever distributed it’s often as a PDF after the fact to attendees.
- I can’t type fast enough! Related to the first point but a particular problem with coding workshops. The presenter does a live demo writing out some code, expecting the class to copy down and play along. Problem is, you make one typo and you’ve scuppered your function/code/script. Boo.
- MOAR USB KEYS: Image Analysis workshops especially, require training material. How do you get this to people? Email it ahead of time? Pass USB keys around? dropbox? Network shares? I’ve suggested bit-torrent for big datasets before, but all these come with technical challenges and hand-holding through unzipping, mapping shares etc.
One possible solution
I was interested in Reveal.js as a way to solve a lot of these problems. I’ll try to give a brief walkthrough of how I built the presentation and this should highlight where some of these problems are solved.
git clone https://github.com/hakimel/reveal.js.git .
You’ll end up with a few folders and a few files:
Version controlling your nascent presentation is an excellent idea. Go read this post and come back when you’re ready.
Your whole presentation will be a single html file.
Index.html is a boilerplate from which you can build your presentation. There are code examples in
demo.html and also loads on the repo website.
Making it mine
Below are some ways that I adapted the original framework to make it look like the final thing:
There are basically only two files that I edited to create the slides. The first was to define a custom CSS style for my slides. I already have slide templates and a font that I use for CCI presentations, so I wanted to replicate that as closely as possible. I copied the
white.css file found in
css > theme to a new file (
cci.css) then started tweaking the colour scheme. The typeface and the new theme are specified in the HTML file inside the head section:
Each slide in the HTML document is demarcated by the <section></section> pair. To add a new slide, add a new section to the document. One of the cool things about the section tags is that you can next multiple sections within each other which make vertical slides. Lots of people like these for logical grouping and easy navigation. I chose to remove the navigation arrows on my slides so I decided against using vertical slides (apart from for one aside).
If you’re used to making powerpoint or keynote presentations, this is probably where Reveal.js is going to seem clunky and awkward. If you’re used to writing HTML and designing websites, this is going to be a snap. You need to think of your slides as boxes into which you can align other boxes of relative width. In CSS you use something called a
class to describe a rule that you want to apply to everything with that class. I don’t remember which ones are built-in but I defined each of the following classes (except the top one which is the default size if you specify no class).
The basic elements that I used in my slides are:
<p>: Paragraph : A general purpose block of text. Useful for adding an explanation or point.
<ul>: Unordered list : Bullet points for instructions or steps the attendees have to follow (also
<ol>for numbered lists)
<img>: Images : loads of these in the presentation and in some cases, more complex layouts and schematics are easier to create in inkscape or screen capture from an existing presentation.
The point here is that all of these elements can have any class added to them to get your layout right. Below is an example of
half unordered list and
The code looks like this:
<ul class="left half"> <li><code>[Image > Crop]</code>: Reduce the canvas size to current area selection</li> <li><code>[Image > Duplicate]</code>: Duplicate the selected window/stack or selection</li> <li><code>[Image > Rename]</code>: Change the title of the window</li> <li><code>[Image > Scale]</code>: Scale the image pixels up or down (calibration is also scaled)</li> </ul> <img class="third" src="img-ia/basics_01.png"/>
The other three classes I used are
clear to deal with floats which I will say no more about here.
There are loads of cool features of Reveal and plugins written for it that are nice for workshop presentations. I included a the slideout menu from Greg Denehey, slide numbers, fragments (which are like animations for making parts of the presentation animate) and my ‘master’ elements (my twitter handle, UoL and CCI logos) using absolute positioning. Getting a title on each page is a bit of a hack but it seems to work well.
I’m of two minds about how well this worked. I made a folder called materials in the repo and put the images I’d need for the workshop into that folder. I then hyperlinked to the files in the relevant slides. I explained to people that they can either use the URL (see pros below) to open files or save them to a folder and drag them in.
- You can provide links right where the user needs them. No more guesswork about which image is the one you should be working on
- You can import directly into memory using the
[File > Import > URL]option in Fiji
- No need to download the datasets ahead of time. You have them right when you need them.
- Instant update: If, mid workshop you find you need to update a test image, you can do that then ask everyone to access it again!
- Images opened with the URL option have some problems:
- Anything that can be opened by a web browser will be, instead of offering the files for download (IE PNG files will simply be displayed, although this is not a problem if you use the URL method)
- Anything done with multiple files (IE a batch processing or stitching walk-through) requires users to download an archive then unzip it. Not difficult but it’s extra steps.
- Not realistic for huge files or datasets (eg Multiview Reconstruction)
Overall, I think the ease of content delivery out weights the slight awkwardness.
Running the workshop
Somewhat predictably as I ended up using it, all of the problems mentioned earlier are solved or at least tempered using Reveal.js for a workshop. Indeed most of the issues are solved by the users having a copy of the slides open on their own PC during the workshop (something you can do if you’re organised enough to share your slidedeck, the users have the right software, are on the right platform etc). Some other really nice features of Reveal.js:
- If you’re using code examples, people can copy paste them directly from the web page. No more typos!
- The same way you can deliver test data you can also hyperlink to anything else, scripts, library files, plugins etc.
Given a bit of twitter promotion, people can always play along with the slides from home, although there is lots of content that is delivered by the presenter that you do not have access to without the slides. Perhaps I’ll sort out a live web stream next year?
The one thing that has not been mentioned here is the requirement to know a bit of HTML/CSS to put together your slide decks. I’ve written a few websites, and when I do so, it’s always using Notepad++.
The problem is, like any markup language, you quickly lose it if you don’t practise. Using HTML/CSS kung-fu for something other than websites is a great way to keep your skills honed!