Accessing the brain region ontology programmatically

Is there any way to programmatically access the ontology used in the Allen’s interactive atlas?

That is, to be able to access the tree structure that Dorsal Thalamus is a child of Thalamus, etc

Appreciate that the API exists… but IMHO it doesn’t seem very user friendly or well-documented as far as I can tell.

Is there an R package that’s used internally that could be released? Or one hidden in a repo somewhere that has been hacked together using the API?

What I’m really looking for is just to get the tree structure of the ontology, with full names and acronyms.

Thank you Nathan, for some of us even the R or other programmatic tool may be not enough friendly, what s wrong with using diagrams? I am trying to figure out how to vidualise the data tree from the google sheet that contains the data table should not be difficult once we work out how. I think select name of first colum then show what other conlums hang from each eleement/cell in that colum and show as mindmap/tree. should be trivial. let me know when you figure it out please

I’m not aware of anything specifically addressing your request, but here are a few things that might be useful.

It may also be worth mentioning this html version of the CCF ontology here: Allen-CCF-2020: anatomical substructures