Monday, October 24, 2011

Illustrating on the iPad

Yes, it is white with a pink cover, and I put it on the boxer.
I finally caved in, or rather my better half did. Now I have an iPad (Ho, Ho, Ho). It's not a machine-gun but affords some other, equally amazing, possibilities, you can surf in bed, surf in cafes, and you can even surf on the loo. Amazing, I say! What I really want it for is drawing. For research-articles there is seldom any real use for drawing, but when writing reviews, presentations, and when teaching, it is indispensable.

Different lecturers and teachers have different approaches, and different students require different teaching strategies, but everything gets better with good pictures. For review-articles and formal presentations you need high quality illustrations, while for teaching I find it better to draw live, so that the students can follow along. There is of course some middle-ground, students that need original data and high-quality illustrations that they get hand-outs of, and formal presentations that can include free-hand drawing.

Anyway, these two ways of working need somewhat different programs, or Apps, as I have understood they are called. Before we start drawing however, one does need an implement. I got the stylish aluminium stylus from "Just | mobile". It has a solid feel, looks stylish (oh, no I said it again), and... well that's it really.

Now, to the actual drawing. Let's start with free-hand drawing that you can use just to show things. There is a multitude of simple drawing programs for the iPad, and you can also use a more advanced application for your quick sketching. The one I got was Bamboo Paper from Wacom (that otherwise makes professional digitisers).

It has three features I like,

1: It organises drawings by notebooks. That means that all drawings and notes from one lecture is automatically connected. They can even be exported directly as a multi-page PDF for use as hand-outs.

2: When connected to an external screen it just shows the drawing area. The controls are only visible on the iPad.

3: The interface is really simple. You can draw, erase and undo/redo. Then pen has three different settings for line thickness and six colours (well, actually three since half the colours are shades of blue).

Let us turn to real drawing and the creation of publication quality illustrations. For this you need two things: a sketching program and a line-art/vector program. The first is necessary because that's how you, or at least I, develop and refine the concept. The second is what constitutes "publication quality", i.e. freely scalable line-drawings that can be output as EPS or PDF, depending on your publisher.

I found two programs for each function with slightly different capabilities. For sketching I got SketchBook from AutoDesk (the maker of AutoCad) and ArtRage. These are two very different programs. Artrage was created to simulate working with real media. You have a wide choice of paper and canvas variants (and can change after the fact), and an equally wide range of simulated media; from   pencil to oil, water-colour and inks. The amazing thing with it is that it simulates how these media behave in the real world. Oil-colour mixes on the canvas, and water-colour bleeds.

Three examples from Artrage, oil and water-colour with photographs as originals, and a pencil sketch of Madicken sleeping in the office chair.

As a bonus it has a well designed ability to work with layers so you can put the sketch, background colour fields and shadows & highlights on different layers and work with them independently. It even has a special layer for a photograph or some other image you want to use as basis for your work of art. The interface is very clean, and at the same time powerful. There is a implement selector in the left corner and a palette in the right, if you leave them open they are single click interfaces. To say that I am happy with Artrage would be an understatement. It is an achievement in programming and design. I may never use paper again.

SketchBook is more of an honest computer drawing-program and has all the usual things, pencil, brush, air brush and so on, but it doesn't try to be oil on canvas. The interface is very clean and the most important things can be controlled with gestures (pencil type and colour, layer and undo/redo), but otherwise it is a two- to four-click interface. In my hands it is a lot like drawing with ink on paper. Not for absolute scale-drawing, but good for illustration purposes.

Quick concept for the two kidney, one clip model of renal hypertension made in SketchBook. I used three layers, one for the sketch, one for colouring, and one for shadows.
Something like that may be good enough, or we may want something a bit more stylised for publication. In that case we can use the sketch as a basis for a vector-based drawing. I got two programs rumored to be the best vector-Apps on the iPad: iDesign and Inkpad. iDesign is supposedly the more competent of the two, allowing true cad-like features like absolute scaling, and exact positioning and angling by numbers. However, it took me over a minute to find the undo-button. That's when I quit and tried Inkpad instead. There will be no review of iDesign at this time.

Addendum: I figured out how iDesign works. I had to make a more exact graph-like illustration, and Inkpad turned out to be completely useless since it just doesn't handle that level och precision. Even the undo/redo button was much easier to find once I figured out how the interface works. There are four extendable tool-strips, one per side, with all the frequently used commands and tools. There is a snapping-grid that increases in exactness with zoom, and can be set to scale. Each point and line can be exactly positioned by number: X, Y, height, width and rotation. Colour gradients are not as easy as in Inkpad (i.e. I cannot find it). In summary it is a CAD application on the iPad, and as such it makes you work in a more precise manner.
Inkpad just worked for me. The interface is completely self-explanatory. It does not have that many functions, you can basically draw paths and fill them. In addition filling with gradients is as easy and versatile as I have ever seen it done, simply marvelous. It is also easy to import one, or more, pictures to use as originals. Most importantly the undo and redo buttons are immediately obvious at the bottom of the page.

Using the previous image as original it took me about 20 minutes to create this scalable version with smooth lines and even gradients in Inkpad. Looks professional, is what it does. It also has no personality, but that is what is expected from scientific illustrations.
Although I have done mostly photography the last couple of years, drawing and painting were my original passions. In a fortuitous turn of events the sale of my camera allowed me to return to the original fold, with new and improved tools. The down side is that the quality of the photographs has degraded significantly.

Sunday, October 16, 2011

Pain and morphine

The ligaments and the joint capsule are very well innervated structures. That is why it hurt so much when you rip them asunder, and, apparently, after you stitch them back together. Pain, as you know, is just weakness leaving the body, and drugs make you strong. Strong drugs makes you stronger.

It is now three weeks since I ruptured my medial collateral ligament, and anterior cruciate ligament of the left knee. The ligaments are not only well innervated, they are also well endowed with blood vessels. So, after the injury my knee promptly filled up with blood. When the blood cells die and break up they release a huge amount of proteins into the joint and this will attract even more fluid by osmosis. Three days after the injury my knee was so full it was all but immobilised, and it looked more like a melon than any part of a human being. Sadly, I did not have the wherewithal to take a picture either before or during the draining of the joint. That was the first use of strong drugs, or derivatives of strong drugs anyway.

The local anaesthetic Xylocain has the innocuous ending -cain because it is derived from Cocaine. Cocaine is a brilliant local anaesthetic, which is still used in Ear-Nose-Throat surgery, but otherwise it has been superseded by variants that do not give you as much of a high. After a little dose of Xylocain, you can take a 0.8 mm needle (or thicker if you wish) in your knee without flinching.

While the acute pain was rather intense, the following week was not worse than that I could get along with only ibuprofen and paracetamol. Then I let the surgeons at my knee. That gave me the opportunity to test another drug: Propofol. It is what Michael Jackson used to sleep on, which is like killing a mosquito with a nuclear bomb. Anyway, propofol makes you sleep like a baby. The surgeons stitched up my collateral ligament and after that the real pain started, and then it disappeared. I woke up after surgery, quite groggy. A moment later I noticed that my knee hurt, and one of the nurses asked if it hurt, I said yes and they gave me morphine.

Morphine takes the pain away. It is quite amazing, where one minute you have an intense, penetrating pain that makes it impossible to think, the next minute it is just gone. At the same time it does not affect your faculties so much, at least not at the doses I have tried. Where local anaesthetics are just inhibiting the nerve transmission at the exact site where you give it, and narcosis basically makes you sleep so that you don't experience the pain, opiates directly affect the activation of the pain nerves. And only the pain nerves (well mostly).

It binds to special morphine receptors (well they are really endorphin receptors, but I always thought it was amazing that the body had receptors for drugs. That was until I realised that it was the other way around: That drugs are things we have receptors for). These morphine receptors can be found both on peripheral nerves, in the spinal cord and in the brain. At all these levels they lessen the feeling of pain. So, the painful stimulus elicits a weaker signal in your peripheral pain nerves. Then the pain nerve enters the spinal cord through the dorsal root and synapses to another pain nerve which runs up the anterolateral system of the spinal cord to the spinothalamic tract of the brain stem and then into the brain. In the spinal cord there are descending pain moderating nerves that release endorphins and makes you less sensitive to pain when you don't have the time to bother with it. It for example you are fleeing from a crocodile, or playing judo. Morphine activates the same receptors. They are also present in the brain where the sensation of pain is actually created, here their activation increases your pain threshold.

Morphine only has two draw backs: 1: It is addictive as hell, and 2: It is excreted through the kidneys, which makes it inappropriate for patients with acute or chronic kidney disease (I have heard something about opiates and breathing, the GI-tract, nausia but I never understood exactly how it involves the kidneys). The problem with addictiveness was realised hundreds, if not thousands of years ago. It was not morphine then, it was opium. Interestingly, at the turn of the last century heroin was thought to be a milder, non-addictive version of morphine. It was used as cough-syrop and even used to treat morphine and opium addiction. To say that it was a little embarrassing for Bayer when it was shown to be a faster acting, even more addictive, version of morphine, is probably true.

The addictiveness of opiates depends on three things: 1: Tolerance, or down regulation of receptor mediated signaling due to receptor activation, 2: You get high, 3: You get abstinent.

The problem for patients with kidney disease is that morphine is usually metabolised by glucuronidation  which makes it more water soluble and then it is excreted by the kidneys. Reduced kidney function increases the risk of toxicity. Luckily, my kidneys work just fine.

If you want some more reading Pubmed is good for all that boring stuff, but for your literary side I have some suggestions: Confessions of an English Opium Eater by Thomas De Quincey, available for free through the Gutenberg project. The always nice The Adventures of Sherlock Holmes by Sir Arthur Conan Doyle is a well known book with a cocaine addicted hero. I don't know of any classic literature involving NSAIDs or general anaesthesia. On the other hand pain features prominently in practically all books, it is called into action to shape and destroy characters. It is the reason they rise above their peers, and the reason they fall. The great heroes of literature (and film) overcome great pain, thus showing that all weakness has left them. Then they alone can stand up to the evil that previously was threatening the whole world.

Ok, so literature and film is not the best place to find realism, but with music and special effects it makes the days go by when your physiotherapist says you should not put too much strain the knee after surgery, even though morphine takes the pain away.

Saturday, October 15, 2011

Rise and fall of a photographer


I am selling my beloved Leica M8. The reason is that I never use it anymore. With never I mean less then once a month this year, and that is not enough to warrant the equipment. I did photography during primary and secondary school, proper film photography, even did some darkroom work. I used my fathers cameras. The Canon Canonet QL17 when he got the Canon AE1. Then the AE1 when he bought the Canon EOS5. I shot mostly birds and pretty views. During secondary school I did less and less of that and then I went to university and didn't do any photography for years.
Canon AE1 with 50mm f/1.9 standard lens. In the users guide it is presented as the worlds first whole automatic, electronic camera. That is, it had both aperture and shutter priority, and could use them at the same time in the full-auto mode. It still used film, had a manual film-advance lever and had manual focus. It was a wonderful camera.
In 2007 my mother arranged a safari in Kenya. It was obvious that I would need a good camera and that I would need time to learn how to use it again. I quickly bought some film (hard to get in 2007) and got the old AE1 out and put on the 400mm lens and tried to photograph the bird in my garden. It didn't go so well. After perusing the photography sites and forums, as any nerd would, I decided to get a Canon EOS 1D. It was then a six-year-old design, but it had been the first real professional digital camera for sport and wild-life. On the used market is was just on the way out, but those you could get were quite cheap. To top that off I bought a used Sigma 300mm f/2.8.
Canon EOS 1D the 2001 flag-ship digital SLR with a Sigma 300mm f/2.8.
4.1 megapixel
8 pictures / second
4kg
The trip was a huge success, and the camera was a dream to work with. These kinds of truly professional cameras are responsive and fast and built like tanks. It is just amazing to work with one, and they are obviously even better today. I filled up two 500MB memory cards every morning and every afternoon, totaling over 8000 pictures for the seven-day trip.

Lioness with cubs in the Masai Mara. On the third morning we met a pride of 17 lions just walking down the road. They walked right up to the trucks as if they owned the road and completely ignored us. Except for one that stopped to scratch an itch against our side door.
No matter how pretty the pictures were or how brilliantly the camera performed on safari, it is huge and heavy. My camera bag weighed over 15 kilograms in Africa. Once I was back in Norway this quickly became clear as I didn't get out with it much. If you go out with a four kilogram camera and a camera bag you don't bring anything else, and you would rather not walk too far. I changed to a Canon EOS 30D that was just a little bit old at that time. I bought a macro lens (as every photographer is bound to do at some point) and the macro flash (absolutely necessary) and did some macro photography (it's a phase).
Canon 30D with a 100mm f/2.8 macro and the twin-head macro flash. You can do amazing macro photography with this set up, but as it turns out so can anyone else.

Fly on flower photographed with the setup above. Search for "fly flower macro" on flickr and you will find another million pictures just like it.
Then I sold the lot, and bought an Epson R-D1. At the time a truly unique camera. It was the first digital rangefinder camera and it a Leica M lens mount. I used it incessantly for half a year.
Epson R-D1 digital rangefinder camera with a 21mm f/4 Voigtländer color-skopar lens and an external viewfinder.
Around that time I also found the fantastic Strobist blog and started doing proper flash photography with my newly acquired strobist kit. The idea is to use off camera flash instead of relying on natural light (which may be fickle) or on camera flash (which looks like shite). My poor boxer dog became quite good at posing.
Strobist kit of three flashes with radio triggers, stands and umbrellas around a bored boxer.
Bored boxer.
About half a year later I sold the R-D1 and bought the Leica M8, which I am now selling. However, before the present state of disuse, I used it quite a lot. Strobist fashion for portraits and I did street photography (which is kind of like photo-journalism but without being a journalist or going to a war-zone), and less pretentiously I photographed dogs. Lots and lots of dogs.
Dogs at play in Langeskogen in Bergen, Norway.
Some time later I got my first photo printer and started trying to print some high-quality photographs since it was difficult and expensive to get anything decent out of the photo-labs. Learning to print was quite satisfying and took a couple of months before I could do it well enough. Now, I should be perfecting my craft and in another couple of years I might be really good, but as I wrote, my activity is declining.

I started out frantically. In the second half of 2007 I shot 68 days. Then in 2008 it was 98 days of the year. In 2009 it decreased to 70 days, and in 2010 to 39 days. So far 2011 I have only photographed 8 days, and at least two of them were completely inane things like using the camera instead of a scanner. So now I am selling my Leica equipment.
Leica M8, four lenses and some accessories.
It is a bit sad, but a decision had to be made, and with an injured leg I was bored out of my mind and really needed something to do. If you are in Sweden the advert is at Fotosidan.se and there are more pictures in my flickr photo stream. The asking price is SEK 22000, or about €2400 (Edit: Now, just a few hours after the original post, the camera is gone. I must have charged too little).

Sunday, October 09, 2011

Injury and productivity

When you cannot move you have to do something else with your time. Like work (or watch a never-ending cavalcade of youtube-clips). While I don't think it is something that holds true over the longer term, I have certainly gotten some old projects finished rather faster than I otherwise would have.




But then my physiotherapist got her claws into me, and was all like "stop being such a sap and get out and use the bloody leg". In addition, I got this pretty blue and grey orthosis that gives some much needed side stability. So now I work as much as ever. The only difference now is that I walk more slowly, peddle my bicycle in a strange one-legged way, and at the end of the day I am slightly more tired than when I had two fully functioning legs. Today I got enough movement back to use the leg for a full revolution on the bicycle.

I ask you, if it sounds like a luxury problem, looks like a luxury problem, and smells like a luxury problem. Should I still be whining?

Saturday, October 01, 2011

Hell week

Knee in compression directly after the accident. If the foot looks bloodless it is because it is.
That is the end of my try to stay breast-to-breast with the elite. My leg got caught under my partner at randori and injured the medial collateral ligament on the left knee. Afterwards I have realised that what actually happened was a double whammy. First I blocked a throw by going down on the knee and landing quite hard. I didn't think too much about that, but it was the exact same spot that buckled just a minute later.

Now I'm looking at six to eight weeks of rehab. The first week wasn't that bad, at first. Then the blood in the joint osmotically attracted so much fluid that it had to be emptied. Being uncomfortable around needles, that was a bit of a downer. I pulled 35ml of blood and fluid out of the knee and then it didn't hurt as much.

Once that was done, I had a freeze-dried yoghurt-covered strawberry and bit off a tooth. Lengthwise. I got to my dentist, who obligingly pulled out a syringe and anesthetized my hard palate, compared to which puncturing the knee joint is nothing. Then ,she found two more holes and went on to put a needle in my lingual nerve and above the front teeth on the other side. The horror of the story is that i have to go back. Both to the knee-doctor and the dentist.

Publication bias

Funnel plot from Dubben & Beck-Bornholdt showing the publication bias in publications about publication bias.

Thanks to TED and Ben Goldacre, a doctor and epidemiologist, for showing me the best graph ever in his TED-talk: Battling Bad Science. It is the publication bias of publications on publication bias (Dubben & Beck-Bornholdt, BMJ, 331, August 2005, 433-434). Amazingly it is more skewed than most similar graphs in medicine where the publication bias is often held up as the scourge of science, and can be used to put any effect of treatment in doubt.

Now let's turn to our favourite field, hypertension. First we can look at something where we don't expect there to be a difference. For example Angiotensin Receptor Blockers (ARB) compared to Angiotensin Convertin Enzyme Inhibitors (ACEi). Some additional positive effect was expected from ARBs since they only block the evil, AT1, receptor while endogenous Angiotensin II (AngII) would still be able to activate the good, AT2, receptor. Results to this effect have been found in experimental studies, and in initial observational studies. In 2008, Matchar and collaborators reported a meta analysis of head-to-head trials of ARB vs. ACEi (Matchar et al. Ann Int Med. 148 (1) January 2008, 16-29). In their forest plot you first see the observational studies, and they do favour ARBs slightly. Then follows the 19 randomized controlled trials and the average effect is squarely on the identity line, there is no difference in mortality or cardiovascular events between ARBs and ACEi.

Forest plot from adapted from Matchar et al to show publication bias.
If you want to look at publication bias for the 19 studies they have analysed, you can either make a funnel plot as the one above, or you can just re-order the forest plot by effect size. What you should then find is a distribution that looks a little bit like a Q/Q-plot. The large trials should be close to the middle, while the smaller trials should show larger variation and form the tails of the curve. If one tail was missing, then that would be evidence of publication bias.  So, at least in the studies of ARBs vs. ACEi it appears that publication bias is small, and that the reported absence of a difference in clinical out-come may be true.

In clinical medicine today, pre-publication of the protocols and end-points of all clinical trials should pretty much remove publication bias. This may be what we see in the above plot. In basic science and, let's say, publication bias publishing this may still be a problem. In basic medicine the studies are not huge, pre-planned, things that any journal would want to pre-publish. The research is in its search for mechanisms much more of a chain of findings, each building upon the previous. Just one article will often describe as many studies as one of the above meta analyses. In that way they are often more solid than your single clinical trial because the basic finding is repeated several times for each new sub-experiment. At the same time they are more prone to bias by the research group, lab and model. That is, experimental studies should not be generalized outside of the lab where the experiments were performed or the model they were performed in unless you re-do them in another lab with another model. And then, they are true in two models and labs.