The documentation for get_categories was a little sparse in terms of telling you what the returned properties of the category object were.
So, I did print_r($cat) on the resultant categories. This was very handy. It told me that there is a parent property, that will have an ID of the parent category if there is one, and 0 if there is not one. Therefore, it was quite easy to add this bit of code at the top of my get_categories() loop to ignore non-top-level categories:
if ($cat->parent > 0) { continue; }
Here is the whole thing in an nutshell.
foreach (get_categories() as $cat) {
if ($cat->parent > 0) { continue; }
[... and now do whatever you want with the wanted categories... ]
}