Some additional comments on segmentation & hot keys

I've spent a good portion of my PhD working with 3D images in the program Avizo, which is essentially the same as the program Amira. This involved a steep learning curve and a lot of problem solving in the beginning. I've decided to write about the problems I've encountered and how I dealt with them in the hope that this may help the next person learning to use Avizo or Amira do so a bit faster, and with less frustration along the way. These problems will look trivial to the regular or advanced Amira/Avizo user, but they were quite frustrating at the time! These posts assume the reader's familiar with sections 2.1-2.5 of the Amira user's guide, which cover how to load, view and segment an image. My introductory post on this topic is here.

In this post I'm going to talk about some additional issues with the hot keys and with adding and subtracting to materials in the Image Segmentation Editor.

An additional hot key.

Here is a list I downloaded of the hot keys that you can use with the Image Segmentation Editor to really speed up segmentation. I've discussed them previously. There's one omission to the list (that I've found, anyway). Keys 1-9 cover the different tools, starting with the Brush tool, but what about the Pick & Move tool? Turns out, even though it's not on the list, "0" switches ("toggles") you to the Pick & Move tool! I've updated my list accordingly.

The add and subtract hot keys are finicky

The most straightforward and least efficient way to add a region of an image to a material is to select that region using whichever tool is most appropriate (in these examples I use the brush tool, which is the most straightforward tool, but again the least efficient) and then click on the Add button in the Selection section of the Segmentation Editor. Here's what that looks like:

There are two hot keys that are supposed to do the same thing, "A" and "Ctrl +". The trick is, neither works in exactly the same way. Once I figured out the differences between them it was quite useful, because now I can use whichever Add function best suits my needs at the time. But it was confusing to figure out.

Pressing "Ctrl +" adds the selected part of the image to the material, but leaves it selected. You must then remember to unselect the region manually using the Clear button in the Selection section of the Segmentation Editor.

That means that, if you then select a region that you want to add to a different material, say Lobe1, and then go to add your new selection to Lobe1, you will add both selections to Lobe1 unless you remember to unselect your first selection.

Using the "A" key to add a selection to a material is even more tricky. It only works if you've already added at least one selection to the material since editing any other material. So, practically, the "A" key will only add a selection to the material if the last thing you did was add (or subtract) a selection to the same material. Furthermore, where that previous selection was matters, and depends on your current settings. In the Selection section of the Segmentation Editor, if the button "Volume" is selected, then the previous selection you added could have been on any slice.

However, if the button "Current Slice" is selected in the Selection section of the Segmentation Editor, then the previous selection added to the current material (in this case, Lobe2) must have been in the current slice for the A hot key to work. 

The "-" hot key for subtracting a selection from the current material has the same sort of funny restrictions as the "A" hot key.

If you have any suggestions, feedback, or questions about Amira/Avizo, please let me know.

Trouble-shooting Avizo (and Amira by extension)

Some of my work involves dealing with 3D images, either CT scans, MRI scans, or z-stacks from a confocal microscope. To analyse these images there are a variety of tools available but the industry standard seems to be Amira. Amira is an incredibly powerful piece of software not just for analysing 3D images, but also for editing them and making them look pretty for figures and presentations. Unfortunately, it comes with the kind of price tag you'd expect. As an academic user, I'd be able to purchase Amira at half price, about $5000 AUD, before taxes and extensions. For my work, I'd probably ultimately need at least the quantification+ extension, and possibly the neuro and large data set extensions as well.

Fortunately, I've been able to avoid this insurmountable expense through collaborations. I collaborate with biologists, neuroscientists and computational wizzes at Monash University and the University of Queensland. Because I am a staff member at Monash, I've been able to access the MASSIVE remote desktop. Through this desktop I have access to Amira, almost. MASSIVE does not have a licence for Amira. Instead they have a licence for Avizo. Avizo, to my understanding, is the same program as Amira, with a different skin. Amira is geared towards the life sciences, while Avizo is geared towards the physical sciences and engineering, but they both ultimately do the same thing.

Since I have access to Avizo but not Amira, I've been using Avizo for things that Amira's really meant for. Furthermore, as far as I can tell (and I've done some sleuthing), I'm the only person at the Australian National University using Amira/Avizo (side note: if you're at ANU and use either of these programs, please let me know!) That means, though I have support from experts at the University of Queensland and Monash, I've largely been on my own in figuring out how to use Avizo/Amira. Usually, when I have problems figuring out how to use software, Google is my saviour, however I've found the online resources for troubleshooting Avizo/Amira woefully inadequate (again, if you know of good online resources for this, please let me know!)

As I've been learning to use Avizo/Amira, I've encountered quite a few challenges, which I've mostly solved through trial-and-error, with some desperate e-mails to experts. Since I haven't been able to find these solutions online, I thought I'd put them here in a series of posts, so that the next desperate person might solve these problems without wasting quite as much time banging their head against a keyboard as I have. I'd like to note that these problems are beginner problems and will look very simple to the advanced (or even just regular) Avizo/Amira user, but they were quite frustrating at the time!

First, I must say that the Amira training manual is very useful for learning both Amira and Avizo, and is very easy to use. I've done Chapters 2 and 7, which teach the basics (including segmentation, the tool I use most) and animations, respectively. The troubleshooting I describe will assume knowledge of Chapter 2, sections 2.1-2.5, which cover loading an image, viewing an image, and segmenting an image. The reason I use the Amira training manual rather than the Avizo training manual is that the Amira manual uses a neuroscience example (a bee brain) and neuroscience is what I do, so it's much easier to directly translate the examples to my work.

In addition to the steep learning curve involved in learning to use Amira/Avizo, there are two additional sources of confusion that I've found. First, there are some things that are different between Amira and Avizo which can make the Amira training manual difficult to follow in Avizo. I'll cover the issues I've found later. Second, I'm a Mac/Linux user, and I think that there are some bugs in Amira/Avizo that are particular to these two systems. Here's the first one:

Using the "hot keys" of the Image Segmentation Editor in OS X or Linux

First things first, and this might seem simple, but it was really confusing at the time. Any of the "hot key" commands (what Avizo/Amira calls keyboard shortcuts) that use the Control key on PCs STILL use the Control key on Macs. This is despite the fact that every other program I've ever encountered uses the Apple/Command key in place of the Control key for keyboard shortcuts on Macs. Get used to it, Mac users, it's the Control key in Amira/Avizo. Here is a PDF of the Segmentation Editor's hot keys.

Second, as far as I can tell, not all the hot keys actually work (at least for me, using OS X and Linux). I made this table as a guide for myself so I would know if a key command normally works or if I'm going nuts. Most of them do work for me and I recommend going through each of them one-by-one, just to see what they do. If I'd done that two years ago, I'd have saved a lot of time!

The issues I'm going to go through on this blog are similar to this one. They will be very basic to the regular or advanced Amira/Avizo user, but boy would I have been overjoyed for someone to have told me these things when I was learning! If you have a particular issue with Amira or Avizo, please let me know and I will help if I can.

 

Australian Pastoral Scenes

Spring is, to me, a time of idillic pastoral scenes played out in real life. One of the many fun things about rural Australia is the abundance of kangaroos where you would expect deer or domestic ungulates. Sometimes, driving around in Australia, I notice a scene that reminds me of an Alvan Fisher painting of rural nineteenth century America, except with kangaroos.

Of course, Australia is full of domestic ungulates, in addition to the roos.

Spring is here!

Spring has finally sprung in Canberra! I'm wearing t-shirts again, we're eating lunch outside in the sun, and babies seem to be popping up all over the place. Last season's baby eastern grey kangaroos are just about ready to leave the pouch. They are super cute, looking like the under-sized second head of a two-headed roo.

They look even more awkward when they dive into their mother's pouch head first.

This does not look comfortable. Tidbinbilla Nature Reserve, Australian Capital Territory.

The roos aren't the only ones with babies. There's an adorable family of musk ducks living on Yerrabi Pond in Gungahlin. Musk ducks are weird, unique animals. The males have a very strange, fleshy lobe hanging from their bills. Both sexes have spiky tail feathers that are unique amongst Australian ducks. Unfortunately we found the family just after sunset. The only pictures I have of the mother and duckings are silhouetted, and the uniqueness of the musk duck isn't really visible. However, I was able to get close enough to the father for the flash to be effective, and so both the fleshy lobe and the spiky tail are visible in the last picture.

While looking for the musk duck family I found a purple swamphen family on their massive nest of reeds. The purple swamphen is an extremely successful animal here in Australia, benefiting from human habitation and the creation of artificial waterways. They are a common sight around the creek that runs through the ANU campus and any Australian wetlands. Nonetheless they are a beautiful and charismatic bird and a pleasure to see.

Sunset may be an awkward time to photograph birds, but it is an excellent time to photograph sunsets:

Vegetation-dwellers, group 2

In his book "Biology and Evolution of Australian Lizards", Allen Greer sorted the lizards I study, the genus Ctenophorus, into different groups based on where they live: those that live in burrows, those that live in rock crevices, and those that live in vegetation. Looking at the phylogenetic relatedness of the Ctenophorus dragons, there are two groups of each: two groups of burrowers, two groups of rock-dwellers, and two groups of vegetation-dwellers. I thought it'd be fun to put up pictures and descriptions of all these groups, since I have a large pile of pictures from my fieldwork. These are my posts so far: Rock-dwellers #1, Rock-dwellers #2,  Burrowers #1, Burrowers #2, and Vegetation-dwellers #1.

This last group of Ctenophorus dragons are known as the military dragons. I don't know why, maybe because their patterns are full of stripes. They are also the largest group of Ctenophorus, with seven species. They're all quite small, weighing around 10 grams or less, and are long-legged sprinters. They don't shelter anywhere in particular, so they use a combination of their speed and any available vegetation to hide from predators. During my PhD, I deliberately went after two species, and we came across a third coincidentally while looking for other dragon species.

The two species in this group that I needed for my PhD were the mallee military dragon (Ctenophorus fordi) and the central military dragon (Ctenophorus isolepis). These two lizards are almost the exact same. They are quick, skittish lizards that are always on the flat ground. They never perch on branches, climb trees, or sit on top of bushes as other dragon lizards often do. They do everything - bask, hunt, mate, etc. - on solid ground. They also have a preferred habitat type, spinifex, and are so closely associated with spinifex that we called them the spinifex dragons. Spinifex is a famous type of grass here in Australia, famous mostly because it is basically a clump of outwards-pointing spears. I vividly remember my volunteers trying to catch mallee military dragons by hand; I had horrible visions of them poking their eyes out on the spinifex as they dove for dragons. The dragons use this to their advantage. If they're scared, they dive into a dense spinifex bush, which is basically an impenetrable fortress of spikes!

The immense spikiness of a spinifex plant. Mulga Park Station, Northern Territory, 2012. Photo by Angus Kennedy.

There were a few key differences between the mallee and central military dragons. First, the mallee military dragon was extremely abundant. We broke all records for single-day lizard catching with this species when, on the very last day of my 2012 field season, we caught 32 mallee military dragons between noon and 5 p.m. That is a lot of dragons! On the other hand, central military dragons are only moderately abundant. It took us two days to catch the same number of central military dragons as we caught mallee military dragons in half a day. This is still much more abundant than any other dragon species. That number of dragons would usually take us 4-6 days to catch, and with the rusty dragon it took three weeks!

Central military dragons are also about double the size of mallee military dragons. Mallee military dragons prefer their spinifex to be under the shade of a canopy of mallee trees, whereas central military dragons like their spinifex exposed, with no trees in sight, like in the picture above.

An additional difference is that central military dragons are sexually dimorphic, meaning that the males and females look different, while mallee military dragons are sexually monomorphic, meaning both sexes look the same. In the case of the central military dragon, this means that the male has a heck of a lot more black on him than the female, and has a more complex pattern. Male and female mallee military dragons look almost identical. There is no sexual dimorphism in this species, except for some extra black markings on the underside of the male.

A male central military dragon (Ctenophorus isolepis). Mulga Park Station, Northern Territory, 2012. Photo by Angus Kennedy.

A female central military dragon (Ctenophorus isolepis). Mulga Park Station, Northern Territory, 2012. Photo by Angus Kennedy.

A male mallee military dragon (Ctenophorus fordi). Gluepot Reserve, South Australia, 2011. Photo by Tobias Hayashi.

A female mallee military dragon (Ctenophorus fordi). Gluepot Reserve, South Australia, 2011. Photo by Tobias Hayashi.

While looking for claypan dragons in southwest Western Australia, we came across a few spotted military dragons (Ctenophorus maculatus). This species is very similar to the other two military dragons, but it doesn't live in spinifex. Instead, they seemed to like areas that were open, but with short woody plants all over the place. They also didn't seem to be nearly as common as the other two, but maybe that was just because we weren't looking.

A female spotted military dragon (Ctenophorus maculatus). near Lake Cronin, Western Australia, 2013. Photo by Angus Kennedy.

Those are the three members of this group of vegetation-dwellers we came across during my fieldwork. Of the other four, only one is widespread and well known. The lozenge-marked dragon (Ctenophorus scutulatus) is the largest member of this group and is found over a large area of Western Australia just north of Perth. The other three species, the long-tailed military dragon (Ctenophorus femoralis), the rufus military dragon (Ctenophorus rubens), and McKenzie's dragon (Ctenophorus mckenziei) are all very poorly known critters. They're all restricted to small areas of remote habitat: the former two halfway up the coast of Western Australia, and the latter on the Nullabor plain. McKenzie's dragon also has the unfortunate distinction of being endangered.